Postgres - CRUD operations with arrays of composite types
问题 One really neat feature of Postgres that I have only just discovered is the ability to define composite type - also referred to in their docs as ROWS and as RECORDS . Consider the following example CREATE TYPE dow_id AS ( tslot smallint, day smallint ); Now consider the following tables CREATE SEQUENCE test_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 START 1 CACHE 1; CREATE TABLE test_simple_array ( id integer DEFAULT nextval('test_id_seq') NOT NULL, dx integer [] ); CREATE TABLE test