Re: Table inheritance surprise - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Table inheritance surprise
Date
Msg-id 1214568716.3845.360.camel@ebony.site
Whole thread Raw
In response to Re: Table inheritance surprise  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Table inheritance surprise  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, 2008-06-26 at 18:53 -0400, Bruce Momjian wrote:
> David Fetter wrote:
> > Folks,
> > 
> > When I do CREATE TABLE foo(LIKE bar INCLUDING CONSTRAINTS), it doesn't
> > include foreign key constraints (8.3.1).  I believe this is surprising
> > behavior, but maybe not a bug, so I'd like to propose another bit of
> > syntactic sugar, namely
> > 
> >     LIKE [INCLUDING FOREIGN KEYS]
> > 
> > which would do what it looks like it does.
> > 
> > What say?
> 
> TODO has:
> 
>         o Allow inherited tables to inherit indexes, UNIQUE constraints,
>           and primary/foreign keys

INCLUDING CONSTRAINTS is non-standard so maybe we can just make
INCLUDING CONSTRAINTS also include foreign keys.

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: VirtualXactLockTableInsert
Next
From: Alvaro Herrera
Date:
Subject: Re: ecpg generated files ignorable?