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

From Christopher Kings-Lynne
Subject Re: Practical error logging for very large COPY
Date
Msg-id 4383EDB6.8050405@familyhealth.com.au
Whole thread Raw
In response to Re: Practical error logging for very large COPY  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
> Actually, there are really only a few errors people want to trap I
> imagine:
> 
> - CHECK constraints (all handled in ExecConstraints)
> - Duplicate keys
> - Foreign key violations (all handled by triggers)
> 
> Rather than worry about all the events we can't safely trap, how about
> we simply deal with the handful that are trappable. For example, we let
> people create an ON ERROR trigger and use the existing trigger
> interface. We have three possibilities:

Trap as many as we can and in the 'rejects' table have an 'sqlstate' 
field that has the SQLSTATE code generated by the failure.  That way you 
can trivially look for all the ones that failed for whatever reason you 
like.

Chris



pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: Practical error logging for very large COPY statements
Next
From: Bruce Momjian
Date:
Subject: Re: A few pgindent oddities