Re: [HACKERS] PL/pgSQL a great procedural language for PostgreSQL

Поиск
Список
Период
Сортировка
От jwieck@debis.com (Jan Wieck)
Тема Re: [HACKERS] PL/pgSQL a great procedural language for PostgreSQL
Дата
Msg-id m0zbNjU-000EBYC@orion.SAPserv.Hamburg.dsh.de
обсуждение исходный текст
Ответ на RE: [HACKERS] PL/pgSQL a great procedural language for PostgreSQL  ("Jackson, DeJuan" <djackson@cpsgroup.com>)
Список pgsql-hackers
>
> It appears that when a function is called if any of the paramaters are
> NULL all of the parameters are NULL.
> try:
>  drop function nvl(int, int);
>  create function nvl(int, int) returns boolean as '
>   declare
>     nonullo alias as $1;
>     nullo alias as $2;
>   begin
>    return (nonullo IS NULL) AND (nullo IS NULL);
>   end;' language 'plpgsql';
>  select nvl(i,0) from a;
> you should get:
> nvl
> ---
> t
> t
> f
> t
> (4 rows)

    Don't blame PL/pgSQL for that.  There is only one bool isNull
    pointer given to PL handlers. How should the PL handler know,
    which  of  the arguments are null then?  As I said on another
    thread, the function call interface needs to get  redesigned.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Re: [HACKERS] Open the flood gates...v6.4 is tag'd...
Следующее
От: darcy@druid.net (D'Arcy J.M. Cain)
Дата:
Сообщение: Re: [HACKERS] Open the flood gates...v6.4 is tag'd...