pg_dump of only range of tables

Started by Robert Jamesover 12 years ago3 messagesgeneral
Jump to latest
#1Robert James
srobertjames@gmail.com

Is there any way to do a pg_dump (or equivalent) of only part of a
table? Say I want to send data to someone for only part of the table
(expressable with a WHERE clause).

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Szymon Guz
mabewlun@gmail.com
In reply to: Robert James (#1)
Re: pg_dump of only range of tables

On 28 October 2013 22:27, Robert James <srobertjames@gmail.com> wrote:

Is there any way to do a pg_dump (or equivalent) of only part of a
table? Say I want to send data to someone for only part of the table
(expressable with a WHERE clause).

Hi,
you can use COPY or \COPY for that:
http://www.postgresql.org/docs/9.3/static/sql-copy.html

regards,
Szymon

#3Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Szymon Guz (#2)
Re: pg_dump of only range of tables

On 10/28/2013 02:30 PM, Szymon Guz wrote:

On 28 October 2013 22:27, Robert James <srobertjames@gmail.com
<mailto:srobertjames@gmail.com>> wrote:

Is there any way to do a pg_dump (or equivalent) of only part of a
table? Say I want to send data to someone for only part of the table
(expressable with a WHERE clause).

Hi,
you can use COPY or \COPY for that:
http://www.postgresql.org/docs/9.3/static/sql-copy.html

or use CREATE TABLE AS :

www.postgresql.org/docs/9.3/interactive/sql-createtableas.html

and dump the new table.

regards,
Szymon

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general