8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.43 2003/08/08 21:41:32 momjian Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.44 2003/09/09 23:22:19 petere Exp $
12
12
*
13
13
* DESCRIPTION
14
14
* The "DefineFoo" routines take the parse tree and pick out the
@@ -594,8 +594,8 @@ DefineDomain(CreateDomainStmt *stmt)
594
594
/* Check for unsupported constraint types */
595
595
if (IsA (newConstraint , FkConstraint ))
596
596
ereport (ERROR ,
597
- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
598
- errmsg ("FOREIGN KEY constraints not supported for domains" )));
597
+ (errcode (ERRCODE_SYNTAX_ERROR ),
598
+ errmsg ("foreign key constraints not possible for domains" )));
599
599
600
600
/* otherwise it should be a plain Constraint */
601
601
if (!IsA (newConstraint , Constraint ))
@@ -672,14 +672,14 @@ DefineDomain(CreateDomainStmt *stmt)
672
672
*/
673
673
case CONSTR_UNIQUE :
674
674
ereport (ERROR ,
675
- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
676
- errmsg ("UNIQUE constraints not supported for domains" )));
675
+ (errcode (ERRCODE_SYNTAX_ERROR ),
676
+ errmsg ("unique constraints not possible for domains" )));
677
677
break ;
678
678
679
679
case CONSTR_PRIMARY :
680
680
ereport (ERROR ,
681
- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
682
- errmsg ("PRIMARY KEY constraints not supported for domains" )));
681
+ (errcode (ERRCODE_SYNTAX_ERROR ),
682
+ errmsg ("primary key constraints not possible for domains" )));
683
683
break ;
684
684
685
685
case CONSTR_ATTR_DEFERRABLE :
@@ -688,7 +688,7 @@ DefineDomain(CreateDomainStmt *stmt)
688
688
case CONSTR_ATTR_IMMEDIATE :
689
689
ereport (ERROR ,
690
690
(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
691
- errmsg ("deferrability constraints not supported for domains" )));
691
+ errmsg ("specifying constraint deferrability not supported for domains" )));
692
692
break ;
693
693
694
694
default :
@@ -1453,8 +1453,8 @@ AlterDomainAddConstraint(List *names, Node *newConstraint)
1453
1453
/* Check for unsupported constraint types */
1454
1454
if (IsA (newConstraint , FkConstraint ))
1455
1455
ereport (ERROR ,
1456
- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
1457
- errmsg ("FOREIGN KEY constraints not supported for domains" )));
1456
+ (errcode (ERRCODE_SYNTAX_ERROR ),
1457
+ errmsg ("foreign key constraints not possible for domains" )));
1458
1458
1459
1459
/* otherwise it should be a plain Constraint */
1460
1460
if (!IsA (newConstraint , Constraint ))
@@ -1465,33 +1465,20 @@ AlterDomainAddConstraint(List *names, Node *newConstraint)
1465
1465
1466
1466
switch (constr -> contype )
1467
1467
{
1468
- case CONSTR_DEFAULT :
1469
- ereport (ERROR ,
1470
- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
1471
- errmsg ("use ALTER DOMAIN .. SET DEFAULT instead" )));
1472
- break ;
1473
-
1474
- case CONSTR_NOTNULL :
1475
- case CONSTR_NULL :
1476
- ereport (ERROR ,
1477
- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
1478
- errmsg ("use ALTER DOMAIN .. [ SET | DROP ] NOT NULL instead" )));
1479
- break ;
1480
-
1481
1468
case CONSTR_CHECK :
1482
1469
/* processed below */
1483
1470
break ;
1484
1471
1485
1472
case CONSTR_UNIQUE :
1486
1473
ereport (ERROR ,
1487
- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
1488
- errmsg ("UNIQUE constraints not supported for domains" )));
1474
+ (errcode (ERRCODE_SYNTAX_ERROR ),
1475
+ errmsg ("unique constraints not possible for domains" )));
1489
1476
break ;
1490
1477
1491
1478
case CONSTR_PRIMARY :
1492
1479
ereport (ERROR ,
1493
- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
1494
- errmsg ("PRIMARY KEY constraints not supported for domains" )));
1480
+ (errcode (ERRCODE_SYNTAX_ERROR ),
1481
+ errmsg ("primary key constraints not possible for domains" )));
1495
1482
break ;
1496
1483
1497
1484
case CONSTR_ATTR_DEFERRABLE :
@@ -1500,7 +1487,7 @@ AlterDomainAddConstraint(List *names, Node *newConstraint)
1500
1487
case CONSTR_ATTR_IMMEDIATE :
1501
1488
ereport (ERROR ,
1502
1489
(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
1503
- errmsg ("deferrability constraints not supported for domains" )));
1490
+ errmsg ("specifying constraint deferrability not supported for domains" )));
1504
1491
break ;
1505
1492
1506
1493
default :
0 commit comments