任意多的维度,但两个就可以了。
=> CREATE SCHEMA ztest;
CREATE SCHEMA
=> CREATE TABLE tt (a int[3][3]);
CREATE TABLE
=> INSERT INTO tt VALUES (ARRAY[ARRAY[1,2,3], ARRAY[4,5,6], ARRAY[7,8,9]]), (ARRAY[ARRAY[11,12,13],ARRAY[14,15,16],ARRAY[17,18,19]]);
INSERT 0 2
=> SELECT * FROM tt;
a
------------------------------------
{{1,2,3},{4,5,6},{7,8,9}}
{{11,12,13},{14,15,16},{17,18,19}}
(2 rows)
=> INSERT INTO tt VALUES ('{{21,22,23},{24,25,26},{27,28,29}}');
INSERT 0 1
=> SELECT * FROM tt;
a
------------------------------------
{{1,2,3},{4,5,6},{7,8,9}}
{{11,12,13},{14,15,16},{17,18,19}}
{{21,22,23},{24,25,26},{27,28,29}}
(3 rows)
=> SELECT a[2][3] FROM tt;
a
----
6
16
26
(3 rows)