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
Eugene Chow <gene@paragonam.com> writes:
> I believe this is a bug. The following function returns 'foo' instead
> of null:
NULLs in arrays aren't supported; the system interprets an attempt to
store a NULL into an array element as a no-op. Perhaps it should have
raised an error instead, but it's been that way for a long time and
we're not likely to change the behavior of existing releases.
(I'm actually right in the middle of adding support for null array
elements, but it won't appear until 8.2.)
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера