Thread: pg_dump only certain rows

pg_dump only certain rows

From
"Stefan Waidele jun."
Date:
Hello again,

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?

Thanks,

Stefan


Re: pg_dump only certain rows

From
"Anthony E . Greene"
Date:
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@pobox.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/>