Re: Broken handling of NULLs in TG_ARGV

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Broken handling of NULLs in TG_ARGV
Дата
Msg-id 36959.1430437479@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Broken handling of NULLs in TG_ARGV  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Ответы Re: Broken handling of NULLs in TG_ARGV  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список 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 по дате отправления:

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Broken handling of NULLs in TG_ARGV
Следующее
От: Robert Haas
Дата:
Сообщение: Re: initdb -S and tablespaces