Re: Confusion about inheritance -- NEVER MIND - Mailing list pgsql-general

From Timothy Perrigo
Subject Re: Confusion about inheritance -- NEVER MIND
Date
Msg-id 4DCB174C-A43A-11D8-A185-000A95C4F0A2@wernervas.com
Whole thread Raw
In response to Confusion about inheritance -- NEVER MIND  (felix-lists-pgsql@crowfix.com)
List pgsql-general
As you've discovered, primary key constraints (and other constraints)
do not inherit, but perhaps something like the following will work for
you:

create table base (id serial primary key, (other fields to be
inherited...));
create table derived (new_field1 varchar(10), (other new fields...),
constraint derived_pkey primary key(id)) inherits base;

Hope this helps,
Tim

On May 12, 2004, at 11:16 AM, felix-lists-pgsql@crowfix.com wrote:

> Well well, after I posted my request for help, I thought to search the
> mailing list archive, and lo! and behold! there was a discussion in
> December 2003 of the exact same problem, with the "resolution" that it
> is a design limitation, it may have been put on some request list, and
> it looks like I need to go back to individually defined tables or find
> some other workaround ...
>
> So unless someone has developed a patch for this for 7.4.2, I will now
> continue with my irregularly scheduled poking around and learning ...
>
> Thanks to everybody for PostgreSQL anyway :-)
>
> --
>             ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
>      Felix Finch: scarecrow repairman & rocket surgeon /
> felix@crowfix.com
>   GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR
> license #4933
> I've found a solution to Fermat's Last Theorem but I see I've run out
> of room o
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: one to many
Next
From: Dennis Gearon
Date:
Subject: Re: one to many