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

Re: Problem identifying constraints which should not be inherited

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Chris Fischer" <Chris(dot)Fischer(at)channeladvisor(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Problem identifying constraints which should not be inherited
Date: 2007-04-12 20:11:41
Message-ID: 4698.1176408701@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
"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

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-04-12 20:24:47
Subject: Re: Do we still need "log_invalid_page"?
Previous:From: Tom LaneDate: 2007-04-12 19:56:58
Subject: Re: [PATCHES] Reviewers Guide to Deferred Transactions/Transaction Guarantee

pgsql-bugs by date

Next:From: Stefan KaltenbrunnerDate: 2007-04-13 08:41:10
Subject: BUG #3223: Testbugreport for new wwwmaster
Previous:From: Chris FischerDate: 2007-04-12 19:17:02
Subject: Problem identifying constraints which should not be inherited

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