Database Stack Skill
Default guidance
Use the PostgreSQL rule file in this folder as the authoritative reference.
Workflow (use this order)
- Confirm schema context and target tables/columns.
- Draft query with explicit columns and clear aliases.
- Prefer CTEs for readability and reuse.
- Avoid
NOT IN; useNOT EXISTSorLEFT JOIN ... IS NULL. - Run
explain analyzeand address sequential scans. - Add or adjust indexes if query plan needs them.
Review Checklist
- Naming uses
snake_case; SQL keywords are lowercase. - Explicit joins used; no implicit joins.
select *avoided; columns are explicit.NOT INavoided withNULL-safe alternatives.- Query plan checked with
explain analyze.
Local Resources
postgresql.mdcfor naming, formatting, query patterns, and performance guidance.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.