Re: Inheritance, Primary Keys and Foreign Keys - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Inheritance, Primary Keys and Foreign Keys
Date
Msg-id 1147203811.4572.48.camel@localhost.localdomain
Whole thread Raw
In response to Inheritance, Primary Keys and Foreign Keys  (Albert Cervera Areny <albertca@hotpop.com>)
Responses Re: Inheritance, Primary Keys and Foreign Keys
List pgsql-hackers
On Tue, 2006-05-09 at 01:20 +0200, Albert Cervera Areny wrote:

>     In my particular case (don't know about the SQL standard or other cases),
> it'd be enough if when an inherited table is created:
>     - A primary key in the inherited table is created with the same columns as
> the super table.
>     - A trigger is created in the new table that ensures that this primary key
> doesn't exist in the super table.
>     - A trigger is created in the super table that ensures that this primary key
> doesn't exist in it's sub tables.

Why not add these in your design rather than into the database?

All of the above can be added using existing DDL and you can group
things together in a transaction and call when required.

--  Simon Riggs EnterpriseDB          http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PERFORM] Big IN() clauses etc : feature proposal
Next
From: Tom Lane
Date:
Subject: standard_conforming_strings vs escape_string_warning