dbTalk Databases Forums  

[BUGS] BUG #2539: PL/PgSQL doesn't disallow COPY commands on compile, even though it disallows them.

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2539: PL/PgSQL doesn't disallow COPY commands on compile, even though it disallows them. in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default [BUGS] BUG #2539: PL/PgSQL doesn't disallow COPY commands on compile, even though it disallows them. - 07-19-2006 , 05:48 PM







The following bug has been logged online:

Bug reference: 2539
Logged by: David Fetter
Email address: david (AT) fetter (DOT) org
PostgreSQL version: All
Operating system: Linux and OSX that I've tested
Description: PL/PgSQL doesn't disallow COPY commands on compile, even
though it disallows them.
Details:

Here's a repro:

davidfetter=> SHOW check_function_bodies ;
check_function_bodies
-----------------------
on
(1 row)

davidfetter=> CREATE OR REPLACE FUNCTION bad_func()
RETURNS VOID
LANGUAGE plpgsql
AS $$
BEGIN
CREATE TEMPORARY TABLE bad(i INTEGER) ON COMMIT DROP;
INSERT INTO bad
SELECT s.i FROM generate_series(1,10) AS s(i);
COPY bad TO stdout;
END;
$$;
CREATE FUNCTION
davidfetter=> select bad_func();
ERROR: SPI_execute_plan failed executing query "COPY bad TO stdout":
SPI_ERROR_COPY
CONTEXT: PL/pgSQL function "bad_func" line 5 at SQL statement

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] BUG #2539: PL/PgSQL doesn't disallow COPY commands on compile, even though it disallows them. - 07-19-2006 , 06:04 PM






"David Fetter" <david (AT) fetter (DOT) org> writes:
Quote:
Description: PL/PgSQL doesn't disallow COPY commands on compile, even
though it disallows them.
There are many many things that won't be checked until execution.
I can't get excited about this one.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] BUG #2539: PL/PgSQL doesn't disallow COPY commands on compile, even though it disallows them. - 07-19-2006 , 06:25 PM



On Wed, Jul 19, 2006 at 07:02:15PM -0400, Tom Lane wrote:
Quote:
"David Fetter" <david (AT) fetter (DOT) org> writes:
Description: PL/PgSQL doesn't disallow COPY commands on
compile, even though it disallows them.

There are many many things that won't be checked until execution. I
can't get excited about this one.
I just wanted to get it in the queue, wherever it should be.

Cheers,
D
--
David Fetter <david (AT) fetter (DOT) org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.