Hello
I am testing long array values. I tryed write simple function in plpgsql
for this. I found maybe a bug. Array in plpgsql without explicit init
(empty array) don't work;
CREATE OR REPLACE FUNCTION foo1() RETURNS FLOAT AS '
DECLARE f FLOAT [];
BEGIN
f[1] := 10.0;
RETURN f[1];
END' LANGUAGE plpgsql;
cyril=> select foo1();
foo1
------
(1 row)
CREATE OR REPLACE FUNCTION foo2() RETURNS FLOAT AS '
DECLARE f FLOAT [] DEFAULT ''{}'';
BEGIN
f[1] := 10.0;
RETURN f[1];
END' LANGUAGE plpgsql;
cyril=> select foo2();
foo2
------
10
(1 row)
regards
Pavel Stehule