@@ -2953,58 +2953,8 @@ AlterDomainAddConstraint(List *names, Node *newConstraint,
2953
2953
2954
2954
constr = (Constraint * ) newConstraint ;
2955
2955
2956
- switch (constr -> contype )
2957
- {
2958
- case CONSTR_CHECK :
2959
- case CONSTR_NOTNULL :
2960
- /* processed below */
2961
- break ;
2962
-
2963
- case CONSTR_UNIQUE :
2964
- ereport (ERROR ,
2965
- (errcode (ERRCODE_SYNTAX_ERROR ),
2966
- errmsg ("unique constraints not possible for domains" )));
2967
- break ;
2968
-
2969
- case CONSTR_PRIMARY :
2970
- ereport (ERROR ,
2971
- (errcode (ERRCODE_SYNTAX_ERROR ),
2972
- errmsg ("primary key constraints not possible for domains" )));
2973
- break ;
2974
-
2975
- case CONSTR_EXCLUSION :
2976
- ereport (ERROR ,
2977
- (errcode (ERRCODE_SYNTAX_ERROR ),
2978
- errmsg ("exclusion constraints not possible for domains" )));
2979
- break ;
2980
-
2981
- case CONSTR_FOREIGN :
2982
- ereport (ERROR ,
2983
- (errcode (ERRCODE_SYNTAX_ERROR ),
2984
- errmsg ("foreign key constraints not possible for domains" )));
2985
- break ;
2986
-
2987
- case CONSTR_ATTR_DEFERRABLE :
2988
- case CONSTR_ATTR_NOT_DEFERRABLE :
2989
- case CONSTR_ATTR_DEFERRED :
2990
- case CONSTR_ATTR_IMMEDIATE :
2991
- ereport (ERROR ,
2992
- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
2993
- errmsg ("specifying constraint deferrability not supported for domains" )));
2994
- break ;
2995
-
2996
- case CONSTR_ATTR_ENFORCED :
2997
- case CONSTR_ATTR_NOT_ENFORCED :
2998
- ereport (ERROR ,
2999
- (errcode (ERRCODE_INVALID_OBJECT_DEFINITION ),
3000
- errmsg ("specifying constraint enforceability not supported for domains" )));
3001
- break ;
3002
-
3003
- default :
3004
- elog (ERROR , "unrecognized constraint subtype: %d" ,
3005
- (int ) constr -> contype );
3006
- break ;
3007
- }
2956
+ /* enforced by parser */
2957
+ Assert (constr -> contype == CONSTR_CHECK || constr -> contype == CONSTR_NOTNULL );
3008
2958
3009
2959
if (constr -> contype == CONSTR_CHECK )
3010
2960
{
0 commit comments