Re: COPY enhancements - Mailing list pgsql-hackers

From Tom Lane
Subject Re: COPY enhancements
Date
Msg-id 6960.1255095882@sss.pgh.pa.us
Whole thread Raw
In response to Re: COPY enhancements  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> Another thing that has occurred to me is that RI checks are currently
> resolved at end of statement and could end up rejecting any/all rows
> loaded. If we break down the load into subtransaction pieces we would
> really want the RI checks on the rows to be performed during the
> subtransaction that makes them. The good thing about that is that it
> would lend itself to holding successful checks in a hash table to allow
> a fast path optimization of continual re-checks of same values.

If we did that it would guarantee that cases like self-referential RI
would fail.  (Think parent-child links in a tree, for example.)
I see the point about wishing that such checks would be part of the
per-row error handling, but we can't just unconditionally do things
that way.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: COPY enhancements
Next
From: Tom Lane
Date:
Subject: Re: COPY enhancements