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

Поиск
Список
Период
Сортировка
От Daniel Farina
Тема Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Дата
Msg-id 429f3b220911231603pe3c3635v18f729bca5122792@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Список pgsql-hackers
On Mon, Nov 23, 2009 at 3:46 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
> I recently found myself trying to push data through dblink() and ended up
> writing code to make a call to the target to call a function which called
> back to the source to select the data and insert it. The speedup was
> massive, so I'll be interested to dig into the details here.

The way the indirection is accomplished here should be very cheap.
Overhead should be comparable to the fwrite() call that is used for
copying to a file...this is why I mentioned that it would be
interesting to make this good enough to be the underlying mechanism of
TO STDOUT/TO 'file' to reduce the overall number of mechanisms used to
perform COPY TO.

> I'm also interested in COPY returning rows as text[], which was discussed
> recently. Does this help move us towards that?

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.

fdr


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Следующее
От: Daniel Farina
Дата:
Сообщение: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION