pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedconditional backup
2+ messages / 2 participants
[nested] [flat]
* conditional backup
@ 2010-07-16 05:03 suhailck <suhailck@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: suhailck @ 2010-07-16 05:03 UTC (permalink / raw)
To: pgsql-admin
Hi,
I need to take backup of my postgresql DB, but not all records from a few
tables.
My DB contains more than 700 tables, out of which 15 tables i need to take
this conditional backup
Example:
Table: C_order
I need to take backup from table C_order where "period=2009" and "org <> A"
This is done to improve performance there by deleting all non-org records
for old period from org A's server.
Expecting ur feedbacks
Thanks in advance!!!
--
View this message in context: http://old.nabble.com/conditional-backup-tp29180107p29180107.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: conditional backup
@ 2010-07-16 15:48 Kevin Grittner <Kevin.Grittner@wicourts.gov>
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Grittner @ 2010-07-16 15:48 UTC (permalink / raw)
To: suhailck@gmail.com; pgsql-admin
suhailck <suhailck@gmail.com> wrote:
> I need to take backup of my postgresql DB, but not all records
> from a few tables.
You can exclude particular tables from a database backup using the
-T option (which can be included multiple times). You can dump just
the schema for particular tables with the -s and -t switches. You
can use the \copy command in psql to copy out selected rows using
syntax like:
\copy (select * from C_order where period=2009 and org <> 'A') to
C_order.data
You should be able to wire something together from those pieces.
-Kevin
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2010-07-16 15:48 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-07-16 05:03 conditional backup suhailck <suhailck@gmail.com>
2010-07-16 15:48 Re: conditional backup Kevin Grittner <Kevin.Grittner@wicourts.gov>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox