Re: delete columns from table! - Mailing list pgsql-general

From Tim Barnard
Subject Re: delete columns from table!
Date
Msg-id 00cf01c12411$33ff5520$a519af3f@hartcomm.com
Whole thread Raw
In response to Question about Foreign key!  (Fariba Noorbakhsh <fNoorbakhsh@tecways.com>)
List pgsql-general
Another way SELECT INTO a new table, omitting the column you want to delete.

Tim

----- Original Message -----
From: "Patrick Welche" <prlw1@newn.cam.ac.uk>
To: "Fariba Noorbakhsh" <fNoorbakhsh@tecways.com>
Cc: <pgsql-general@postgresql.org>
Sent: Monday, August 13, 2001 7:36 AM
Subject: Re: [GENERAL] delete columns from table!


> On Mon, Aug 06, 2001 at 05:42:09PM +0200, Fariba Noorbakhsh wrote:
> > Hi Patrick,
> >
> > Do you know how I can drop(delete) a column from a table?! Just a
column. I don't
> > think you can do it with Alter table
> >
> > Thanks in advance,
> > Fariba
>
> According to the TODO list:
>
> COMMANDS
> ...
> * ALTER
> ...
>     o Add ALTER TABLE DROP COLUMN feature [drop]
>
>
> so the way forward may be to
> pg_dump -t your_table -D your_database > table.txt
> and have fun editing out all reference to said column from table.txt. Then
> drop the table and reload from table.txt. YMMV..
>
> Cheers,
>
> Patrick
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>


pgsql-general by date:

Previous
From: wsheldah@lexmark.com
Date:
Subject: Re: How can I view the definition of an existing trigger?
Next
From: Stephan Szabo
Date:
Subject: Re: Some questions on using arrays.