Re: Practical error logging for very large COPY

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Practical error logging for very large COPY
Date: 2005-11-22 16:14:33
Message-ID: 20051122161424.GF12548@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 22, 2005 at 10:45:50AM -0500, Tom Lane wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)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(at)svana(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Grzegorz Jaskiewicz 2005-11-22 16:14:35 Re: order by, for custom types
Previous Message Oleg Bartunov 2005-11-22 15:51:22 Re: order by, for custom types