type
COMPOSITE
PostgreSQL composite types bundle named fields into one value. Table constraints are not automatically enforced on free-standing composite values. Example target: PostgreSQL 17. Run in a disposable database; examples need no existing tables.
Formal Syntax & Structure
sql syntaxsql
CREATE TYPE name AS (field type, ...)Working Example
Example Snippetsql
CREATE TYPE lab_pair AS (x INTEGER,y INTEGER); SELECT (ROW(3,4)::lab_pair).y;