Re: [HACKERS] PL/pgSQL a great procedural language for PostgreSQL

From: jwieck(at)debis(dot)com (Jan Wieck)
To: djackson(at)cpsgroup(dot)com (Jackson, DeJuan)
Cc: jose(at)sferacarta(dot)com, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] PL/pgSQL a great procedural language for PostgreSQL
Date: 1998-11-05 11:37:44
Message-ID: m0zbNjU-000EBYC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> It appears that when a function is called if any of the paramaters are
> NULL all of the parameters are NULL.
> try:
> drop function nvl(int, int);
> create function nvl(int, int) returns boolean as '
> declare
> nonullo alias as $1;
> nullo alias as $2;
> begin
> return (nonullo IS NULL) AND (nullo IS NULL);
> end;' language 'plpgsql';
> select nvl(i,0) from a;
> you should get:
> nvl
> ---
> t
> t
> f
> t
> (4 rows)

Don't blame PL/pgSQL for that. There is only one bool isNull
pointer given to PL handlers. How should the PL handler know,
which of the arguments are null then? As I said on another
thread, the function call interface needs to get redesigned.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck(at)debis(dot)com (Jan Wieck) #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sferacarta Software 1998-11-05 14:23:12 Re[2]: [HACKERS] Re: bug on aggregate function AVG()
Previous Message D'Arcy J.M. Cain 1998-11-05 11:24:08 Re: [HACKERS] Open the flood gates...v6.4 is tag'd...