Re: [GENERAL] ERROR: array subscript out of range

2009-04-10 Thread Alvaro Herrera
chinchu2005 escribió: > > Hello all, > Need ur help.I dont know wats wrong with the following fucntion. > create or replace function twoarray() returns setof integer as > ' > declare > i integer; > j integer; > a integer[][]; > begin > for i in 1..10 loop > for j in 1..2 loop > a[i][j]:=i*j; We j

Re: [GENERAL] ERROR: array subscript out of range

2009-04-10 Thread Tom Lane
chinchu2005 writes: > declare > i integer; > j integer; > a integer[][]; > begin > for i in 1..10 loop > for j in 1..2 loop > a[i][j]:=i*j; This isn't going to work --- it implies dynamically resizing the array, and plpgsql isn't smart enough to do that for a multidimensional array. Do you actual

[GENERAL] ERROR: array subscript out of range

2009-04-10 Thread chinchu2005
Hello all, Need ur help.I dont know wats wrong with the following fucntion. create or replace function twoarray() returns setof integer as ' declare i integer; j integer; a integer[][]; begin for i in 1..10 loop for j in 1..2 loop a[i][j]:=i*j; return next a[i][j]; end loop; end loop; return; end;