Re: pg_dump only certain rows

From: "Anthony E (dot) Greene" <agreene(at)pobox(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_dump only certain rows
Date: 2001-02-10 23:18:17
Message-ID: 20010210181817.E8182@cp5340
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sat, 10 Feb 2001 16:11:00 Stefan Waidele jun. wrote:
>I want to normalize an existing table.
>
>Is there a way to drop the unwanted columns in my original table?
>
>SQL-alter does not seem to do it, neither can I specify the columns used in
>
>pd_dump. Or have I overlooked something?

Select the rows and columns you want directly into a new table, then drop
the old table:

SELECT column1,column2 INTO new_table FROM old_table WHERE
filter_conditions;

Tony
--
Anthony E. Greene <agreene(at)pobox(dot)com> <http://www.pobox.com/~agreene/>
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D
Chat: AOL/Yahoo: TonyG05 ICQ: 91183266
Linux. The choice of a GNU Generation. <http://www.linux.org/>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Andy Arledge 2001-02-12 04:50:16 novice, question
Previous Message Stefan Waidele jun. 2001-02-10 21:11:00 pg_dump only certain rows