Re: Dumping/Restoring with constraints?

From: Bill Moran <wmoran(at)collaborativefusion(dot)com>
To: "Phoenix Kiula" <phoenix(dot)kiula(at)gmail(dot)com>
Cc: "PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dumping/Restoring with constraints?
Date: 2008-08-27 14:24:03
Message-ID: 20080827102403.dc69c802.wmoran@collaborativefusion.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

In response to "Phoenix Kiula" <phoenix(dot)kiula(at)gmail(dot)com>:

> > The recommended solution is to use a regular schema-and-data dump.
> > If you really have to separate schema and data, the --disable-triggers
> > switch might help, though you open yourself to the possibility of
> > loading inconsistent data that way.
>
> Thanks Tom.
>
> This is the dump command being used on a 8.2.3 database on Linux:
>
> $ pg_dumpall > mydb.sql
> $ umask 077
> $ gzip mydb.sql
>
> Then I download the mydb.sql.gz file into my local computer (Mac OSX
> with 8.3.3) and unzip it to mydb.sql.
>
> The local database is already created, with all tables and constraints and all.

Don't do that. Do one of the following:
*) Allow the dump file to create all tables.
*) In the early step dump the data only with pg_dumpall --disable-triggers -a

--
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

wmoran(at)collaborativefusion(dot)com
Phone: 412-422-3463x4023

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Phoenix Kiula 2008-08-27 14:26:37 Re: Dumping/Restoring with constraints?
Previous Message Merlin Moncure 2008-08-27 14:18:14 Re: [GENERAL] PITR - base backup question

Browse pgsql-general by date

  From Date Subject
Next Message Phoenix Kiula 2008-08-27 14:26:37 Re: Dumping/Restoring with constraints?
Previous Message Merlin Moncure 2008-08-27 14:18:14 Re: [GENERAL] PITR - base backup question