Re: DROP COLUMN misbehaviour with multiple inheritance - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: DROP COLUMN misbehaviour with multiple inheritance
Date
Msg-id Pine.LNX.4.44.0209201634350.16381-100000@cm-lcon1-46-187.cm.vtr.net
Whole thread Raw
In response to Re: DROP COLUMN misbehaviour with multiple inheritance  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane dijo: 

> I think we could make all these cases work if we replaced attisinherited
> with *two* columns, a boolean attislocal(ly defined) and a count of
> (direct) inheritances.  DROP ONLY would have the effect of decrementing
> the count and setting attislocal to true in each direct child; recursive
> DROP would decrement the count and then drop if count is 0 *and*
> attislocal is not set.  At the start of a recursion, we'd allow DROP
> only if count is 0 (and, presumably, attislocal is true, else the column
> would not be there...).

The cases you presented are really tricky.  I'll work today on the
attislocal and attinhcount patch; I hope to have it ready later today
for review and inclusion before beta2.

-- 
Alvaro Herrera (<alvherre[a]atentus.com>)
Officer Krupke, what are we to do?
Gee, officer Krupke, Krup you! (West Side Story, "Gee, Officer Krupke")



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Optimizer generates bad plans.
Next
From: John Buckman
Date:
Subject: Lyris looking to help fix PostgresSQL crashing problems