Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Date
Msg-id 51705.76.125.11.227.1259248143.squirrel@dunslane.net
Whole thread Raw
In response to Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On Thu, November 26, 2009 2:22 am, Jeff Davis wrote:
> On Thu, 2009-11-26 at 00:35 -0500, Andrew Dunstan wrote:
>> On Wed, November 25, 2009 3:56 pm, Jeff Davis wrote:
>> >
>> > I worry that we're getting further away from the original problem.
>> Let's
>> > allow functions to get the bytes of data from a COPY, like the
>> original
>> > proposal. I am not sure COPY is the best mechanism to move records
>> > around when INSERT ... SELECT already does that.
>> >
>>
>>
>> I am not at all sure I think that's a good idea, though. We have
>> pg_read_file() for getting raw bytes from files. Building that into COPY
>> does not strike me as a good fit.
>
> I think we're in agreement. All I mean is that the second argument to
> COPY should produce/consume bytes and not records. I'm not discussing
> the internal implementation at all, only semantics.
>
> In other words, STDIN is not a source of records, it's a source of
> bytes; and likewise for STDOUT.
>

Hmm. I can just imagine wanting to do that as a way of running COPY over
dblink. Are there other use cases?

cheers

andrew




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Application name patch - v3
Next
From: "Andrew Dunstan"
Date:
Subject: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION