Re: pg_restore COPY error handling - Mailing list pgsql-patches

From Tom Lane
Subject Re: pg_restore COPY error handling
Date
Msg-id 6274.1138835021@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_restore COPY error handling  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: pg_restore COPY error handling  (Stephen Frost <sfrost@snowman.net>)
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Andrew Dunstan wrote:
>> I assume you are referring to this post:
>> http://archives.postgresql.org/pgsql-bugs/2006-01/msg00188.php

> OK, that helps.  The solution is to "not do that", meaning install
> postgis before the restore or something.  Anyway, adding the patch seems
> like too large a risk for a minor release, especially since you are the
> first person to complain about it that I remember.

I don't think you should see this as something specific to PostGIS.
If I interpret Stephen's report properly, any sort of failure during
COPY IN would lead to undesirable behavior in pg_restore.

This is not super surprising because the original design approach for
pg_restore was "bomb out on any sort of difficulty whatsoever".  That
was justly complained about, and now it will try to keep going after
SQL-command errors ... but it sounds like the COPY-data processing
part didn't get fixed properly.

I take no position on whether Stephen's patch is any good --- I haven't
looked at it --- but if he's correct about the problem then I agree it's
a bug fix.  Before deciding whether it deserves to be back-patched, we
at least ought to look closely enough to characterize the situations in
which pg_restore will fail.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_restore COPY error handling
Next
From: Stephen Frost
Date:
Subject: Re: pg_restore COPY error handling