postgresql

postgresql is a skill for Claude Code, Codex from Plazmodium/odin-workflow. It costs 18 tokens per session (922 once invoked), scanned A, original, MIT.

Guidance for using PostgreSQL, an open-source relational database that stores structured information in related tables. It covers table design, queries, constraints, indexes, and performance.

In plain words
What is it for?
Use it to design database schemas, write SQL queries, add constraints and indexes, model relationships, and investigate slow database operations.
Why use it?
It helps keep application data accurate and organized while making common searches and updates efficient. It also addresses relationships, fixed value sets, and cleanup rules when records are deleted.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to design database schemas, write SQL queries, add constraints and indexes, model relationships, and investigate slow database operations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/plazmodium/odin-workflow/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 Plazmodium/odin-workflow --skill postgresql
Clone the repo
git clone --depth 1 https://github.com/Plazmodium/odin-workflow

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 postgresql

README.md
[![agentmods](https://agentmods.dev/badge/skills/plazmodium/odin-workflow/postgresql/github.svg)](https://agentmods.dev/skills/plazmodium/odin-workflow/postgresql)
Your own site
<a href="https://agentmods.dev/skills/plazmodium/odin-workflow/postgresql"><img src="https://agentmods.dev/badge/skills/plazmodium/odin-workflow/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 postgresql

Your own site · 80×15
<a href="https://agentmods.dev/skills/plazmodium/odin-workflow/postgresql"><img src="https://agentmods.dev/badge/skills/plazmodium/odin-workflow/postgresql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 922 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.00018 $0.00922
Opus 5.5 $0.00007 $0.00369
Sonnet 5.5 $0.00004 $0.00184
Haiku 4.5 $0.00002 $0.00092

Measured 1mo ago against content hash a438ec11b8c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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 1mo 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.

agents/skills/database/postgresql/SKILL.md · 121 lines

How it starts

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

PostgreSQL

Overview

PostgreSQL is an advanced open-source relational database. This skill covers schema design, query patterns, indexing, and performance for application developers.

Schema Design

Tables

-- Always use explicit types and constraints
CREATE TABLE users (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    email TEXT NOT NULL UNIQUE,
    password_hash TEXT NOT NULL,
    name TEXT NOT NULL,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

-- Use enums for fixed value sets
CREATE TYPE user_role AS ENUM ('admin', 'member', 'viewer');
ALTER TABLE users ADD COLUMN role user_role NOT NULL DEFAULT 'member';

-- Junction table for many-to-many
CREATE TABLE user_organizations (
    user_id UUID REFERENCES users(id) ON DELETE CASCADE,
    org_id UUID REFERENCES organizations(id) ON DELETE CASCADE,
    role user_role NOT NULL DEFAULT 'member',
    joined_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    PRIMARY KEY (user_id, org_id)
);

Indexes

-- B-tree (default) for equality and range queries
CREATE INDEX idx_users_email ON users(email);

-- Partial index for common filtered queries
CREATE INDEX idx_active_users ON users(created_at) WHERE is_active = true;

-- GIN for JSONB and full-text search
CREATE INDEX idx_metadata ON products USING GIN(metadata);
CREATE INDEX idx_search ON articles USING GIN(to_tsvector('english', title || ' ' || body));

-- Composite for multi-column queries (leftmost prefix rule)
CREATE INDEX idx_org_role ON user_organizations(org_id, role);

Query Patterns

Common Patterns

-- Upsert (INSERT ... ON CONFLICT)
INSERT INTO users (email, name) VALUES ($1, $2)
ON CONFLICT (email) DO UPDATE SET name = EXCLUDED.name, updated_at = now()
RETURNING *;

-- Pagination with cursor (better than OFFSET for large tables)
SELECT * FROM users
WHERE created_at < $1  -- cursor: last item's created_at
ORDER BY created_at DESC
LIMIT 20;

-- CTE for complex queries
WITH active_users AS (
    SELECT * FROM users WHERE last_login > now() - interval '30 days'
)
SELECT org_id, count(*) as active_count
FROM user_organizations uo
JOIN active_users au ON uo.user_id = au.id
GROUP BY org_id;

Read the full file on GitHub · 121 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. 1mo ago First seen · 121 lines · 18 tokens per session scan A a438ec11b8c2

Subscribe to this mod's changes

postgresql is a skill published in the GitHub repository Plazmodium/odin-workflow (0 stars, last pushed 4mo ago), licensed MIT. It adds 18 tokens to every session and 922 once invoked, about $0.0001 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-01.

Related

Other skills, from other repositories

openclaw-database-toolkit

Database operations MCP server with 5 tools for D1, PostgreSQL, and MongoDB. Use when: (1) 'query my D1 database' or 'run this SQL', (2) 'insert these records' or 'add rows to table', (3) 'update records where X' or 'bulk update', (4) 'show me the table schema' or 'what columns exist', (5) 'migrate this schema' or…

yedanyagamiai-cmd/openclaw-mcp-servers · 128 tokens

amazon aurora dsql

Deprecated compatibility redirect for Aurora DSQL guidance. Use when a request concerns DSQL, Aurora DSQL, distributed SQL, DSQL schemas, migrations, queries, authentication, performance, or application development.

awslabs/mcp · 46 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

database-expert

Advanced database design and administration for PostgreSQL, MongoDB, and Redis. Use when designing schemas, optimizing queries, managing database performance, or implementing data patterns.

travisjneuman/.claude · 36 tokens

agent-database-expert

Specialist subagent: Expert database architect and engineer for PostgreSQL, MongoDB, Redis, and all major databases. Use when designing schemas, optimizing queries, planning migrations, implementing caching, or troubleshooting database performance.

travisjneuman/.claude · 49 tokens

multitenant

Architecture multitenant avec approche tiered (Shared/Dedicated Schema/DB), RBAC/ABAC, field-level encryption. Use when working with multitenant applications, tenant isolation, data segregation.

TheBeardedBearSAS/claude-craft · 0 tokens