Re: Practical error logging for very large COPY - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Practical error logging for very large COPY
Date
Msg-id 20051122161424.GF12548@svana.org
Whole thread Raw
In response to Re: Practical error logging for very large COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Nov 22, 2005 at 10:45:50AM -0500, Tom Lane wrote:
> Martijn van Oosterhout <kleptog@svana.org> writes:
> > Actually, there are really only a few errors people want to trap I
> > imagine:
>
> You've forgotten bad data, eg "foo" in an integer field, or an
> untranslatable multibyte character.  The bad-data problem is what lets
> out trigger-based solutions, or indeed anything that presumes that the
> bad data can be forced into a particular representation.

So don't pass the row in that case. The trigger still has the
oppotunity to return a null tuple to have the error ignored. I don't
think it diminishes the benefits of the idea, being that a general
trigger mechanism is way better than adding special exception blocks to
INPERT and/or COPY to handle special cases.

I've looked around some other RDBMSs and they don't tell you in the
exception handler the row that caused the error, so we're hardly behind
the pack here.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: TODO item "%Allow pg_hba.conf be controlled via SQL"
Next
From: Grzegorz Jaskiewicz
Date:
Subject: Re: order by, for custom types