Re: drop column?

From: "Jason C(dot) Wells" <jcwells(at)nwlink(dot)com>
To: Andrew Gould <andrewgould(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: drop column?
Date: 2000-10-04 15:49:34
Message-ID: Pine.SOL.3.96.1001004084525.22073A-100000@utah
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 4 Oct 2000, Andrew Gould wrote:

> How do you drop a column from a table? I'm using
> PostgreSQL 7.0.2.

From the FAQ.

4.5) How do you remove a column from a table?

We do not support ALTER TABLE DROP COLUMN, but 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;

Thank you,
Jason C. Wells

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Poul L. Christiansen 2000-10-04 15:54:13 Re: drop column?
Previous Message Adam Lang 2000-10-04 15:34:07 Re: drop column?