postgresql-psql

postgresql-psql is a skill for Claude Code, Codex from Unique-Divine/jiyuu. It costs 64 tokens per session (634 once invoked), scanned A, original, MIT.

A guide to psql, PostgreSQL's command-line program for connecting to databases and running SQL or psql-specific commands. PostgreSQL is a database system, while psql is its interactive terminal client.

In plain words
What is it for?
Use it to query PostgreSQL, create and manage databases and database objects, automate administration, export results, handle transactions, and debug SQL.
Why use it?
It gives one reference for interactive database work, scripts, connections, output formatting, transactions, permissions, and troubleshooting instead of relying on remembered commands.

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/unique-divine/jiyuu/postgresql-psql
Any agent
npx skills add Unique-Divine/jiyuu --skill postgresql-psql
Clone the repo
git clone --depth 1 https://github.com/Unique-Divine/jiyuu

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-psql

README.md
[![agentmods](https://agentmods.dev/badge/skills/unique-divine/jiyuu/postgresql-psql.svg)](https://agentmods.dev/skills/unique-divine/jiyuu/postgresql-psql)
Your own site
<a href="https://agentmods.dev/skills/unique-divine/jiyuu/postgresql-psql"><img src="https://agentmods.dev/badge/skills/unique-divine/jiyuu/postgresql-psql.svg" alt="Measured on agentmods" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 634 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.00064 $0.00634
Opus 5 $0.00032 $0.00317
Sonnet 5 $0.00013 $0.00127
Haiku 4.5 $0.00006 $0.00063

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

Security

Grade A, and why

postgresql-psql 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.

ai-skills/postgresql-psql/SKILL.md · 93 lines

How it starts

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

PostgreSQL psql Skill

PostgreSQL psql (PostgreSQL interactive terminal) is the primary command-line client for interacting with PostgreSQL databases. It provides both interactive query execution and powerful scripting capabilities for database management and administration.

When to Use This Skill

Use this skill when:

  • Connecting to PostgreSQL databases from the command line
  • Executing SQL queries interactively
  • Writing SQL scripts for automation
  • Creating and managing databases and schemas
  • Managing database objects (tables, views, indexes, functions)
  • Backing up and restoring databases
  • Configuring connections and authentication
  • Formatting and exporting query results
  • Managing transactions and permissions
  • Debugging SQL queries
  • Automating database administration tasks
  • Setting up replication and high availability
  • Creating stored procedures and functions

Core Concepts

REPL Model

  • psql operates as an interactive REPL (Read-Eval-Print Loop)
  • Accepts SQL commands and meta-commands (backslash commands)
  • Maintains connection state across commands within a session
  • Supports command history and editing

Command Types

  • SQL Commands: Standard SQL statements (SELECT, INSERT, UPDATE, DELETE, etc.)
  • Meta-Commands: psql-specific commands prefixed with backslash (e.g., \dt, \d)
  • Backslash Commands: Control query output, session variables, and psql behavior

Connection Model

  • Single database connection per session
  • Can switch databases without reconnecting
  • Connection state includes current database, user, and search path
  • Environmental variables and .pgpass for credential management

Reference Pointers

Detailed command lists, flags, and configuration options are available in reference.md:

  • Connect and Authenticate
  • Meta-Commands
  • Output and Formatting
  • Files, Editor, and Scripting
  • Command-Line Flags
  • Import and Export
  • Backup and Restore
  • Performance and Debug Toolbox
  • Troubleshooting

Read the full file on GitHub · 93 lines

Files

What ships with it

1 file 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. 5d ago First seen · 93 lines · 64 tokens per session scan A 0468c2536845

Subscribe to this mod's changes

postgresql-psql is a skill published in the GitHub repository Unique-Divine/jiyuu (6 stars, last pushed 23d ago), licensed MIT. It adds 64 tokens to every session and 634 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

postgres-performance

PostgreSQL latency, load, locks, connections, WAL, vacuum, planner, and capacity depth reference.

Dankosik/go-service-template-rest · 25 tokens

postgres-schema-design

Relational identity, cardinality, invariant, constraint, lifecycle, and migration depth reference.

Dankosik/go-service-template-rest · 22 tokens

postgres

Use when designing, querying, or managing a PostgreSQL database. Enforces enterprise production rules for advanced querying, composite indexing, JSONB data handling, and strict optimization patterns (avoiding N+1). Keywords: PostgreSQL query, JSONB, pg, pgvector, RLS, Postgres migration. MUST-ASK: Require explicit…

neverinfamous/memory-journal-mcp · 107 tokens

postgresql-table-design

Design a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.

Harmeet10000/skills · 31 tokens

sql-optimization-patterns

Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.

Harmeet10000/skills · 44 tokens

alloydb-basics

Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.

google/skills · 72 tokens