Thread: Re: [GENERAL] child table doesn't inherit PRIMARY KEY?

Re: [GENERAL] child table doesn't inherit PRIMARY KEY?

From
Bruce Momjian
Date:
OK, what do people want to do with this item?  Add to TODO list?

Seems making a separat unique constraint would be easy to do and be of
value to most users.


> 
> Probably, since I see it in near recent sources (and it affects
> UNIQUE as well.  As I remember it, the last discussion on this couldn't
> determine what the correct behavior for unique/primary key constraints
> was in the inheritance case (is it a single unique hierarchy through
> all the tables [would be needed for fk to inheritance trees] or
> separate unique constraints for each table [which would be similar
> to how many people seem to currently use postgres inheritance as a 
> shortcut]). 
> 
> On Thu, 18 Jan 2001, Bruce Momjian wrote:
> 
> > Does this bug still exist?
> > 
> > [ Charset ISO-8859-1 unsupported, converting... ]
> > > Louis-David Mitterrand writes:
> > > 
> > > > When creating a child (through CREATE TABLE ... INHERIT (parent)) it
> > > > seems the child gets all of the parent's contraints _except_ its PRIMARY
> > > > KEY. Is this normal?
> 
> 


--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [GENERAL] child table doesn't inherit PRIMARY KEY?

From
Stephan Szabo
Date:
On Wed, 24 Jan 2001, Bruce Momjian wrote:

> 
> OK, what do people want to do with this item?  Add to TODO list?
> 
> Seems making a separat unique constraint would be easy to do and be of
> value to most users.

The problem is that doing that will pretty much guarantee that we won't
be doing foreign keys to inheritance trees without changing that behavior
and we've seen people asking about adding that too.  I think that this
falls into the general category of "Make inheritance make sense" (Now 
there's a todo item :) )  Seriously, I think the work on how inheritance
is going to work will decide this, maybe we end up with a real inheritance
tree system and something that works like the current stuff in which case
I'd say it's probably one unique for the former and one per for the
latter.