NULL function arguments? - Mailing list pgsql-sql

From Mark Volpe
Subject NULL function arguments?
Date
Msg-id 39A1664F.4AFCEF42@epamail.epa.gov
Whole thread Raw
List pgsql-sql
It seems that why I provide a NULL argument to a PL/pgSQL function
it makes the rest of the arguments NULL, too!

Consider this function:

CREATE FUNCTION callme(text, text) RETURNS boolean AS
'BEGIN    RAISE NOTICE ''$1: %'', $1;    RAISE NOTICE ''$2: %'', $2;    RETURN TRUE;END;
' LANGUAGE 'plpgsql';

So that when I try SELECT callme('hello', 'world');
I get back:

NOTICE:  $1: hello
NOTICE:  $2: world

But when I do SELECT callme('hello', NULL);
I get back:

NOTICE:  $1: <NULL>
NOTICE:  $2: <NULL>

I'm using Postgres 7.0. Possible bug?

Mark


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Re: Beginner problems with functions
Next
From: "Franz J Fortuny"
Date:
Subject: Upper case or lower case....