is array bug? (array[][])[] = NULL

From: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
To: pgsql-bugs(at)postgresql(dot)org
Subject: is array bug? (array[][])[] = NULL
Date: 2004-06-04 12:50:42
Message-ID: Pine.LNX.4.44.0406041443080.28450-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello

I am not sure so decrease of array dimensions is regular operations.
But following code dont make syntax error.

create or replace function xxx() returns bool as $$
declare v1 varchar[]; v2 varchar[][];
begin
v2 := array[array[1,2], array[3,4]];
raise notice 'v2 %', v2;
v1 := v2[1];
raise notice 'v1 %', v1;
return 't';
end; $$ language plpgsql;

I expect v1 = [1,2], but v1 is null.
What is wrong?

Regards
Pavel Stehule

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Donald Fraser 2004-06-04 14:05:26 Cached PL/PGSQL query plan failure
Previous Message Tarhon-Onu Victor 2004-06-04 05:30:03 Re: Select (str)::FLOAT8 BUG