pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lonh SENG <slonh@camgsm.com.kh>
To: Jodi Kanter <jkanter@virginia.edu>
To: Postgres Admin List <pgsql-admin@postgresql.org>
Subject: Re: drop column?
Date: Thu, 24 Jan 2002 08:57:37 +0700
Message-ID: <009901c1a47a$7f88ed50$05a00017@idlonh> (raw)
References: <008401c1a447$cd0402f0$de138f80@virginia.edu>

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@virginia.edu









view thread (8+ messages)  latest in thread

Message-ID: <009901c1a47a$7f88ed50$05a00017@idlonh>
Permalink:  ../009901c1a47a$7f88ed50$05a00017@idlonh/
Also on:    postgresql.org/message-id/009901c1a47a$7f88ed50$05a00017@idlonh

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: slonh@camgsm.com.kh, jkanter@virginia.edu
  Subject: Re: drop column?
  In-Reply-To: <009901c1a47a$7f88ed50$05a00017@idlonh>
  References: <008401c1a447$cd0402f0$de138f80@virginia.edu> <009901c1a47a$7f88ed50$05a00017@idlonh>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox