Re: Using multi-row technique with COPY - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Using multi-row technique with COPY
Date
Msg-id 20051128112548.GB11375@surnet.cl
Whole thread Raw
In response to Re: Using multi-row technique with COPY  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Using multi-row technique with COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Simon Riggs wrote:
> On Sun, 2005-11-27 at 17:45 -0500, Tom Lane wrote:
> > Simon Riggs <simon@2ndquadrant.com> writes:
> > > COPY FROM can read in sufficient rows until it has a whole block worth
> > > of data, then get a new block and write it all with one pair of
> > > BufferLock calls.
> > 
> > > Comments?
> > 
> > I don't see any way to do this without horrible modularity violations.
> > The COPY code has no business going anywhere near individual buffers;
> > for that matter, it doesn't even really know what "a block worth" of
> > data is, since the tuples it's dealing with aren't toasted yet.
> 
> I've taken on board your comments about modularity issues from earlier.
> [I've not included anything on unique indexes, notice]

I don't see why couldn't have an additional index access method entry
point to insert multiple rows on one call.  For an unique index, we
could return an array of entries that violated the condition (if we were
to implement such a feature for single-entry insertion.)

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Using multi-row technique with COPY
Next
From: Hannu Krosing
Date:
Subject: Re: Using multi-row technique with COPY