bug in PLPGSQL - Mailing list pgsql-bugs

From Andriy I Pilipenko
Subject bug in PLPGSQL
Date
Msg-id Pine.BSF.4.21.0103281253040.89943-100000@bamby.marka.net.ua
Whole thread Raw
List pgsql-bugs
Your name        :    Andriy I Pilipenko
Your email address    :    bamby@marka.net.ua


System Configuration
---------------------
  Architecture (example: Intel Pentium)      : Intel Pentium

  Operating System (example: Linux 2.0.26 ELF)     : FreeBSD-4.2-STABLE

  PostgreSQL version (example: PostgreSQL-7.0):   PostgreSQL-7.0.3

  Compiler used (example:  gcc 2.8.0)    : gcc version 2.95.2 19991024 (release)


Please enter a FULL description of your problem:
------------------------------------------------

There is bug in PLPGSQL. If one of the parameters to plpgsql function is
null, other parameters becomes null too.


Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

First create function like this:

    CREATE FUNCTION f(varchar, varchar) RETURNS varchar
      AS '
    begin
    return ''first arg is: '' || $1;
    end;
    ' LANGUAGE 'plpgsql';

Then run query "SELECT f('some text', NULL)" and you will receive null
value.


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: pg v7.1RC1: jdbc1 fails to compile
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: 7.0.3 max function