Dropping a column

From: Patrick Aland <paland(at)stetson(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Dropping a column
Date: 2001-01-18 18:04:30
Message-ID: 20010118130429.P12170@stetson.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I know how to drop a column from a table by selecting into a new table the columns I want to keep. However the problem I am running into is that some of the columns in my original table have certain attibutes (auto incrememnting, default values, etc) however the method of:

SELECT id,name,description INTO TABLE temp FROM origtable;
DROP TABLE origtable;
ALTER TABLE temp RENAME TO origtable;

Preserves my data but not the extra column information (at least according to a \d tablename)

Anyone know if it is possible to do this?

Thanks.

--
------------------------------------------------------------
Patrick Aland paland(at)stetson(dot)edu
Network Administrator Voice: 904.822.7217
Stetson University Fax: 904.822.7367
------------------------------------------------------------

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lémery 2001-01-18 18:07:52 Troubles with performances
Previous Message Bruce Momjian 2001-01-18 18:01:13 Re: [HACKERS] GET DIAGNOSTICS SELECT PROCESSED INTO <int4_variable>