Sunday, September 7, 2008

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

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Tom Lane wrote:
>> pg_dump: WARNING: circular foreign-key constraints among these table(s):
>> pg_dump: master
>> pg_dump: child
>> pg_dump: You may not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.

> WARNING feels a bit too strong. I realize that that message isn't going
> to the postmaster's log, bloating it, but if a user does that regularly,
> always disabling triggers as instructed, or there is in fact never
> circular references in the data with a particular schema, seeing that
> big fat warning every time is going to become a bit tiresome. Perhaps
> "NOTE: ..." ?

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?)

> How about printing that notice at the top of the dump file as well?

Hmm ... that might be feasible in plain text output, but I don't see
any easy way to get a similar effect in archive modes.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

No comments: