postgres-writing-guidelines
Installation
SKILL.md
Postgres Writing Guidelines
When to Use
- Starting a new PostgreSQL application database from scratch
- Adding tables, views, functions, procedures, or triggers to an existing schema following this methodology
- Reviewing PL/pgSQL for type safety, RLS coverage, and structural enforcement
- Writing migrations that must be idempotent and safe to rerun
- Designing table hierarchies (base/subtype, parent-child composite keys)
- Implementing background job queues backed by Postgres tables (
FOR UPDATE SKIP LOCKED)
When NOT to use: one-off ad-hoc queries, read-only reporting databases, or any non-Postgres engine. Examples and syntax throughout are PostgreSQL/PL-pgSQL.
snake_case Everywhere
Postgres folds unquoted identifiers to lowercase. Using PascalCase forces double-quoting ("PascalCase") on every reference, forever. Use snake_case for everything: tables, columns, views, functions, procedures, types, constraints, parameters.