Re: delete column - Mailing list pgsql-general

From Bruce Momjian
Subject Re: delete column
Date
Msg-id 200204262058.g3QKw2916217@candle.pha.pa.us
Whole thread Raw
In response to Re: delete column  ("Hillensbeck, Preston" <PHillensbeck@sfbcic.com>)
Responses Re: delete column  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general
Hillensbeck, Preston wrote:
> There isn't a DROP COLUMN function yet, but you can do this...
>
> SELECT ... -- select all columns but the one you want to remove
> INTO TABLE new_table
> FROM old_table;
> DROP TABLE old_table;
> ALTER TABLE new_table RENAME TO old_table;
>
> This is straight out of Bruce Momjian's book, so you can give him credit for
> this :)

This is from the FAQ, which appears in my book.  I think I wrote that
too, or at least with help from others.  Wish we had a cleaner way, but
right now, that is all we have.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: wsheldah@lexmark.com
Date:
Subject: Re: delete column
Next
From: "Ian Harding"
Date:
Subject: Re: delete column