Re: Proposed patch: make pg_dump --data-only consider FK constraints

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Proposed patch: make pg_dump --data-only consider FK constraints
Date: 2008-09-07 22:39:28
Message-ID: 87hc8ry40v.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> I doubt that very many people will ever see it at all, actually --- how
> common are circular FK relationships? And it does seem appropriate to
> me for pg_dump to be noisy about the possibility of trouble at restore
> time. (Maybe the message should also suggest using a schema+data dump,
> since that would be a solution at dump time?)

I think they're surprisingly common actually. Most complex databases end up
with them one way or another. Either through a parent-child relationship or
from two different types of relationships (such as "user which owns this
directory" and "home directory of this user").

The other reason to think NOTICE might be better is that it's something which,
if it occurs once, will always occur for that database. So a sysadmin will
become inured to seeing WARNING on his backups. Are there any other warning
conditions which could occur spontaneously that this would mask?

One minor thought -- surely the main use case for data-only dumps is for
importing into another brand of database. In which case the message seems a
bit awkward -- it could talk generically about disabling or dropping the
constraints and then have a hint to indicate how to do that with Postgres.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's PostGIS support!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-09-07 23:21:04 Re: Proposed patch: make pg_dump --data-only consider FK constraints
Previous Message Gregory Stark 2008-09-07 22:29:48 Re: About that CommitFest redirect page ...