88 *
99 *
1010 * 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 $
1212 *
1313 * DESCRIPTION
1414 * The "DefineFoo" routines take the parse tree and pick out the
@@ -594,8 +594,8 @@ DefineDomain(CreateDomainStmt *stmt)
594594/* Check for unsupported constraint types */
595595if (IsA (newConstraint ,FkConstraint ))
596596ereport (ERROR ,
597- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
598- errmsg ("FOREIGN KEY constraints notsupported for domains" )));
597+ (errcode (ERRCODE_SYNTAX_ERROR ),
598+ errmsg ("foreign key constraints notpossible for domains" )));
599599
600600/* otherwise it should be a plain Constraint */
601601if (!IsA (newConstraint ,Constraint ))
@@ -672,14 +672,14 @@ DefineDomain(CreateDomainStmt *stmt)
672672 */
673673case CONSTR_UNIQUE :
674674ereport (ERROR ,
675- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
676- errmsg ("UNIQUE constraints notsupported for domains" )));
675+ (errcode (ERRCODE_SYNTAX_ERROR ),
676+ errmsg ("unique constraints notpossible for domains" )));
677677break ;
678678
679679case CONSTR_PRIMARY :
680680ereport (ERROR ,
681- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
682- errmsg ("PRIMARY KEY constraints notsupported for domains" )));
681+ (errcode (ERRCODE_SYNTAX_ERROR ),
682+ errmsg ("primary key constraints notpossible for domains" )));
683683break ;
684684
685685case CONSTR_ATTR_DEFERRABLE :
@@ -688,7 +688,7 @@ DefineDomain(CreateDomainStmt *stmt)
688688case CONSTR_ATTR_IMMEDIATE :
689689ereport (ERROR ,
690690(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
691- errmsg ("deferrability constraints not supported for domains" )));
691+ errmsg ("specifying constraint deferrability not supported for domains" )));
692692break ;
693693
694694default :
@@ -1453,8 +1453,8 @@ AlterDomainAddConstraint(List *names, Node *newConstraint)
14531453/* Check for unsupported constraint types */
14541454if (IsA (newConstraint ,FkConstraint ))
14551455ereport (ERROR ,
1456- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
1457- errmsg ("FOREIGN KEY constraints notsupported for domains" )));
1456+ (errcode (ERRCODE_SYNTAX_ERROR ),
1457+ errmsg ("foreign key constraints notpossible for domains" )));
14581458
14591459/* otherwise it should be a plain Constraint */
14601460if (!IsA (newConstraint ,Constraint ))
@@ -1465,33 +1465,20 @@ AlterDomainAddConstraint(List *names, Node *newConstraint)
14651465
14661466switch (constr -> contype )
14671467{
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-
14811468case CONSTR_CHECK :
14821469/* processed below */
14831470break ;
14841471
14851472case CONSTR_UNIQUE :
14861473ereport (ERROR ,
1487- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
1488- errmsg ("UNIQUE constraints notsupported for domains" )));
1474+ (errcode (ERRCODE_SYNTAX_ERROR ),
1475+ errmsg ("unique constraints notpossible for domains" )));
14891476break ;
14901477
14911478case CONSTR_PRIMARY :
14921479ereport (ERROR ,
1493- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
1494- errmsg ("PRIMARY KEY constraints notsupported for domains" )));
1480+ (errcode (ERRCODE_SYNTAX_ERROR ),
1481+ errmsg ("primary key constraints notpossible for domains" )));
14951482break ;
14961483
14971484case CONSTR_ATTR_DEFERRABLE :
@@ -1500,7 +1487,7 @@ AlterDomainAddConstraint(List *names, Node *newConstraint)
15001487case CONSTR_ATTR_IMMEDIATE :
15011488ereport (ERROR ,
15021489(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
1503- errmsg ("deferrability constraints not supported for domains" )));
1490+ errmsg ("specifying constraint deferrability not supported for domains" )));
15041491break ;
15051492
15061493default :