faqts : Computers : Databases : PostgreSQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

33 of 41 people (80%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How do I remove a column from a table?

Apr 14th, 2000 06:58
Graeme Merrall, Kevin Jackson,


Basically you can't. The ALTER TABLE syntax allows adding and renaming 
a column. If it's just a rename you're after then everything is fine.
If you want to really drop the table then the easiest thing to do is to 
copy the table to a new table using COPY then drop the old table and 
recreate it from the temp table using CREATE TABLE AS SELECT etc

Hope this helps.