Re: pg_dump dependencies

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Eric E <whalesuit(at)bonbon(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump dependencies
Date: 2005-01-06 18:45:59
Message-ID: 18582.1105037159@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Fuhr <mike(at)fuhr(dot)org> writes:
> On Thu, Jan 06, 2005 at 12:10:26PM -0500, Eric E wrote:
>> I have a question about pg_dump. I am backing up a database using
>> pg_dump in text mode, which works perfectly for me, with one exception.
>> I have a view vwDependentView which references another view,
>> vwIndependentView. However, when I feed my dump script to psql, it is
>> attempting to make vwDependentView first and failing.

> What version of PostgreSQL are you using? pg_dump tends to improve
> with each release; I couldn't duplicate your problem in 8.0.0rc3
> or 7.4.6.

8.0 is the first version in which pg_dump really is capable of avoiding
this sort of problem. In older releases the dump order is basically the
same as the order of original creation of the objects --- so you can
easily confuse it by, for example, doing CREATE OR REPLACE VIEW to
modify a view to reference a table that didn't exist when the view was
first defined.

A workaround that may or may not be worse than the disease is to drop
the dependent view completely and then recreate it. If there's other
stuff that depends on the dependent view this can cascade into a real
PITA :-(

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joost Kraaijeveld 2005-01-06 19:19:26 Re: Query, view join question.
Previous Message Tom Lane 2005-01-06 18:39:16 Re: Query, view join question.