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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Proposed patch: make pg_dump --data-only consider FK constraints
Date: 2008-09-07 19:10:53
Message-ID: 20819.1220814653@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-09-07 19:17:23 Re: Proposed patch: make pg_dump --data-only consider FK constraints
Previous Message Tom Lane 2008-09-07 19:06:26 Re: Proposed patch: make pg_dump --data-only consider FK constraints