Problem identifying constraints which should not be inherited

From: "Chris Fischer" <Chris(dot)Fischer(at)channeladvisor(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: Problem identifying constraints which should not be inherited
Date: 2007-04-12 19:17:02
Message-ID: D45F1ECA30B59A4F96208F86532F901F14448935@rdu-caex-01.channeladvisor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

There's no way in the pg_ tables to identify when a check constraint on
an inherited table should not be inherited. Example:

create table t1 (col1 number(10));

create table t2 () inherits t2;

alter table only t1 add constraint ck_col1 check (number <> 0);

Now, run pg_dump and notice that the check constraint is not created
with ONLY in the dump and, therefore, ends up on t2 when executed.

Chris Fischer
Database Engineer

<http://www.channeladvisor.com/>

ChannelAdvisor Corporation
2701 Aerial Center Parkway
Morrisville | North Carolina | 27560
919.228.2011

Many Channels. One Advisor.
www.channeladvisor.com <http://www.channeladvisor.com/>

<http://feeds.feedburner.com/ChanneladvisorBlog>


Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-04-12 20:11:41 Re: Problem identifying constraints which should not be inherited
Previous Message Tom Lane 2007-04-12 15:05:40 Re: Continuous archiving fails

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-04-12 19:56:58 Re: [PATCHES] Reviewers Guide to Deferred Transactions/Transaction Guarantee
Previous Message Carlos Moreno 2007-04-12 19:10:18 Re: Slow Postgresql server