pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nick Fankhauser <nickf@ontko.com>
To: Jodi Kanter <jkanter@virginia.edu>
To: Postgres Admin List <pgsql-admin@postgresql.org>
Subject: Re: drop column?
Date: Wed, 23 Jan 2002 15:25:59 -0500
Message-ID: <NEBBLAAHGLEEPCGOBHDGKEOEEDAA.nickf@ontko.com> (raw)
In-Reply-To: <008401c1a447$cd0402f0$de138f80@virginia.edu>


>Can I remove this column or will I need to drop the entire table and
restore from backup?

There's not a "remove column" option for alter table, but you may be able to
get around restoring by renaming the existing table, creating a replacement
the way you want it to look, & then copy from the old to new using "insert
into table newtable (col1,col2) values (select col1,col2 from oldtable);"

-Nick

--------------------------------------------------------------------------
Nick Fankhauser  nickf@ontko.com  Phone 1.765.935.4283  Fax 1.765.962.9788
Ray Ontko & Co.     Software Consulting Services     http://www.ontko.com/




view thread (8+ messages)  latest in thread

Message-ID: <NEBBLAAHGLEEPCGOBHDGKEOEEDAA.nickf@ontko.com>
Permalink:  ../NEBBLAAHGLEEPCGOBHDGKEOEEDAA.nickf@ontko.com/
Also on:    postgresql.org/message-id/NEBBLAAHGLEEPCGOBHDGKEOEEDAA.nickf@ontko.com

 · 

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: nickf@ontko.com, jkanter@virginia.edu
  Subject: Re: drop column?
  In-Reply-To: <NEBBLAAHGLEEPCGOBHDGKEOEEDAA.nickf@ontko.com>
  References: <008401c1a447$cd0402f0$de138f80@virginia.edu> <NEBBLAAHGLEEPCGOBHDGKEOEEDAA.nickf@ontko.com>

* 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