Re: pg_dumpall + restore = missing view - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_dumpall + restore = missing view
Date
Msg-id 639.1100913874@sss.pgh.pa.us
Whole thread Raw
In response to pg_dumpall + restore = missing view  (Steve Crawford <scrawford@pinpointresearch.com>)
Responses Re: pg_dumpall + restore = missing view
List pgsql-general
Steve Crawford <scrawford@pinpointresearch.com> writes:
> This appears to have all gone well execpt that one view is missing.
> I've restored that view by hand but am curious if this is a PG bug or
> failure of the nut behind the wheel.

> The view involves the union of many tables and its creation failed
> because creation of one of the tables does not take place until later
> in the dump file.

This is a longstanding pg_dump bug: it's not very bright about order of
creation of objects.  (In this case I surmise that you created the view,
and later altered it to reference a table that didn't exist when the
view was originally created.)

As of 8.0 pg_dump examines dependency information and should theoretically
always get this right, but in prior versions it's a real hazard.

            regards, tom lane

pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: pg_dumpall + restore = missing view
Next
From: "Premsun Choltanwanich"
Date:
Subject: Re: How to make lo_import and lo_export to use file