Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

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

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.



pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group