Re: [PATCHES] Inherited Constraints

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Hannu Krosing <hannu(at)skype(dot)net>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Inherited Constraints
Date: 2006-03-08 15:35:01
Message-ID: 20060308073214.W77062@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Wed, 8 Mar 2006, Hannu Krosing wrote:

> hel kenal peval, E, 2006-03-06 kell 17:25, kirjutas Bruce Momjian:
> > Hannu Krosing wrote:
> > > ?hel kenal p?eval, E, 2006-03-06 kell 12:12, kirjutas Bruce Momjian:
> > > > Added to TODO:
> > > >
> > > > o Prevent parent tables from altering or dropping constraints
> > > > like CHECK that are inherited by child tables
> > > >
> > > > Dropping constraints should only be possible with CASCADE.
> > > >
> > > > and we already have this in TODO:
> > > >
> > > > o %Prevent child tables from altering or dropping constraints
> > > > like CHECK that were inherited from the parent table
> > > >
> > > > so I think we now have all the failure cases documented.
> > >
> > > If you want to be consistent, then ALTER TABLE ONLY ADD CONSTRAINT ..
> > > should also be forbidden, so you can't create non-inherited constraints
> >
> > I don't have a problem with creating ONLY constraints on parents and
> > children. We just don't want them to be removed/modified if they are
> > shared.
>
> Well, when you delete a constraint from child, the constraint becomes an
> "ONLY" constraint on parent.

Only if there's a single child, otherwise you have a partially-ONLY
constraint unless you made it ONLY constraints on the parent and all other
children (but then removing the parent constraint wouldn't remove it from
the other children presumably).

> If you allow ONLY constraints on parents, then why disallow dropping
> them from childs ?

I agree with this in any case. I think both are fairly broken.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stefan Kaltenbrunner 2006-03-08 15:35:11 Re: problem with large maintenance_work_mem settings and
Previous Message Luke Lonergan 2006-03-08 15:28:16 Re: Merge algorithms for large numbers of "tapes"

Browse pgsql-patches by date

  From Date Subject
Next Message David Fetter 2006-03-08 15:47:21 Add switches for DELIMITER and NULL in pg_dump COPY
Previous Message Stephan Szabo 2006-03-08 15:29:53 Re: CREATE SYNONYM ...