ia-postgresql

ia-postgresql is a skill for Claude Code from iliaal/whetstone. It costs 49 tokens per session (896 once invoked), scanned A, original, MIT.

A guide to designing, tuning, and administering PostgreSQL databases. PostgreSQL is a relational database system that stores structured data and supports advanced queries.

In plain words
What is it for?
Use it for schemas, indexes, query optimization, JSONB data, table partitioning, row-level security, common table expressions, window functions, and EXPLAIN ANALYZE.
Why use it?
It helps prevent poor table designs and slow queries, while making database behavior easier to inspect and maintain.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the whetstone plugin — 29 skills, 19 commands, 18 agents, 4 hooks, 1 MCP server shipped together

Good fit Use it for schemas, indexes, query optimization, JSONB data, table partitioning, row-level security, common table expressions, window functions, and EXPLAIN ANALYZE.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/iliaal/whetstone/ia-postgresql
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.

Any agent
npx skills add iliaal/whetstone --skill ia-postgresql
Clone the repo
git clone --depth 1 https://github.com/iliaal/whetstone

Made for: Claude Code.

Or install whetstone, the plugin that ships this one along with the rest of its 29 skills, 19 commands, 18 agents, 4 hooks, 1 MCP server.

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 ia-postgresql

README.md
[![agentmods](https://agentmods.dev/badge/skills/iliaal/whetstone/ia-postgresql/github.svg)](https://agentmods.dev/skills/iliaal/whetstone/ia-postgresql)
Your own site
<a href="https://agentmods.dev/skills/iliaal/whetstone/ia-postgresql"><img src="https://agentmods.dev/badge/skills/iliaal/whetstone/ia-postgresql/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ia-postgresql

Your own site · 80×15
<a href="https://agentmods.dev/skills/iliaal/whetstone/ia-postgresql"><img src="https://agentmods.dev/badge/skills/iliaal/whetstone/ia-postgresql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 896 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00049 $0.00896
Opus 5.5 $0.00020 $0.00358
Sonnet 5.5 $0.00010 $0.00179
Haiku 4.5 $0.00005 $0.00090

Measured 12d ago against content hash 29cf29cf5bee, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ia-postgresql 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 12d 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.

plugins/whetstone/skills/ia-postgresql/SKILL.md · 57 lines

How it starts

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

PostgreSQL

Working rules

  • Preserve raw bytes as bytes when fidelity matters; choose parsed types separately for querying.
  • Treat deployed migrations as immutable and account for old and new application versions during rollout.
  • Data rollback needs provenance. Selecting rows by the destination value can also select rows the forward migration never touched. When reversibility is required, preserve affected identities and original values under an explicit policy for subsequent writes. Verify restored data with the application version that will read it.
  • Check lock duration and transaction scope; protect read-modify-write paths against concurrent updates.
  • Match index predicates and NULL semantics to every writer and migration query.
  • Measure query changes with representative data and actual plans; verify invariants as database outcomes.

Data Type Defaults

Need Use Avoid
Primary key BIGINT GENERATED ALWAYS AS IDENTITY SERIAL, BIGSERIAL
Timestamps TIMESTAMPTZ TIMESTAMP (loses timezone)
Text TEXT VARCHAR(n) unless constraint needed
Money NUMERIC(precision, scale) MONEY, FLOAT
Boolean BOOLEAN with NOT NULL DEFAULT nullable booleans
JSON JSONB JSON (no indexing), text JSON
UUID gen_random_uuid() (PG13+) uuid-ossp extension
IP addresses INET / CIDR text
Ranges TSTZRANGE, INT4RANGE, etc. pair of columns
Raw bytes (verbatim payload) BYTEA JSONB, TEXT (both re-encode)

A spec that says "log the raw response" is asking for byte fidelity, and no text type provides it. JSONB reparses: it drops insignificant whitespace, sorts object keys, keeps only the last of duplicate keys, and rewrites numbers out of exponent notation (1e0 -> 1; trailing zeros in 1.00 do survive, so "all numeric forms collapse" overstates it). A non-JSON body cannot be stored at all and usually lands as NULL. TEXT rejects a NUL byte and any sequence invalid in the database encoding, so a binary or mis-encoded body errors instead of storing. Persist the bytes in BYTEA with the content type beside them, and add a parsed JSONB column separately when queries need one. Reading the column type as proof the body is kept is the review error.

Read the full file on GitHub · 57 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago Changed 29cf29cf5bee
  2. 14d ago Changed · +1 lines ab4057626e90
  3. 1mo ago Changed cd0cd2e88c3a
  4. 1mo ago Changed · -211 lines cde643b83e61
  5. 1mo ago First seen · 267 lines · 49 tokens per session scan A 598a833bebfc

Subscribe to this mod's changes

ia-postgresql is a skill published in the GitHub repository iliaal/whetstone (35 stars, last pushed 2d ago), licensed MIT. It adds 49 tokens to every session and 896 once invoked, about $0.0002 per session on Opus 5.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-09-07.

Related

Other skills, from other repositories

engineer

Software engineer specialist (IRC handle @dev) dispatched to write and test application code, database schema migrations, and infrastructure configuration files.

NexaDuo/mARC · 30 tokens

postgresql-code-review

PostgreSQL-specific code review assistant focusing on PostgreSQL best practices, anti-patterns, and unique quality standards. Covers JSONB operations, array usage, custom types, schema design, function optimization, and PostgreSQL-exclusive security features like Row Level Security (RLS).

biggora/dev-team · 59 tokens

ecto-patterns

Use when a task touches Ecto, even a how-to question: schemas, changesets, validations, queries, preloads, Multi, migrations, constraints, money fields. Load it before writing Ecto code. Skip for Ash.

oliver-kriska/claude-elixir-phoenix · 51 tokens

ring:mapping-service-resources

Mapping a Go service's Service -> Module -> Resource hierarchy for dispatch-layer registration: detects modules and per-module PostgreSQL/MongoDB/RabbitMQ resources, database names, and shared databases, generates MongoDB index migration pairs (.up.json/.down.json), detects existing Postgres migrations, emits an HTML…

LerianStudio/ring · 97 tokens

cloudflare-hyperdrive

Cloudflare Hyperdrive for Workers-to-database connections with pooling and caching. Use for PostgreSQL/MySQL, Drizzle/Prisma, or encountering pool errors, TLS issues, connection refused.

secondsky/claude-skills · 45 tokens

backup-recovery

Design and verify backups and restoration for owned databases, files and application state. Use when preparing recovery, migrating data or testing backups; protect the source and prove restore into an isolated destination before calling recovery ready.

WrongStack/WrongStack · 45 tokens