Re: pg_dump/pg_restore schema and data separately and foreign key constraints

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Vasiliy Vasin <vasi3854(at)yandex(dot)ru>
Subject: Re: pg_dump/pg_restore schema and data separately and foreign key constraints
Date: 2009-05-12 23:26:19
Message-ID: 200905121626.19336.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 12 May 2009 2:35:10 pm Vasiliy Vasin wrote:
> In the end, decided to make easier: make a complete dump except tables that
> I don't want to backup, then just dump schema of these tables. So I have 2
> files: schema+data for all except table1 and table2, schema only for table1
> and table2. It's a strangely that pg_restore is still no option to check
> the constraints after you insert all data. Something like
> http://www.postgresql.org/docs/8.3/static/sql-set-constraints.html

It is more of a conceptual problem. Unless you really do a complete dump (which
you actually did not do above) then the schema and data become decoupled. A
less than complete restore could be any combination of data and schema from
various points in time. A partial pg_restore has no way of "knowing" what is
correct, therefore it is left for the user to decide correctness.

>
> 13.05.09, 01:17, "Adrian Klaver" <aklaver(at)comcast(dot)net>:
> > Sounds like an ordering problem, you are restoring the child table before
> > the parent. Best bet is to dump the table data to individual files and
> > restore them in the proper order.

--
Adrian Klaver
aklaver(at)comcast(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Turner, Ian 2009-05-12 23:59:22 Best way to monitor, control, or rewrite data definition commands?
Previous Message Vasiliy Vasin 2009-05-12 21:35:10 Re: pg_dump/pg_restore schema and data separately and foreign key constraints