Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Execute read-only SQL queries against multiple PostgreSQL databases. Use when: (1) querying PostgreSQL databases, (2) exploring database schemas/tables, (3) running SELECT queries for data analysis, (4) checking database contents. Supports multiple database connections with descriptions for intelligent auto-selection. Blocks all write operations (INSERT, UPDATE, DELETE, DROP, etc.) for safety.
.claude/skills/sanjay3290-postgres/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | -27% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -38% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -28% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -17% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -40% | 0% |
Execute safe, read-only queries against configured PostgreSQL databases.
pip install -r requirements.txtCreate connections.json in the skill directory or ~/.config/claude/postgres-connections.json.
Security: Set file permissions to 600 since it contains credentials:
bashchmod 600 connections.json
json{ "databases": [ { "name": "production", "description": "Main app database - users, orders, transactions", "host": "db.example.com", "port": 5432, "database": "app_prod", "user": "readonly_user", "password": "your-password", "sslmode": "require" } ] }
| Field | Required | Description | |-------|----------|-------------| | name | Yes | Identifier for the database (case-insensitive) | | description | Yes | What data this database contains (used for auto-selection) | | host | Yes | Database hostname | | port | No | Port number (default: 5432) | | database | Yes | Database name | | user | Yes | Username | | password | Yes | Password | | sslmode | No | SSL mode: disable, allow, prefer (default), require, verify-ca, verify-full |
bashpython3 scripts/query.py --list
bashpython3 scripts/query.py --db production --query "SELECT * FROM users LIMIT 10"
bashpython3 scripts/query.py --db production --tables
bashpython3 scripts/query.py --db production --schema
bashpython3 scripts/query.py --db production --query "SELECT * FROM orders" --limit 100
Match user intent to database description:
| User asks about | Look for description containing | |-----------------|--------------------------------| | users, accounts | users, accounts, customers | | orders, sales | orders, transactions, sales | | analytics, metrics | analytics, metrics, reports | | logs, events | logs, events, audit |
If unclear, run --list and ask user which database.
readonly=True mode (primary protection)| Error | Solution | |-------|----------| | Config not found | Create connections.json in skill directory | | Authentication failed | Check username/password in config | | Connection timeout | Verify host/port, check firewall/VPN | | SSL error | Try "sslmode": "disable" for local databases | | Permission warning | Run chmod 600 connections.json |
--list to show available databases--tables or --schema to explore structure| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 6,944 | 8,738 | +26% | 1 | 1 | 0% | 1,274 | 1,032 | -19% | 0 | 0 | — |
case-02 | fail→fail | 3,012 | 3,633 | +21% | 1 | 1 | 0% | 493 | 1,014 | +106% | 0 | 0 | — |
case-03 | fail→fail | 5,151 | 5,929 | +15% | 1 | 1 | 0% | 959 | 1,302 | +36% | 0 | 0 | — |
case-04 | pass→pass | 6,483 | 3,396 | -48% | 1 | 1 | 0% | 1,195 | 1,234 | +3% | 0 | 0 | — |
case-05 | fail→pass | 11,133 | 2,429 | -78% | 1 | 1 | 0% | 1,916 | 1,393 | -27% | 0 | 0 | — |
case-06 | fail→pass | 9,192 | 1,336 | -85% | 1 | 1 | 0% | 1,719 | 1,065 | -38% | 0 | 0 | — |
case-07 | fail→pass | 9,852 | 1,720 | -83% | 1 | 1 | 0% | 1,627 | 1,170 | -28% | 0 | 0 | — |
case-08 | fail→pass | 13,583 | 5,047 | -63% | 1 | 1 | 0% | 2,191 | 1,815 | -17% | 0 | 0 | — |
case-09 | fail→pass | 11,902 | 1,629 | -86% | 1 | 1 | 0% | 1,875 | 1,118 | -40% | 0 | 0 | — |
case-10 | pass→pass | 7,017 | 3,227 | -54% | 1 | 1 | 0% | 1,125 | 1,462 | +30% | 0 | 0 | — |
case-11 | pass→fail | 5,231 | 3,787 | -28% | 1 | 1 | 0% | 977 | 1,224 | +25% | 0 | 0 | — |
case-12 | fail→fail | 5,628 | 3,028 | -46% | 1 | 1 | 0% | 964 | 1,418 | +47% | 0 | 0 | — |
case-13 | fail→pass | 5,320 | 3,563 | -33% | 1 | 1 | 0% | 933 | 1,518 | +63% | 0 | 0 | — |
case-14 | fail→pass | 10,247 | 2,963 | -71% | 1 | 1 | 0% | 1,733 | 1,388 | -20% | 0 | 0 | — |
case-15 | pass→pass | 10,082 | 1,860 | -82% | 1 | 1 | 0% | 1,809 | 1,157 | -36% | 0 | 0 | — |
case-16 | pass→pass | 4,487 | 1,890 | -58% | 1 | 1 | 0% | 777 | 1,214 | +56% | 0 | 0 | — |
case-17 | pass→pass | 14,467 | 4,011 | -72% | 1 | 1 | 0% | 2,350 | 1,503 | -36% | 0 | 0 | — |
case-18 | pass→pass | 4,474 | 1,374 | -69% | 1 | 1 | 0% | 697 | 1,087 | +56% | 0 | 0 | — |
case-19 | fail→pass | 6,467 | 1,909 | -70% | 1 | 1 | 0% | 1,196 | 1,200 | +0% | 0 | 0 | — |
case-20 | fail→pass | 10,651 | 5,600 | -47% | 1 | 1 | 0% | 1,910 | 1,809 | -5% | 0 | 0 | — |
case-21 | pass→pass | 6,503 | 5,191 | -20% | 1 | 1 | 0% | 1,373 | 1,788 | +30% | 0 | 0 | — |
case-22 | pass→pass | 7,565 | 6,047 | -20% | 1 | 1 | 0% | 1,483 | 1,987 | +34% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +36 percentage points is the difference between those two pass rates over the 19 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.