how to create dump of selected rows from a table

From: anj patnaik <patna73(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: how to create dump of selected rows from a table
Date: 2015-12-17 17:28:18
Message-ID: CAEQKwSkAaBE7sU=YUuVuKZBepiExtTFRSgYRV-3+K1hUaQ_=KA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Currently, I am running pg_dump on an entire table of a database by doing:

PGPASSWORD=$PGPASSWORDB /opt/data/PostgreSQL/9.4/bin/pg_dump -t RECORDER
-Fc $i -U pguser -Z0 | xz -9 > "$backup_dir/$i-$timeslot-database"

However, this table has a lot of rows.

Is there a way I could do pg_dump on a subset of rows that match a criteria
say via a sql statement?

Does anyone have any snippets on how to do that?

Thank you

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2015-12-17 20:48:49 Re: Index contains unexpected zero page at block
Previous Message Adrian Klaver 2015-12-17 17:20:12 Re: - PostgreSQL Replication Types