pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Volpe <volpe.mark@epamail.epa.gov>
To: pgsql-sql@postgresql.org
Subject: NULL function arguments?
Date: Mon, 21 Aug 2000 13:26:39 -0400
Message-ID: <39A1664F.4AFCEF42@epamail.epa.gov> (raw)

It seems that why I provide a NULL argument to a PL/pgSQL function
it makes the rest of the arguments NULL, too!

Consider this function:

CREATE FUNCTION callme(text, text) RETURNS boolean AS
'
	BEGIN
		RAISE NOTICE ''$1: %'', $1;
		RAISE NOTICE ''$2: %'', $2;
		RETURN TRUE;
	END;
' LANGUAGE 'plpgsql';

So that when I try SELECT callme('hello', 'world');
I get back:

NOTICE:  $1: hello
NOTICE:  $2: world

But when I do SELECT callme('hello', NULL);
I get back:

NOTICE:  $1: <NULL>
NOTICE:  $2: <NULL>

I'm using Postgres 7.0. Possible bug?

Mark



Message-ID: <39A1664F.4AFCEF42@epamail.epa.gov>
Permalink:  ../39A1664F.4AFCEF42@epamail.epa.gov/
Also on:    postgresql.org/message-id/39A1664F.4AFCEF42@epamail.epa.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: volpe.mark@epamail.epa.gov
  Subject: Re: NULL function arguments?
  In-Reply-To: <39A1664F.4AFCEF42@epamail.epa.gov>
  References: <39A1664F.4AFCEF42@epamail.epa.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox