Re: pg_dump ordering problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sue Fitt <sue(at)inf(dot)ed(dot)ac(dot)uk>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_dump ordering problem
Date: 2005-10-25 14:01:54
Message-ID: 13547.1130248914@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Sue Fitt <sue(at)inf(dot)ed(dot)ac(dot)uk> writes:
> (I tried v7.4 and v8.0.4 pg_dump and got the same thing). Looking at the
> output file db.out I can see that the domain and function are used near
> the beginning of the file, but defined at the end.

I don't think you tried the 8.0 pg_dump. (7.4 did not have any
dependency ordering logic and so was quite prone to this sort of thing,
but 8.0 ought to get it right.) If you're certain you did use 8.0,
could we see those parts of the schema?

> As an aside, why does pg_dump output altered tables as CREATE TABLE...
> ALTER TABLE instead of just updating the CREATE TABLE statement to
> assimilate the ALTER TABLE information?

This is one of the techniques used to break circular dependencies.
Also, indexes and foreign key constraints are deliberately added after
loading data, for speed reasons.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Lane Van Ingen 2005-10-25 14:04:04 Re: Windows "msi" and "-int.msi"
Previous Message Kevin Crenshaw 2005-10-25 13:47:05 Re: First Install