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

From Christopher Kings-Lynne
Subject Re: BETWEEN Node & DROP COLUMN
Date
Msg-id GNELIHDDFBOCMGBFGEFOCEPMCCAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Re: BETWEEN Node & DROP COLUMN  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: BETWEEN Node & DROP COLUMN  (Alvaro Herrera <alvherre@atentus.com>)
Re: BETWEEN Node & DROP COLUMN  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> > pg_attribute is very possibly the most ticklish system catalog
> > to add a column to.  I'd suggest looking through every single use of
> > some other pg_attribute column, perhaps attstattarget or attnotnull,
> > to make sure you're initializing attisdropped everywhere it should be.

Done.

Wow - I've almost finished it now, actually!  It's at the stage where
everything works as expected, all the initdb attributes are properly marked
not dropped, the drop column command works fine and psql works fine.  All
regression tests also pass.  '*' expansion works properly.

I have a lot of testing to go, however.  I will make up regression tests as
well.

Some questions:

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?

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?

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.

Thanks,

Chris





pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Issues Outstanding for Point In Time Recovery (PITR)
Next
From: Tatsuo Ishii
Date:
Subject: Proposal: CREATE CONVERSION