[development] Postgres- For compatibility reasons we don't drop columns but rename them?

Keegan Quinn keegan at thebasement.org
Sat Dec 17 03:39:40 UTC 2005


On Fri, Dec 16, 2005 at 10:01:09PM -0500, Rowan Kerr wrote:
> On 12/16/05, Neil Drumm <drumm at delocalizedham.com> wrote:
> > Postgres: ALTER TABLE {$table} RENAME $column TO $column_old // For
> > compatibility reasons we don't drop columns but rename them
> >
> > Why do we do this? What compatibility reasons?
> 
> It's been a while since I dealt with any of our pg stuff at work, but
> I think Postgres doesn't actually allow you to drop columns... You
> would have to create a new table without the column, and then move all
> the data over.
> 
> Could be completely off-base though!

Well, this is not the case in any recent versions of PostgreSQL; DROP
COLUMN works fine on all of the installations I have access to (7.4
and 8.0 series).  According to the docs[0], 7.3 supported it as well.

Could still be true for even older versions, I suppose.  Is there a
documented minimum requirement?

-- 
Keegan Quinn  <keegan at thebasement.org>
CEO, Producer
the basement productions
http://www.thebasement.org


[0] http://www.postgresql.org/docs/7.3/interactive/ddl-alter.html#AEN1977

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.drupal.org/pipermail/development/attachments/20051217/f7030bcd/attachment.pgp


More information about the development mailing list