Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs

   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[][];
  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?

Pavel Stehule


pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group