postgres-syntax-arrays-ranges

Installation
SKILL.md

postgres-syntax-arrays-ranges

Quick Reference :

PostgreSQL has two native multi-value types that replace ad-hoc string hacks. Arrays store an ordered list inside one column (int[], text[]). Range types store an interval ([lower, upper)) as a single value with built-in overlap and containment logic.

Two rules drive every decision here :

  1. ALWAYS use a native array instead of a comma-separated string in a text column. CSV-in-text cannot be indexed, validated, or searched element-wise.
  2. ALWAYS build a GiST index (or an EXCLUDE USING gist constraint) before running range-overlap (&&) queries at scale. Without it the planner does a sequential scan on every row.
Installs
1
GitHub Stars
1
First Seen
Jun 17, 2026
postgres-syntax-arrays-ranges — impertio-studio/postgresql-claude-skill-package