BUG or feature?

Started by Vashenko Maximabout 25 years ago2 messagesbugs
Jump to latest
#1Vashenko Maxim
max@nino.ru

Hi.
Bug or feature?

CREATE FUNCTION upd (text, text) RETURNS text AS '
BEGIN
RETURN $1;
END
' LANGUAGE 'plpgsql';

SELECT upd('aaa','bbb');
aaa

SELECT upd(null,'bbb');
<null>

All seems ok, but how about next ?

SELECT upd('aaa',null);
<null>

--
О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫, О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫,
О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫
(8312) 30-19-05, 34-00-02, 30-09-73

With best regards, Max Vaschenko,
Nizhny Novgorod Information Networks.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Vashenko Maxim (#1)
Re: BUG or feature?

Max Vaschenko <max@nino.ru> writes:

All seems ok, but how about next ?
SELECT upd('aaa',null);
<null>

This is fixed in 7.1. It's unfixable in prior releases because the
old function manager only maintained one argument-is-null flag for a
function call ... so *all* the arguments are taken as null if any are.

regards, tom lane