Re: [HACKERS] Interesting COPY edge case...

2005-07-28 Thread Tom Lane
Chris Browne [EMAIL PROTECTED] writes: create or replace function build_table (integer) returns integer as ' begin execute ''copy foo to stdout;''; return 1; end' language plpgsql; The result: /* [EMAIL PROTECTED]/dba2 in=*/ select try_copy(1); ERROR: unexpected error -2 in EXECUTE

Re: [HACKERS] Interesting COPY edge case...

2005-07-27 Thread Bruno Wolff III
On Tue, Jul 26, 2005 at 17:56:42 -0400, Chris Browne [EMAIL PROTECTED] wrote: There is evidently Something Strange about the state of stdout when it is referenced inside a stored procedure. I suspect this is related to trusted PLs not being able to write files. It does seem like a problem

[HACKERS] Interesting COPY edge case...

2005-07-26 Thread Chris Browne
Just ran into a fascinating edge case. One of our folks was building a stored function, and ran into an odd error when trying to COPY to stdout. Here's a characteristic example: create or replace function build_table (integer) returns integer as ' begin execute ''copy foo to stdout;'';