From: | Mark Volpe <volpe(dot)mark(at)epamail(dot)epa(dot)gov> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | NULL function arguments? |
Date: | 2000-08-21 17:26:39 |
Message-ID: | 39A1664F.4AFCEF42@epamail.epa.gov |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Franz J Fortuny | 2000-08-21 17:49:40 | Upper case or lower case.... |
Previous Message | Stephan Szabo | 2000-08-21 16:47:12 | Re: Re: Beginner problems with functions |