Posted 12/21/2024

ARRAY

Declaration

column_name datatype []

Use in Query

select * from table t where t.id = ANY (ARRAY[1,2,3])

Indexing

SELECT
  name,
  phones [ 1 ]
FROM
  contacts;

IN for compare

SELECT * FROM table t WHERE t.id IN (1, 2, 3);

Array Functions and Operators