Re: pg_dump question - Mailing list pgsql-general

From Richard Huxton
Subject Re: pg_dump question
Date
Msg-id 459D3AD9.9080805@archonet.com
Whole thread Raw
In response to pg_dump question  (Madison Kelly <linux@alteeve.com>)
Responses Re: pg_dump question
List pgsql-general
Madison Kelly wrote:
> Hi all,
>
>   I've created a database (pgsql 8.1 on Debian Etch) that uses
> triggers/functions to keep all changes for various tables in a history
> schema. This is the first time I've done this (captured and stored
> changes in a different schema) so I was hoping for some backup/restore
> advice.
>
>   As far as I can tell, you can only dump one schema at a time. Is this
> true?

No, pg_dump dumps a whole database by default. You can dump just a
single schema or table though.

 > If so, can I dump 'public' first and then append the dump of
> 'history' to the same file and be okay?

No, someone might have updated public in-between.

 > Also, when I restore from this
> file, can I prevent the triggers from running just during the reload of
> the data?

Yes, there's a command-line setting when doing a data-only restore. When
doing a full restore (schema+data) this is done for you.

Try the page below or "man pg_dump"/"man pg_restore" for full details:
http://www.postgresql.org/docs/8.1/static/reference-client.html

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Discovering time of last database write
Next
From: Karsten Hilbert
Date:
Subject: Re: self-referential UPDATE problem on 7.4