Re: selective backup and restore

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: luca(dot)ciciriello(at)email(dot)it
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: selective backup and restore
Date: 2008-02-22 10:45:01
Message-ID: 47BEA7AD.800@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

luca(dot)ciciriello(at)email(dot)it wrote:
> Hi All.
> Is it possible in postgreSQL 8.2.4, using pg_dump.exe, make a
> backup/restore conditioned to the key of some tables (respecting
> existing constraints)?

You can either use the -t option or
with a full backup in custom format
you can pick a few objects (tables, views, ...)
by creating the list with pg_restore -l and
edit it in a text editor and then use -L
to extract the DDL/DML for these objects.

See:

http://www.postgresql.org/docs/8.3/static/app-pgdump.html

-t table
--table=table

for pg_dump
and

http://www.postgresql.org/docs/8.3/static/app-pgrestore.html

-F format
--format=format (use t or c)

and

-l
--list

List the contents of the archive. The output of this operation can
be used with the -L option to restrict and reorder the items that are
restored.
-L list-file
--use-list=list-file

Restore elements in list-file only, and in the order they appear in
the file. Lines can be moved and can also be commented out by placing a
; at the start of the line. (See below for examples.)

Regards
Tino

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ludger Zachewitz 2008-02-22 10:52:35 Selecting large objects stored as bytea
Previous Message Richard Huxton 2008-02-22 10:15:50 Re: ts_headline