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

2008-10-14 Thread Philip Warner
Tom Lane wrote: 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. Just saw this, obviously very late, but from memory there is a TOC entry

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

2008-09-07 Thread Tom Lane
Okay, I got tired of seeing people complain about foreign-key constraint violations in data-only dumps. While it's true that the problem can't be solved in the general case (because of potentially circular references), we could certainly make pg_dump at least *try* to order the tables according

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

2008-09-07 Thread Heikki Linnakangas
Tom Lane wrote: Okay, I got tired of seeing people complain about foreign-key constraint violations in data-only dumps. While it's true that the problem can't be solved in the general case (because of potentially circular references), we could certainly make pg_dump at least *try* to order the

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

2008-09-07 Thread David Fetter
On Sun, Sep 07, 2008 at 02:06:40PM -0400, Tom Lane wrote: Okay, I got tired of seeing people complain about foreign-key constraint violations in data-only dumps. Isn't this something solved in the more general case by having pre-data, data, and post-data dump options? Cheers, David. -- David

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

2008-09-07 Thread Alvaro Herrera
Heikki Linnakangas wrote: 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

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

2008-09-07 Thread Tom Lane
David Fetter [EMAIL PROTECTED] writes: On Sun, Sep 07, 2008 at 02:06:40PM -0400, Tom Lane wrote: Okay, I got tired of seeing people complain about foreign-key constraint violations in data-only dumps. Isn't this something solved in the more general case by having pre-data, data, and

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

2008-09-07 Thread Tom Lane
Heikki Linnakangas [EMAIL PROTECTED] 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.

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

2008-09-07 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Heikki Linnakangas wrote: How about printing that notice at the top of the dump file as well? I assume that this trick will only work at restore time only for custom or tar dumps. A text-only dump would produce the warning to stderr at dump time, no?

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

2008-09-07 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] 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

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

2008-09-07 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: 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

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

2008-09-07 Thread Stephen Frost
* Gregory Stark ([EMAIL PROTECTED]) wrote: 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