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;

Construction

SELECT ARRAY[1,2,3,4] AS numbers;
SELECT ARRAY['apple','banana','cherry'] AS fruits;

Functions

Performance Notes

Array Functions and Operators