dbTalk Databases Forums  

Re: [BUGS] [SQL] plPGSQL bug in function creation

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


Discuss Re: [BUGS] [SQL] plPGSQL bug in function creation in the mailing.database.pgsql-bugs forum.



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

Default Re: [BUGS] [SQL] plPGSQL bug in function creation - 09-08-2003 , 09:23 AM






"Marek Lewczuk" <newsy (AT) lewczuk (DOT) com> writes:
Quote:
CREATE FUNCTION "public"."test" (text, text) RETURNS text AS'
BEGIN
IF $1 THEN
RETURN $1;
ELSE
RETURN $2;
END IF;
END;
'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
If there's a bug here at all, it's that this function doesn't report a
type violation. What in the world do you think the semantics of that
IF-test are? text is not boolean.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


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.