Re: drop column?

From: "lonh SENG" <slonh(at)camgsm(dot)com(dot)kh>
To: "Jodi Kanter" <jkanter(at)virginia(dot)edu>, "Postgres Admin List" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: drop column?
Date: 2002-01-24 01:57:37
Message-ID: 009901c1a47a$7f88ed50$05a00017@idlonh
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Jodi,

Of course, we should have 'alter table .... drop column ....' statement.
>Can I remove this column or will I need to drop the entire table and
restore from backup?
You can do as following:
select fields_you_want_to_keep into new_table from old_table.
Make sure that this statement execute successfully. Then drop the old table
and change table name (alter table ... rename to ...).
I am a newbie of postgres.

lonh
----- Original Message -----
From: Jodi Kanter
To: Postgres Admin List
Sent: Thursday, January 24, 2002 2:54 AM
Subject: [ADMIN] drop column?

I cannot seem to locate any documentation about removing a column that I
just added to a table. There is no data in that particular column but there
is in the rest of the table.
Can I remove this column or will I need to drop the entire table and restore
from backup?
Thanks
Jodi
_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter(at)virginia(dot)edu

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jean Huveneers 2002-01-24 08:02:34 Maximum Performance
Previous Message Zhang, Anna 2002-01-23 21:24:30 timing a process