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

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 (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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

pgsql-hackers by date

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

pgsql-bugs by date

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

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