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

From: David Fetter <david(at)fetter(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Daniel Farina <drfarina(at)gmail(dot)com>, Hannu Krosing <hannu(at)krosing(dot)net>, Greg Smith <greg(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Daniel Farina <dfarina(at)truviso(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-27 02:13:46
Message-ID: 20091127021346.GA2303@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 26, 2009 at 10:11:12AM -0500, Andrew Dunstan wrote:
> 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?

It'd be nice to make this available to the next revision of DBI-Link
and it'll be pretty handy for our SQL/MED whenever that happens.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Farina 2009-11-27 02:30:08 Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Previous Message Robert Haas 2009-11-27 00:07:48 Re: File IO - why does PG do things in pages?