Re: drop column? - Mailing list pgsql-admin

From Nick Fankhauser
Subject Re: drop column?
Date
Msg-id NEBBLAAHGLEEPCGOBHDGKEOEEDAA.nickf@ontko.com
Whole thread Raw
In response to drop column?  (Jodi Kanter <jkanter@virginia.edu>)
List pgsql-admin
>Can I remove this column or will I need to drop the entire table and
restore from backup?

There's not a "remove column" option for alter table, but you may be able to
get around restoring by renaming the existing table, creating a replacement
the way you want it to look, & then copy from the old to new using "insert
into table newtable (col1,col2) values (select col1,col2 from oldtable);"

-Nick

--------------------------------------------------------------------------
Nick Fankhauser  nickf@ontko.com  Phone 1.765.935.4283  Fax 1.765.962.9788
Ray Ontko & Co.     Software Consulting Services     http://www.ontko.com/


pgsql-admin by date:

Previous
From: Phill Kenoyer
Date:
Subject: Re: drop column?
Next
From: bangh
Date:
Subject: Re: drop column?