Re: [GENERAL] ALTER TABLE

From: Dmitry Morozovsky <marck(at)rinet(dot)ru>
To: "Jonathan R(dot) Karlen" <jkarlen(at)karlen(dot)com>
Cc: pgsql-general(at)hub(dot)org
Subject: Re: [GENERAL] ALTER TABLE
Date: 1999-08-10 17:39:03
Message-ID: Pine.BSF.4.05.9908102133270.15954-100000@woozle.rinet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)rinet(dot)ru ***
------------------------------------------------------------------------

In response to

  • ALTER TABLE at 1999-08-09 16:31:51 from Jonathan R. Karlen

Browse pgsql-general by date

  From Date Subject
Next Message Bill Garrett 1999-08-10 21:39:18 anomalous, persistent high loads with postgresql 6.5.1
Previous Message Dmitry Morozovsky 1999-08-10 17:30:31 repost: unique composite index with boolean fields