Mega Code Archive

 
Categories / PostgreSQL / Array
 

Inserting values into multidimensional arrays

postgres=# postgres=# -- Inserting values into multidimensional arrays postgres=# CREATE TABLE authors (id integer,titles text[][]); CREATE TABLE postgres=# postgres=# INSERT INTO authors postgres-#              VALUES (102, postgres(#              '{{"J T", "T S"}, postgres'#                {"C D", "G E"}, postgres'#                {"A D", "A L"}}'); INSERT 0 1 postgres=# postgres=# select * from authors;  id  |                   titles -----+---------------------------------------------  102 | {{"J T","T S"},{"C D","G E"},{"A D","A L"}} (1 row) postgres=# postgres=# drop table authors; DROP TABLE postgres=#