BUG #2308: pg_dump -a does not respect referential dependencies

From: "Matthew George" <georgema(at)corp(dot)earthlink(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2308: pg_dump -a does not respect referential dependencies
Date: 2006-03-08 17:13:46
Message-ID: 20060308171346.560DBF0B08@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2308
Logged by: Matthew George
Email address: georgema(at)corp(dot)earthlink(dot)net
PostgreSQL version: 8.0.3
Operating system: Darwin Kernel Version 8.5.0: Sun Jan 22 10:38:46 PST
2006; root:xnu-792.6.61.obj~1/RELEASE_PPC Power Macintosh powerpc
Description: pg_dump -a does not respect referential dependencies
Details:

When using pg_dump to dump a database, the schema and data are arranged
within the dump so that it may be imported without violating referential
integrity.

When using the -a option to get a data-only dump, the data is ordered in the
dump alphabetically by table.

If a new schema is loaded into a fresh database, the output from the
data-only dump cannot be imported via \i in psql without manually editing
the dump file and reordering the inserts / copies such that dependent tables
have their data loaded before the tables that depend on them. This is
inconvenient at best.

Since the logic obviously exists within pg_dump already to arrange the data
in the correct order of reference dependencies, can this be added to the
code path for `pg_dump -a` as well? Or can another option be added that
specifies alphabetic vs. dependency order?

This would really cut down the time it takes to do schema upgrades on
projects that I work with.

Thanks

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Fuhr 2006-03-08 20:30:37 Re: BUG #2306: Duplicate primary key
Previous Message Giza Kamil 2006-03-08 10:27:20 BUG #2307: Buckup and sequences in DEFAULT part