Re: [HACKERS] ALTER TABLE DROP COLUMN

Don Baccus <dhogaza@pacifier.com>

From: Don Baccus <dhogaza@pacifier.com>
To: Hannu Krosing <hannu@tm.ee>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>, Peter Eisentraut <peter_e@gmx.net>, PostgreSQL Development <pgsql-hackers@postgreSQL.org>
Date: 2000-02-27T18:17:52Z
Lists: pgsql-hackers
At 08:06 PM 2/27/00 +0200, Hannu Krosing wrote:

>Does SQL92 syntax allow dropping several columns, i.e.
>
>ALTER TABLE mytable DROP COLUMN col1,col5,col6;

My reading of the syntax says no, it is not allowed.

>If it does, it would be very desirable to implement it to avoid the need 
>for vacuum between each DROP in order to have _only_ 2X disk usage.

However, implementing useful extensions to the standard in an
upward-compatible way doesn't bother me.

I'm not fond of language implementations that are full of gratuitous
extensions, but when extensions address real shortcomings in a standard
or intersect with a particular implementation in a useful way, then
it makes sense to add them.  In this case, you're asking for an
extension that's useful because Postgres doesn't reclaim storage when
a tuple's deleted, but only when the table's vacuumed.  Seems fair
enough.

Whether or not it would be hard to implement is another matter...



- Don Baccus, Portland OR <dhogaza@pacifier.com>
  Nature photos, on-line guides, Pacific Northwest
  Rare Bird Alert Service and other goodies at
  http://donb.photo.net.