plpgsql function problems

From: Thomas Mack <mack(at)ips(dot)cs(dot)tu-bs(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: plpgsql function problems
Date: 1999-07-03 10:10:36
Message-ID: 199907031010.MAA14486@infbsdb1.idb.cs.tu-bs.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 1999-07-03 16:22:10 Re: [SQL] problem creating table
Previous Message Thomas Mack 1999-07-03 08:36:20 Ascii null in varchars