plpgsql function problems - Mailing list pgsql-sql

From Thomas Mack
Subject plpgsql function problems
Date
Msg-id 199907031010.MAA14486@infbsdb1.idb.cs.tu-bs.de
Whole thread Raw
List pgsql-sql
I would like to declare some non null variables
in plpgsql functions. When I do so, I always get
an error stating "null assignment to non null
variable" (in this sense). There is not even
an assignment obvious obvious to me:


ib=> CREATE FUNCTION something() RETURNS int4 AS 'DECLARE
ib'> i int4 not null DEFAULT 27;
ib'> BEGIN
ib'> return 0;
ib'> END;
ib'> ' LANGUAGE 'plpgsql';
CREATE
ib=> select something();
ERROR:  NULL assignment to variable 'i' declared NOT NULL
ib=> 


I really can't see the problem. Anybody of you?
(postgres 6.4.2)


(Maybe I should engage myself in the documentation project
if time allows, as according to 'obvious' documentation, this
seems to be fine...)


Thomas Mack
TU Braunschweig, Abt. Informationssysteme


pgsql-sql by date:

Previous
From: blackgr
Date:
Subject: problem creating table
Next
From: Tom Lane
Date:
Subject: Re: [SQL] problem creating table