Re: Bug in how nulls are handled by plpgsql?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jonathan Ellis <jellis(at)advocast(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Bug in how nulls are handled by plpgsql?
Date: 2000-11-07 16:54:11
Message-ID: Pine.BSF.4.21.0011070846580.32142-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Under 7.0.x and earlier there's only one flag to hold
the isnull state of all parameters. If any are null all are
null and I think there's a related output issue. Under current
sources this is done the way you'd expect.

As for the second question, not really that I can think of, but that
behavior is correct per SQL.

Stephan Szabo
sszabo(at)bigpanda(dot)com

On Mon, 6 Nov 2000, Jonathan Ellis wrote:

> bf2=# create function foo (varchar, varchar) returns varchar as '
> begin
> return $1;
> end;
> ' language 'plpgsql';
>
> bf2'# bf2'# bf2'# bf2'# CREATE
> bf2=# bf2=# select foo('asdf', null) from dual;
> foo
> -----
>
> (1 row)
>
> Even though the function foo never references the null, apparently postgres
> thinks, "oh, a function call with a null in it. Must be null." and doesn't
> even bother executing the function. Bug?
>
> On another null-related note, is there any way to make
> select 'asdf' || null from dual
>
> return 'asdf' without changing it to
> select 'asdf' || coalesce(null, '') from dual
>
> ?
>
> -Jonathan
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2000-11-07 17:04:37 Re: libpq.so.2.0 problem
Previous Message Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= 2000-11-07 16:50:48 Re: libpq.so.2.0 problem