Skip site navigation (1) Skip section navigation (2)

Re: CHECK NO INHERIT syntax

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CHECK NO INHERIT syntax
Date: 2012-07-20 20:12:05
Message-ID: 395.1342815125@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Alvaro Herrera <alvherre(at)commandprompt(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2012-07-20 20:17:08
Subject: Re: [COMMITTERS] pgsql: Remove prepared transactions from main isolation test schedule.
Previous:From: Alvaro HerreraDate: 2012-07-20 20:07:13
Subject: Re: CHECK NO INHERIT syntax

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group