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

From Daniel Farina
Subject Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Date
Msg-id 429f3b220911231606o51f03279ye7736d084576bda9@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION  (Daniel Farina <dfarina@truviso.com>)
List pgsql-hackers
On Mon, Nov 23, 2009 at 4:03 PM, Daniel Farina <dfarina@truviso.com> wrote:
> Yes.  Take a look at the tests introduced to core PostgeSQL (see patch
> 2), where instead of returning a text[] I return just a single text of
> the verbatim output of the copy.  You could imagine making that an SRF
> instead.  It would have to understand COPY row delimiters in whatever
> mode you were operating in, though.

Actually, sorry, I lie, but not in a bad way....  Since COPY operates
row at a time (rather than a stream of bytes with arbitrary
boundaries) you could rely on being passed each record one-at-a-time.
You don't have to understand the delimiter.  So you could even make a
bytea[][] that even contains the binary output, the first dimension
being row number, the second being the bytes themselves.  The header
would pose an interesting problem, though.

fdr


pgsql-hackers by date:

Previous
From: Daniel Farina
Date:
Subject: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Next
From: Tom Lane
Date:
Subject: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION