pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: newsy@lewczuk.com
Cc: Lista dyskusyjna pgsql-general <pgsql-general@postgresql.org>
Cc: Lista dyskusyjna pgsql-sql <pgsql-sql@postgresql.org>
Cc: Lista dyskusyjna pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: [SQL] plPGSQL bug in function creation
Date: Mon, 08 Sep 2003 10:19:43 -0400
Message-ID: <10945.1063030783@sss.pgh.pa.us> (raw)
In-Reply-To: <004901c375e3$bd31f660$4701a8c0@marek>
References: <004901c375e3$bd31f660$4701a8c0@marek>

"Marek Lewczuk" <newsy@lewczuk.com> 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



view thread (5+ messages)

Message-ID: <10945.1063030783@sss.pgh.pa.us>
Permalink:  ../10945.1063030783@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10945.1063030783@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, newsy@lewczuk.com, pgsql-general@postgresql.org, pgsql-bugs@postgresql.org
  Subject: Re: [SQL] plPGSQL bug in function creation
  In-Reply-To: <10945.1063030783@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox