Re: Interesting COPY edge case...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Interesting COPY edge case...
Дата
Msg-id 28266.1122583287@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Interesting COPY edge case...  (Chris Browne <cbbrowne@acm.org>)
Список pgsql-hackers
Chris Browne <cbbrowne@acm.org> writes:
> create or replace function build_table (integer) returns integer as '
> begin
>   execute ''copy foo to stdout;'';
>   return 1;
> end' language plpgsql;

> The result:

> /* cbbrowne@[local]/dba2 in=*/ select try_copy(1);
> ERROR:  unexpected error -2 in EXECUTE of query "copy dups to stdout;"
> CONTEXT:  PL/pgSQL function "try_copy" line 2 at execute statement

In CVS tip I get

ERROR:  cannot COPY to/from client in PL/pgSQL
CONTEXT:  PL/pgSQL function "build_table" line 2 at execute statement

There are some protocol-level reasons for not supporting this, IIRC.
You're already inside a SELECT and the client library would probably
get terribly confused.
        regards, tom lane


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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: [Testperf-general] dbt2 & opteron performance
Следующее
От: "Denis Lussier"
Дата:
Сообщение: MySQL to PostgreSQL for SugarCRM