Multidimensional Arrays
От | James G Wilkinson |
---|---|
Тема | Multidimensional Arrays |
Дата | |
Msg-id | 4457D11D.8060105@alpinegeophysics.com обсуждение исходный текст |
Список | pgsql-novice |
I am trying to implement the following simple function: create or replace function test() returns void as ' declare x float[][]; tmp float; begin x[100][100] := -9999.9999; x[3][1] := 20.0; x[4][20] := 40.0; tmp := x[3][1]; raise notice ''tmp = %'', tmp; tmp := x[4][20]; raise notice ''tmp = %'', tmp; return; end; ' language 'plpgsql'; When I execute the function: db_test=# select test(); It bombs with the following message: ERROR: invalid array subscripts CONTEXT: PL/pgSQL function "test" line 10 at assignment line 10, near as I can tell, is the assignment "x[3][1] := 20.0;" I am running PostgreSQL 8.1.3 I have done some digging in the archives and found that I can supposedly initialize the array x as "x := '{}'" but this did not solve the problem. Of note, when I enter the function, I have no idea what the array dimensions are. However, I have even tried declaring x as x[100][100] with the same error result. Can anyone provide some advice? Regards, Jim
В списке pgsql-novice по дате отправления: