PostgreSQL Production Standards
SkillDatabases & dataUse when designing, querying, or managing a PostgreSQL database. Enforces enterprise production rules for advanced querying, composite indexing, JSONB data handling, and strict optimization patterns (avoiding N+1). Keywords: PostgreSQL query, JSONB, pg, pgvector, RLS, Postgres migration. MUST-ASK: Require explicit database engine name before triggering. Never guess. Do NOT trigger for generic "set up a database" requests. NOT for SQLite or MySQL. NOT for ORM-managed migrations.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the PostgreSQL Production Standards skill
What this skill tells your AI
The instructions your AI receives, as published by neverinfamous/memory-journal-mcp in skills/postgres/SKILL.md and read by ahel’s review.
PostgreSQL is a deeply capable object-relational database. Because of its advanced feature set, AI agents and orchestrated deployment workflows MUST adhere to strict operational boundaries to avoid common pitfalls like index bloating, inefficient JSONB parsing, and locking regressions.
1. Advanced Querying & Safety
- Strict Parameterization: Just like MySQL, executing parameterized queries (
$1, $2, ...) is a non-negotiable hard mandate. String interpolation is globally prohibited. - Explicit Columns: NEVER use
SELECT *in production code. You must specifically query required columns. This minimizes data transfer latency and prevents application crashes if schema columns mutate. - N+1 Avoidance: Agents scaffolding code must implement batch loading architectures (e.g.,
DataLoader) or advancedJOINlogic when building APIs. Do not execute identical iterative queries inside loops. - Guarded Modifications: Any
UPDATEorDELETEMUST contain a deterministicWHEREblock.
2. Advanced Indexing Patterns
- Targeted Strategies: Do not blindly index every column. Optimize based on frequency.
- Partial Indexes: If you routinely query states like
WHERE active = true, you must use a Partial Index (CREATE INDEX idx_active_users ON users(email) WHERE active = true;) instead of indexing the entire column. - Composite Layout: For standard queries targeting multiple identifiers, employ Composite Indexes with the most selective columns first.
3. Operations & Migrations
- Transaction Safety: Wrap multi-step mutations in
BEGIN; ... COMMIT;. Standardize transactions to stay small and fast to prevent lock contentions. - Analytical Overviews: Use
EXPLAIN ANALYZElocally when debugging slow queries to analyze sequential sweeps relative to index scans. - Schema Extensibility: Add constraints and columns dynamically (e.g.,
ALTER TABLE users ADD CONSTRAINT unique_email UNIQUE (email);). Always apply saneDEFAULTproperties to avoid backfilling issues on massive tables.
4. Modern PostGres Functionality
- JSONB Arrays/Objects: Use
JSONB, neverJSON. JSONB is stored in a decomposed binary format, allowing fast, native index checking (via@>or?operators) instead of full parsing upon retrieval. - Row-Level Security (RLS): Emphasize defining default-deny security protocols using
ENABLE ROW LEVEL SECURITY. - Ecosystem Integration: Whenever available, prefer using structured
postgres-mcptools for safe schema interpretation over native Bashpsqlpiping.
Signals
- GitHub stars
- 20
- Forks
- 5
- Last commit
- Jul 2026
ahel review
S4info
community integration — published by neverinfamous, not postgres
Automated review, not a security audit. Ruleset v1.
Advanced
- Catalog kind
- skill
- Gateway key
postgres-neverinfamous- Source
- github.com/neverinfamous/memory-journal-mcp