Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION

From: Daniel Farina <dfarina(at)truviso(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Date: 2009-11-24 00:06:34
Message-ID: 429f3b220911231606o51f03279ye7736d084576bda9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 23, 2009 at 4:03 PM, Daniel Farina <dfarina(at)truviso(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-11-24 00:20:05 Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Previous Message Daniel Farina 2009-11-24 00:03:38 Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION