postgres-patterns
Review PostgreSQL Migrations and Queries
PostgreSQL migrations can pass tests while causing locks, slow scans, or index bloat. This skill gives Claude, Codex, and Claude Code practical patterns for safer schema and query review.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "postgres-patterns" from https://skillstore.io/skills/cjharmath-postgres-patterns.md and its manifest at https://skillstore.io/api/skills/cjharmath-postgres-patterns/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "postgres-patterns". Review a migration that adds an index to a large events table.
Expected outcome:
- The review highlights lock risk during index creation on a write-heavy table.
- It recommends a concurrent index and notes that migration transactions may need special handling.
- It asks for table size and write volume before approving the migration.
Using "postgres-patterns". Improve a slow query that filters by user, status, and creation date.
Expected outcome:
- The guidance connects the index order to the filter and sort pattern.
- It warns against adding unrelated single-column indexes that increase write cost.
- It suggests checking the execution plan before and after the change.
Using "postgres-patterns". Review database types for a new PostgreSQL table.
Expected outcome:
- The response recommends timezone-aware timestamps, exact numeric values for money, and JSONB for queried JSON data.
- It explains UUID tradeoffs and asks whether insertion order matters.
Security Audit
SafeI found no evidence of prompt injection, malware, data exfiltration, or unauthorized host execution in SKILL.md. The static findings are false positives from Markdown code fences, inline code formatting, and PostgreSQL example queries. The skill is instructional database review content for migrations, indexes, locks, and query performance.
Risk Factors
⚙️ External commands (41)
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/cjharmath-postgres-patterns/audits/7?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/cjharmath-postgres-patterns?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/cjharmath-postgres-patterns?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/cjharmath-postgres-patterns/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/cjharmath-postgres-patterns.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA · BibTeX · CFF)
APA citation
CJHarmath. (2026). postgres-patterns security audit report (audit version 7) [Author version unspecified]. Skillstore. https://skillstore.io/skills/cjharmath-postgres-patterns/audits/7BibTeX citation
@techreport{cjharmath-cjharmath-postgres-patterns-2026,
author = {CJHarmath},
title = {postgres-patterns security audit report (audit version 7)},
institution = {Skillstore},
year = {2026},
number = {7},
url = {https://skillstore.io/skills/cjharmath-postgres-patterns/audits/7},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "postgres-patterns security audit report (audit version 7)"
version: "unspecified"
type: report
authors:
- name: "CJHarmath"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/cjharmath-postgres-patterns/audits/7"
identifiers:
- type: other
value: "skillstore:cjharmath-postgres-patterns:audit:7"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this score Evidence Confidence: HighWhat You Can Build
Review Alembic Migrations
Check schema changes for lock risk, missing indexes, constraint names, and safe non-null column patterns.
Improve Query Performance
Match indexes to filter, join, and sort patterns before slow queries affect users.
Prepare Database Reviews
Use concise checklists for index usage, table size, locks, JSONB access, and data type choices.
Try These Prompts
Review this PostgreSQL migration for missing indexes, unsafe locks, and constraint naming. Explain each concern in plain language.
Given these common queries and table sizes, recommend PostgreSQL indexes. Include which indexes to avoid and why.
Interpret this PostgreSQL execution plan. Identify scans, sorts, joins, row estimates, and index changes that may improve performance.
Create a safe PostgreSQL migration rollout plan for a large table. Cover concurrent indexes, batching, constraints, locks, and rollback checks.
Best Practices
- Pair each index recommendation with the query pattern it supports.
- Check table size and write volume before approving schema changes.
- Review lock impact before running migrations on production tables.
Avoid
- Adding indexes without knowing the matching query pattern.
- Using blocking schema changes on large tables during active writes.
- Treating generic migration output as production-ready without PostgreSQL review.