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

From Tom Lane
Subject Re: Practical error logging for very large COPY statements
Date
Msg-id 6022.1132617922@sss.pgh.pa.us
Whole thread Raw
In response to Practical error logging for very large COPY statements  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Practical error logging for very large COPY statements  (Andrew Dunstan <andrew@dunslane.net>)
Re: Practical error logging for very large COPY  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Simon Riggs <simon@2ndquadrant.com> writes:
> What I'd like to do is add an ERRORTABLE clause to COPY. The main
> problem is how we detect a duplicate row violation, yet prevent it from
> aborting the transaction.

If this only solves the problem of duplicate keys, and not any other
kind of COPY error, it's not going to be much of an advance.

> Flow of control would be to:

>     locate page of index where value should go
>     lock index block
>     _bt_check_unique, but don't error
>         if violation then insert row into ERRORTABLE
>     else
>         insert row into data block
>         insert row into unique index
>         unlock index block
>         do other indexes

Ugh.  Do you realize how many levels of modularity violation are implied
by that sketch?  Have you even thought about the fact that we have more
than one kind of index?
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Using FSM to trigger vacuum
Next
From: Gregory Maxwell
Date:
Subject: Re: Improving count(*)