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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proposed patch: make pg_dump --data-only consider FK constraints
Дата
Msg-id 20819.1220814653@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Proposed patch: make pg_dump --data-only consider FK constraints  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Proposed patch: make pg_dump --data-only consider FK constraints
Re: Proposed patch: make pg_dump --data-only consider FK constraints
Список pgsql-hackers
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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Proposed patch: make pg_dump --data-only consider FK constraints
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Proposed patch: make pg_dump --data-only consider FK constraints