# Postgres

> Design and operate PostgreSQL schemas, queries, indexes, and migrations with performance and safety in mind. Use when modeling data, tuning queries, creating migrations, or troubleshooting database behavior.

- Skill: `nikopj01/postgres` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add nikopj01/postgres`
- Raw SKILL.md: https://api.skillmd.com/api/skills/nikopj01/postgres/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: nikopj01 (https://skillmd.com/u/nikopj01)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/nikopj01/postgres

---


# PostgreSQL

## Workflow
1. Model entities, constraints, and relationships explicitly.
2. Write parameterized queries and avoid dynamic SQL concatenation.
3. Add indexes based on query patterns and validate with EXPLAIN ANALYZE.
4. Keep migrations forward-only, reversible where possible, and tested on staging data.
5. Monitor slow queries, connection usage, and lock contention.

