Postgres Syntax Arrays Ranges

Use when storing list-valued columns, modelling time/number intervals, or preventing overlapping bookings with exclusion constraints. Prevents seqscan on range-overlap queries from missing GiST index, CSV-in-text instead of native array, and off-by-one errors from inclusive vs exclusive range bounds. Covers array literals + operators (= ANY, @>, &&, ||), unnest WITH ORDINALITY, array_agg, range types (int4range, tstzrange, daterange), range operators (@>, &&, -|-), multirange (v14+), GiST exclusion constraints for non-overlap. Keywords: array, ARRAY, ANY, unnest, array_agg, range type, int4range, tstzrange, daterange, multirange, range overlap, exclusion constraint, GiST, EXCLUDE USING gist, overlapping bookings, how to store a list, prevent double booking, range query is slow

Impertio-Studio fb70088 4 files · 35.3 KB Updated

File contents

impertio-studio/postgresql-claude-skill-package/tree/main/skills/source/postgres-syntax/postgres-syntax-arrays-ranges commit fb70088d4c

Frequently asked questions

npx skillmds@latest add impertio-studio/postgres-syntax-arrays-ranges