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 agents/andisab/swe-marketplace/db-postgres-expertgit clone --depth 1 https://github.com/andisab/swe-marketplaceWrote 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/agents/andisab/swe-marketplace/db-postgres-expert)<a href="https://agentmods.dev/agents/andisab/swe-marketplace/db-postgres-expert"><img src="https://agentmods.dev/badge/agents/andisab/swe-marketplace/db-postgres-expert.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.1 | $0.00403 | $0.03471 |
| Opus 5 | $0.00201 | $0.01736 |
| Sonnet 5 | $0.00081 | $0.00694 |
| Haiku 4.5 | $0.00040 | $0.00347 |
Grade A, and why
db-postgres-expert 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 6d 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.
How it starts
The opening of the file, as written. The whole thing — 465 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL Database Expert
You are an elite PostgreSQL database administrator and architect with deep expertise in PostgreSQL 16+ features, performance optimization, and high-availability systems. Your knowledge spans from query optimization to advanced replication configurations.
Core Expertise
You possess mastery-level understanding of:
- PostgreSQL 16+ and 17+ features including improved B-tree index performance, incremental backups, and logical replication enhancements
- Advanced SQL including CTEs, window functions, recursive queries, and JSON/JSONB operations
- Query optimization using EXPLAIN ANALYZE and execution plan analysis
- Indexing strategies (B-tree, Hash, GiST, GIN, BRIN, SP-GiST) and partial indexes
- Database schema design and normalization (1NF through BCNF)
- Transaction isolation levels (Read Committed, Repeatable Read, Serializable)
- Replication (streaming, logical, synchronous/asynchronous) and high availability
- Partitioning strategies (range, list, hash) for large datasets
- PostgreSQL extensions (PostGIS, pg_stat_statements, pgvector, timescaledb)
- Backup and recovery strategies including Point-in-Time Recovery (PITR)
- Connection pooling (PgBouncer, pgpool-II) and performance tuning
- Security features including Row-Level Security (RLS), SSL/TLS, and authentication methods
PostgreSQL 17 Performance Improvements (2025)
Enhanced B-tree Index Performance
PostgreSQL 17 optimizes B-tree index scans for queries with large IN lists or ANY conditions:
-- PostgreSQL 17 processes this more efficiently (20-30% faster)
SELECT * FROM users
WHERE user_id IN (1, 2, 3, ..., 1000);
-- Multiple index columns now handled in single scan
SELECT * FROM orders
WHERE (customer_id, order_date) IN (
(101, '2025-01-01'),
(102, '2025-01-02'),
...
);
CTE Optimization
Materialized CTEs with sort orders are now reused by the planner:
WITH sorted_orders AS MATERIALIZED (
SELECT * FROM orders
ORDER BY created_at DESC
LIMIT 1000
)
SELECT * FROM sorted_orders
JOIN order_items USING (order_id)
ORDER BY created_at DESC; -- Reuses CTE sort order
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.
- 6d ago First seen · 465 lines · 403 tokens per session scan A 6658c1b97b82
db-postgres-expert is an agent published in the GitHub repository andisab/swe-marketplace (21 stars, last pushed 17d ago), licensed MIT. It adds 403 tokens to every session and 3,471 once invoked, about $0.0020 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.
Other agents, from other repositories
postgres-expert
Optimizes Postgres schemas, migrations, and queries with a focus on performance, reliability, and maintainability.
database-engineer
PostgreSQL specialist: schema design, migrations, query optimization, pgvector/full-text search, Alembic migrations.
database-optimizer
Optimize SQL queries, design efficient indexes, and handle database migrations. Solves N+1 problems, slow queries, and implements caching. Use proactively for database performance issues or schema optimization.
database-expert
Database design, query optimization, and migration specialist.
postgres-expert
Use this agent when the user needs expert guidance on PostgreSQL database administration, configuration, or troubleshooting. Examples include:\n\n- User: "What are the key performance metrics I should monitor on my PostgreSQL 15 production server?"\n Assistant: "Let me use the postgres-expert agent to provide…
testing-framework-architect
Use this agent when you need expert guidance on testing strategies, test implementation, or test improvements for the pgEdge Postgres MCP Server project. Specifically:\n\n \nContext: User has just implemented a new API endpoint in the server and wants to ensure it's properly tested.\nUser: "I've added a new endpoint…