Assigning null to an array element in plpgsql

Поиск
Список
Период
Сортировка
От Eugene Chow
Тема Assigning null to an array element in plpgsql
Дата
Msg-id 09088120-DC05-467B-AC1E-C4E2AF0579DE@paragonam.com
обсуждение исходный текст
Ответы Re: Assigning null to an array element in plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Hi all,

I believe this is a bug. The following function returns 'foo' instead
of null:
---------------
create or replace function test() returns varchar as '
declare
    s    varchar[] := ''{}'';
begin
    s[1] := ''foo'';
    s[1] := null;

    return s[1];
end;
' language 'plpgsql';
----------------

If s is not initialized to an empty set in the declaration, the
function works as expected. I'm running 7.4.9 on FreeBSD 5.4.

Gene

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

Предыдущее
От: tomas@tuxteam.de (Tomas Zerolo)
Дата:
Сообщение: Re: Double sequence increase on single insert with RULE on targeted table
Следующее
От: Sarunas Krisciukaitis
Дата:
Сообщение: Re: Double sequence increase on single insert with RULE on