PL/pgSQL - args passing - Mailing list pgsql-general

From E.Rodichev
Subject PL/pgSQL - args passing
Date
Msg-id 199909260358.HAA27643@ra.sai.msu.su
Whole thread Raw
List pgsql-general
Is it possible to pass the NULL value to PL/pgSQL function? More precisely,
I have a function like

CREATE FUNCTION test (text,int4) RETURNS int4 AS '
   Begin
      ...
   End;
' LANGUAGE 'plpgsql';

and typical call is

select test('Word',1);

which works fine. But sometimes I need to call this function with
arguments like

select test(NULL,1);    or
select test('Word',NULL);

Now such calls lead to
ERROR:  typeidTypeRelid: Invalid type - oid = 0

Any ideas?
_________________________________________________________________________
Evgeny Rodichev                          Sternberg Astronomical Institute
System/Net Admin                                  Moscow State University
email: er@sai.msu.su
Phone: 007 (095) 939 2383
Fax:   007 (095) 932 8841                       http://www.sai.msu.su/~er

pgsql-general by date:

Previous
From: Martin Weinberg
Date:
Subject: Memory exhausted in AllocSetAlloc()
Next
From: "Andrew Higgs"
Date:
Subject: Cannot connect.