postgres

postgres is a skill for Claude Code, Codex from neverinfamous/memory-journal-mcp. It costs 107 tokens per session (677 once invoked), scanned A, original, MIT.

A set of production rules for PostgreSQL, a full-featured database server. It covers safe queries, indexes, JSON data, access controls, migrations, and efficient loading of related records.

In plain words
What is it for?
Use it when designing PostgreSQL schemas, writing queries, working with JSONB or vector data, adding indexes, configuring row-level security, or creating migrations.
Why use it?
It helps prevent SQL injection, accidental broad updates or deletes, unnecessary data transfer, inefficient repeated queries, and poorly chosen indexes.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/neverinfamous/memory-journal-mcp/postgres
Any agent
npx skills add neverinfamous/memory-journal-mcp --skill postgres
Clone the repo
git clone --depth 1 https://github.com/neverinfamous/memory-journal-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for postgres

README.md
[![agentmods](https://agentmods.dev/badge/skills/neverinfamous/memory-journal-mcp/postgres.svg)](https://agentmods.dev/skills/neverinfamous/memory-journal-mcp/postgres)
Your own site
<a href="https://agentmods.dev/skills/neverinfamous/memory-journal-mcp/postgres"><img src="https://agentmods.dev/badge/skills/neverinfamous/memory-journal-mcp/postgres.svg" alt="Measured on agentmods" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 677 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00107 $0.00677
Opus 5 $0.00053 $0.00338
Sonnet 5 $0.00021 $0.00135
Haiku 4.5 $0.00011 $0.00068

Measured 5d ago against content hash 869f3b5245cd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

postgres scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/postgres/SKILL.md · 39 lines

How it starts

The opening of the file, as written. The whole thing — 39 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostgreSQL Production Standards

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 advanced JOIN logic when building APIs. Do not execute identical iterative queries inside loops.
  • Guarded Modifications: Any UPDATE or DELETE MUST contain a deterministic WHERE block.

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 ANALYZE locally 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 sane DEFAULT properties to avoid backfilling issues on massive tables.

Read the full file on GitHub · 39 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 39 lines · 107 tokens per session scan A 869f3b5245cd

Subscribe to this mod's changes

postgres is a skill published in the GitHub repository neverinfamous/memory-journal-mcp (20 stars, last pushed 1mo ago), licensed MIT. It adds 107 tokens to every session and 677 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

migration-helper

Guide safe database and code migrations with zero-downtime strategies.

nguyenthienthanh/aura-frog · 16 tokens

surrealdb-canonical-layer

Verify a SurrealDB-backed canonical layer directly, over the surrealdb MCP server, instead of writing a disposable Node script per check. Use whenever the user asks to confirm a batch of writes landed correctly ("did the FreedomFest speakers get tagged right", "do these people have an org relationship", "check that…

lossless-group/lossless-agent-skills · 249 tokens

postgresql-psql

Comprehensive guide for PostgreSQL psql - the interactive terminal client for PostgreSQL. Use when connecting to PostgreSQL databases, executing queries, managing databases/tables, configuring connection options, formatting output, writing scripts, managing transactions, and using advanced psql features for database…

Unique-Divine/jiyuu · 64 tokens

database-reviewer

PostgreSQL database specialist for query optimization, schema design, security, and performance. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance. Incorporates Supabase best practices.

myths-labs/muse · 48 tokens

database-reviewer

PostgreSQL database specialist — query optimization, schema design, index strategy, migration safety, anti-patterns.

RaNDoM6913/claude-code-superkit · 25 tokens

postgresql-optimization

PostgreSQL optimization — query tuning, indexing strategies, EXPLAIN analysis, configuration, maintenance, and monitoring. Use when slow queries, missing indexes, vacuum lag, or performance bottlenecks are suspected.

RaNDoM6913/claude-code-superkit · 46 tokens