Skip to content
Back to skills

Senior Postgresql

ASecurity

Use when designing, reviewing, tuning, migrating, securing, or troubleshooting PostgreSQL schemas, SQL, indexes, EXPLAIN plans, transactions, locks, JSONB, replication, backups, or database operations.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 26, 2026
ai-agentssqlexpressdatabasesecurityperformance

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 26, 2026

npx -y skills add a365ngay/CogniRouter --skill senior-postgresql --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Senior Postgresql?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Senior Postgresql
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/a365ngay-senior-postgresql/badge)](https://www.skillsdirectory.com/skills/a365ngay-senior-postgresql)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: senior-postgresql
description: Use when designing, reviewing, tuning, migrating, securing, or troubleshooting PostgreSQL schemas, SQL, indexes, EXPLAIN plans, transactions, locks, JSONB, replication, backups, or database operations.
---

# Senior PostgreSQL

## Role

Deliver PostgreSQL changes that maintain data integrity, work under real concurrency, and are measured against representative workload rather than intuition.

## Workflow

1. Inspect schema, constraints, migrations, data scale, query callers, PostgreSQL version, extensions, autovacuum health, statistics, locks, and deployment process.
2. Define the invariant, query shape, expected cardinality, isolation behavior, performance target, operational risk, and reversible path.
3. Use parameterized SQL, correct types, declarative constraints, set-based operations, and clear ownership. Keep JSONB flexible only where schema variability is real and query/index behavior remains intentional.
4. Use `EXPLAIN (ANALYZE, BUFFERS)` on safe representative workloads to establish a baseline and validate a change. Account for stale statistics, cache effects, selectivity, and write amplification.
5. Design indexes deliberately: B-tree by default, partial or expression indexes only for proven predicates, GIN/GiST when data operators require them. Consider concurrent index creation and index maintenance cost.
6. Make migration locks, table rewrites, backfills, transaction duration, replicas, and rollback explicit. Stage large operations to protect availability.

## Query and Concurrency Rules

- Avoid `SELECT *`, implicit casts, non-indexable predicates, N+1 access, accidental Cartesian joins, unbounded reads, unsafe dynamic SQL, and `OFFSET` pagination on deep large datasets without a reasoned trade-off.
- Respect MVCC: long transactions can block vacuum and cause bloat; lock only what is necessary; design retries for serialization or deadlock failures where needed.
- Use the least privilege roles, row-level security only with a reviewed policy model, and no credentials or sensitive data in logs or client-visible errors.
- Do not change backup, restore, replication, retention, or production data without explicit authorization.

## Verification

Verify functional semantics, constraints, permissions, concurrent writers/readers, migration forward/rollback, and performance evidence. State PostgreSQL version, workload assumptions, and any production-only uncertainty.

Files in this skill

  • SKILL.md2.4 KB
  • agents/openai.yaml207 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.