Search Postgresql Archives

Dereferencing a 2-dimensional array in plpgsql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am having an issue with trying to dereference a 2-dimensional array in plpgsql. The idea is to have an setup like:

DECLARE
myarray varchar[][];
myvar	char;
BEGIN
--stuff
myarray[1] := ''{value1,value2,value3}'';
myarray[2] := ''{valuea,valueb,valuec}'';

--If I then:

myvar := array[1][1];

--I get a subscript error generated. I have tried everycombination of array[1:1][1], etc all to no avail.

I have also tried pre-initializing myarray with
myarray := ''{{}}'';

The docs seem to to indicate that a simple myarray[1][2] for example should work, but that does not hold true in the plpgsql. Is there another type of initialization that is needed to be done? Any advice?

Sven

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
     subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
     message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux