Re: pg_dump 'die_on_errors'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump 'die_on_errors'
Date: 2004-08-12 02:23:50
Message-ID: 23127.1092277430@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> At 02:31 AM 12/08/2004, Tom Lane wrote:
>> result of
>> considerable experience that says die_on_errors is NOT the right
>> behavior for pg_restore.

> Can you point me to examples?

Trawl the archives for pg_restore complaints ... but basically the point
is that if you fail to restore object N, that doesn't mean you should
refuse to even try to restore the objects after it. A typical example
is that ALTER OWNER TO fails because the original owner doesn't exist in
the new DB. There is no reason here not to keep plugging. If you
abort, the user will have to erase the DB, add the user (whether he
wants to or not, and whether he has the privileges to or not), and start
over. If you don't abort, the worst case is that he has to do exactly
that anyway; but he may not care, and even if he does care it may be a
lot faster to fix things by hand afterwards.

It probably would be a good idea to try to fix things to make the
restore operation less noisy (eg, ditch all the NOTICEs about creating
indexes) so that people could see the actual errors more easily. That's
not at all the same thing as putting in die-on-error, though.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2004-08-12 02:24:04 Re: pg_restore (libpq? parser?) bug in 8
Previous Message Tom Lane 2004-08-12 02:15:20 Re: pg_restore (libpq? parser?) bug in 8

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-08-12 02:56:22 Re: [HACKERS] SAVEPOINT syntax again
Previous Message efesar (the kay) 2004-08-12 01:39:45 8.0 Beta 1 // Environment Vars // .pgpass