Re: CHECK NO INHERIT syntax - Mailing list pgsql-hackers

From Tom Lane
Subject Re: CHECK NO INHERIT syntax
Date
Msg-id 395.1342815125@sss.pgh.pa.us
Whole thread Raw
In response to Re: CHECK NO INHERIT syntax  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: CHECK NO INHERIT syntax  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> True.  I have added an error check at creation time.  Please suggest
> improved wording for the message:

> alvherre=# create domain positiveint2 as int check (value > 0) no inherit;
> ERROR:  CHECK constraints for domains cannot be NO INHERIT

I think "CHECK constraints for domains cannot be marked NO INHERIT"
would be fine.

>  ConstraintElem:
> -            CHECK opt_no_inherit '(' a_expr ')' ConstraintAttributeSpec
> +            CHECK '(' a_expr ')' opt_no_inherit ConstraintAttributeSpec

This doesn't seem to me to meet the principle of least surprise.  Surely
NO INHERIT ought to be folded into ConstraintAttributeSpec so that it
acts like other constraint decorations, ie order isn't significant.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: CHECK NO INHERIT syntax
Next
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: Remove prepared transactions from main isolation test schedule.