Inherited Constraints

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Inherited Constraints
Date: 2005-12-07 21:24:05
Message-ID: 1133990645.2906.969.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Following patch implements record of whether a constraint is inherited
or not, and prevents dropping of inherited constraints.

What it doesn't do:
It doesn't yet prevent dropping the parent constraint, which is wrong,
clearly, but what to do about it?
1. make dropping a constraint drop all constraints dependent upon it
(without any explicit cascade)
2. add a new clause to ALTER TABLE .... DROP CONSTRAINT .... CASCADE

I prefer (1), since it is SQL Standard compliant, easier to remember and
automatic de-inheritance is the natural opposite of the automatic
inheritance process.

Current patch passes make check on cvstip, applies cleanly.

Further patch will utilise this new knowledge to reduce the number of
tests made during constraint_exclusion.

Best Regards, Simon Riggs

Attachment Content-Type Size
coninh.patch text/x-patch 13.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2005-12-07 21:50:59 Re: Foreign key trigger timing bug?
Previous Message Darcy Buskermolen 2005-12-07 20:57:34 Re: Foreign key trigger timing bug?

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2005-12-07 21:54:44 Re: TODO-Item: Rename of constraints
Previous Message Nicolas Barbier 2005-12-07 21:09:09 Re: [PATCHES] Patch to allow contrib/pgbench files to have blank lines