Re: Broken handling of NULLs in TG_ARGV - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Broken handling of NULLs in TG_ARGV
Date
Msg-id 36959.1430437479@sss.pgh.pa.us
Whole thread Raw
In response to Broken handling of NULLs in TG_ARGV  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: Broken handling of NULLs in TG_ARGV  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers
Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
> plpgsql's handling of NULLs in TG_ARGV turns actual nulls into text 
> 'null'. Hopefully we can all agree that's broken.

You apparently have not read the CREATE TRIGGER reference page very
carefully:
arguments
    An optional comma-separated list of arguments to be    provided to the function when the trigger is executed. The
arguments are literal string constants. Simple names and    numeric constants can be written here, too, but they will
all be converted to strings.
 

There isn't any such thing as a genuine SQL NULL argument; the examples
you provided are just text strings, not SQL NULLs.  In order to make them
be actual nulls, we would have to redefine the arguments as being
expressions of some sort, which is problematic for backwards-compatibility
reasons.  It also seems like rather a lot of new mechanism to add for
something with (evidently) near-zero user demand.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Broken handling of NULLs in TG_ARGV
Next
From: Robert Haas
Date:
Subject: Re: initdb -S and tablespaces