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.
npx agentmods add skills/aniket-a14/sra/postgresqlnpx skills add Aniket-a14/SRA --skill postgresqlgit clone --depth 1 https://github.com/Aniket-a14/SRAWrote 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.
[](https://agentmods.dev/skills/aniket-a14/sra/postgresql)<a href="https://agentmods.dev/skills/aniket-a14/sra/postgresql"><img src="https://agentmods.dev/badge/skills/aniket-a14/sra/postgresql.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00031 | $0.01366 |
| Opus 5 | $0.00015 | $0.00683 |
| Sonnet 5 | $0.00006 | $0.00273 |
| Haiku 4.5 | $0.00003 | $0.00137 |
Grade B, and why
postgresql scanned grade B with 1 finding 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 4d 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.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
sudo apt-get install postgresql postgresql-contrib How it starts
The opening of the file, as written. The whole thing — 243 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL Administration
Installation & Setup
# On Linux (Ubuntu/Debian)
sudo apt-get install postgresql postgresql-contrib
# On macOS
brew install postgresql@15
# Docker installation
docker run --name postgres -e POSTGRES_PASSWORD=password -p 5432:5432 -d postgres:15
# Start and enable PostgreSQL
sudo systemctl start postgresql
sudo systemctl enable postgresql
Connection Basics
# Connect to default database
psql -U postgres
# Connect to specific database
psql -U postgres -d mydb -h localhost -p 5432
# List databases
\l
# List tables in current database
\dt
# Get table info
\d table_name
# Quit psql
\q
User & Role Management
-- Create a new role
CREATE ROLE developer WITH LOGIN PASSWORD 'secure_password';
-- Create superuser role
CREATE ROLE admin WITH SUPERUSER LOGIN PASSWORD 'admin_password';
-- Grant privileges on database
GRANT CONNECT ON DATABASE mydb TO developer;
-- Grant privileges on schema
GRANT USAGE ON SCHEMA public TO developer;
-- Grant privileges on tables
GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN SCHEMA public TO developer;
-- Grant privileges on specific table
GRANT SELECT ON employees TO developer;
-- Make role a database owner
ALTER DATABASE mydb OWNER TO developer;
-- Revoke privileges
REVOKE INSERT, UPDATE ON employees FROM developer;
-- Drop role
DROP ROLE developer;
Configuration & Tuning
# PostgreSQL configuration file
sudo nano /etc/postgresql/15/main/postgresql.conf
# Key configuration parameters:
# Memory
shared_buffers = 256MB # 25% of RAM for dedicated server
effective_cache_size = 1GB # 50-75% of RAM
work_mem = 64MB # RAM per operation
# Connections
max_connections = 200
superuser_reserved_connections = 3
# Write-Ahead Log
wal_level = replica
max_wal_senders = 3
wal_keep_segments = 64
# Query planning
random_page_cost = 1.1 # For SSD
log_min_duration_statement = 1000 # Log slow queries
Backup & Recovery
What ships with it
4 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.
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.
- 4d ago First seen · 243 lines · 31 tokens per session scan B 159c9c7a2572
postgresql is a skill published in the GitHub repository Aniket-a14/SRA (23 stars, last pushed 5d ago), licensed Apache-2.0. It adds 31 tokens to every session and 1,366 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
alembic-migration
Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.
supabase
Use when doing ANY task involving Supabase: Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues, supabase-js, @supabase/ssr, RLS, schema migrations, CLI, MCP server. Includes security checklist.
db-schema
Design a database schema from product requirements. Postgres-first with Supabase awareness. Use when user says "design the database", "create schema", "data model", "database structure", "what tables do I need", "schema design", or needs to translate requirements into a relational schema.
supabase-postgres-best-practices
Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.
postgresql-expert
Expert-level PostgreSQL database administration, advanced queries, performance tuning, and production operations.
database-migrations
Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Kysely, Django, TypeORM, golang-migrate).