Re: pg_restore ordering questions - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_restore ordering questions
Date
Msg-id 10169.1253918315@sss.pgh.pa.us
Whole thread Raw
In response to pg_restore ordering questions  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-general
Steve Crawford <scrawford@pinpointresearch.com> writes:
> I am preparing to collapse two databases in a cluster into a single
> database (current step in a roadmap preparing to update a system from
> 7.4.6 up to 8.4.1).

> In testing, I have a step that dumps the schema of one of the databases,
> creates an object list, removes the unwanted objects, then restores the
> schema into an empty database. This step is failing due to attempts to
> restore views/indexes prior to creation of the referenced table. I have
> stripped it down to the minimum and it still fails:

I think that we didn't teach pg_dump about dependency ordering until 8.0
or so.  If you're unlucky enough to hit this in 7.4, you have to fix it
via manual reordering of the dump items.

> 4. The recommended upgrade procedure is to use pg_dump from the newer
> PostgreSQL version. But is it safe to use an up-to-date
> pg_dump/pg_restore on an old version of PostgreSQL?

No, the dump typically won't load into an older server, at least not
without some manual editing to correct uses of newer syntax.

Why don't you update to 8.4 first and then do your other housekeeping?

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: stored procedure: RETURNS record
Next
From: Alvaro Herrera
Date:
Subject: Re: lazy vacuum and AccessExclusiveLock