Re: Problem identifying constraints which should not be inherited

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Chris Fischer <Chris(dot)Fischer(at)channeladvisor(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Problem identifying constraints which should not be inherited
Date: 2008-03-07 01:07:07
Message-ID: 200803070107.m27177O15696@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers


Added to TODO:

> o Require all CHECK constraints to be inherited
>
> http://archives.postgresql.org/pgsql-bugs/2007-04/msg00026.php

---------------------------------------------------------------------------

Tom Lane wrote:
> "Chris Fischer" <Chris(dot)Fischer(at)channeladvisor(dot)com> writes:
> > alter table only t1 add constraint ck_col1 check (number <> 0);
>
> The bug here is that we allow that. Continuing your example,
>
> regression=# insert into t2 values(0);
> INSERT 0 1
> regression=# select * from t1;
> col1
> ------
> 0
> (1 row)
>
> which sure looks to me like a violation of the principle of least
> surprise.
>
> This has come up before and I think the consensus was to disallow
> non-inherited check constraints; not sure why it hasn't been done yet.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Shana8426 2008-03-07 02:45:44 BUG #4018: Installation failure
Previous Message Tom Lane 2008-03-07 01:05:02 Re: [BUGS] BUG #3975: tsearch2 index should not bomb out of 1Mb limit

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-03-07 01:21:44 Terminating a backend
Previous Message Bruce Momjian 2008-03-07 00:58:47 Re: Idle idea for a feature