Thread: inheritance...

inheritance...

From
Tom Allison
Date:
Ran into something really unexpected, but then I've never tried using
inherited tables.

I have a master table (named master) that has two child tables.

create table master (
   id serial,
   foo varchar(20),
   bar varchar(20),
   constraint foobar_master unique (foo,bar)
);

Now when I do this with just a table, the unique constraint works.

But when I have child tables:

create table slave (
   status varchar(20),
   deleted boolean default false
) inherits (master);

I seem to lose that unique constraint.  Which makes for a HUGE problem.

Am I missing something in the fine print?

Re: inheritance...

From
Klint Gore
Date:
Tom Allison wrote:
> Am I missing something in the fine print?
fine print = see 5.8.1 Caveats on
http://www.postgresql.org/docs/8.3/interactive/ddl-inherit.html

klint.

--
Klint Gore
Database Manager
Sheep CRC
A.G.B.U.
University of New England
Armidale NSW 2350

Ph: 02 6773 3789
Fax: 02 6773 3266
EMail: kgore4@une.edu.au