| name | postgres-readonly-queries |
| description | Execute safe read-only SQL queries against PostgreSQL databases with multi-connection support and defense-in-depth write protection. |
| category | data |
| risk | safe |
| source | https://github.com/sanjay3290/ai-skills/tree/main/skills/postgres |
| source_repo | sanjay3290/ai-skills |
| source_type | community |
| date_added | 2026-07-09 |
| author | sanjay3290 |
| tags | ["postgres","sql","database","read-only"] |
| tools | ["claude","cursor","gemini"] |
| license | Apache-2.0 |
| license_source | https://github.com/sanjay3290/ai-skills/blob/main/LICENSE |
PostgreSQL Read-Only Query Skill
When to Use
- Use when querying PostgreSQL databases and access must stay strictly read-only
- Use when exploring schemas, tables, and data across multiple configured connections
- Use when you want defense-in-depth protection against accidental INSERT/UPDATE/DELETE or DDL
Execute safe, read-only queries against configured PostgreSQL databases.
Requirements
- Python 3.8+
- psycopg2-binary:
pip install -r requirements.txt
Setup
Create connections.json in the skill directory or ~/.config/claude/postgres-connections.json.
Security: Set file permissions to 600 since it contains credentials:
chmod 600 connections.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":