Re: BETWEEN Node & DROP COLUMN - Mailing list pgsql-hackers

From Tom Lane
Subject Re: BETWEEN Node & DROP COLUMN
Date
Msg-id 10896.1025879662@sss.pgh.pa.us
Whole thread Raw
In response to Re: BETWEEN Node & DROP COLUMN  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> 1. I'm going to prevent people from dropping the last column in their table.
> I think this is the safest option.  How do I check if there's any other non
> dropped columns in a table?  Reference code anywhere?

You look through the Relation's tupledesc and make sure there's at least
one other non-dropped column.

> 2. What should I do about inheritance?  I'm going to implement it, but are
> there issues?  It will basically drop the column with the same name in all
> child tables.  Is that correct behaviour?

Yes, if the 'inh' flag is set.

If 'inh' is not set, then the right thing would be to drop the parent's
column and mark all the *first level* children's columns as
not-inherited.  How painful that would be depends on what representation
we choose for marking inherited columns, if any.

> 3. I am going to initially implement the patch to ignore the behaviour and
> do no dependency checking.  I will assume that Rod's patch will handle that
> without much trouble.

Yeah, Rod was looking ahead to DROP COLUMN.  I'm still working on his
patch (mostly the pg_constraint side) but should have it soon.
        regards, tom lane




pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: Should next release by 8.0 (Was: Re: [GENERAL] I am
Next
From: Tom Lane
Date:
Subject: Re: Proposal: CREATE CONVERSION