X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id BFCC1D1B52B; Mon, 8 Sep 2003 14:20:15 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 47910-09; Mon, 8 Sep 2003 11:19:47 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 8E116D1B4F9; Mon, 8 Sep 2003 11:19:43 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h88EJhAn010946; Mon, 8 Sep 2003 10:19:44 -0400 (EDT) To: newsy@lewczuk.com Cc: "Lista dyskusyjna pgsql-general" , "Lista dyskusyjna pgsql-sql" , "Lista dyskusyjna pgsql-bugs" Subject: Re: [SQL] plPGSQL bug in function creation In-reply-to: <004901c375e3$bd31f660$4701a8c0@marek> References: <004901c375e3$bd31f660$4701a8c0@marek> Comments: In-reply-to "Marek Lewczuk" message dated "Mon, 08 Sep 2003 09:32:28 +0100" Date: Mon, 08 Sep 2003 10:19:43 -0400 Message-ID: <10945.1063030783@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/78 X-Sequence-Number: 6709 "Marek Lewczuk" writes: > 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