Re: [GENERAL] ALTER TABLE - Mailing list pgsql-general

From Dmitry Morozovsky
Subject Re: [GENERAL] ALTER TABLE
Date
Msg-id Pine.BSF.4.05.9908102133270.15954-100000@woozle.rinet.ru
Whole thread Raw
In response to ALTER TABLE  ("Jonathan R. Karlen" <jkarlen@karlen.com>)
List pgsql-general
On Mon, 9 Aug 1999, Jonathan R. Karlen wrote:

JRK> Is there a way to drop a field from a table?  ALTER TABLE seems to only
JRK> allow the adding and modification of fields.

Try to select all content to temporary table, then drop old table, create
new with unneeded column(s) removed, and them reselect all data back.

Also, don't forget to re-create indexes, rules, views and other
table-related things as they are reference table by its (internal to
Postgres) ID. Also don't forget to create needed permissions.

For large tables, dumping, editing schema & data with simple script and
then recreating database may be simpler solution...

Sincerely,
D.Marck                                   [DM5020, DM268-RIPE, DM3-RIPN]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------


pgsql-general by date:

Previous
From: Dmitry Morozovsky
Date:
Subject: repost: unique composite index with boolean fields
Next
From: Wim Kerkhoff
Date:
Subject: Selecting between dates