postgres

Execute read-only SQL queries against configured PostgreSQL databases.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/bouwerp/agentic-framework --skill postgres-bouwerp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres
Source: https://github.com/bouwerp/agentic-framework/tree/main/skills/postgres
Command: npx skills add https://github.com/bouwerp/agentic-framework --skill postgres-bouwerp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires psycopg2, and includes scripts (resource) components.

What problem does it solve?

It enables safe, read-only access to PostgreSQL databases for schema exploration, data validation, and debugging without risking writes.

Core Features & Use Cases

  • Read-only sessions that permit SELECT, SHOW, EXPLAIN, and schema introspection across configured databases.
  • Supports listing configured databases, inspecting table schemas, and executing targeted read-only queries with optional row limits.
  • Safe defaults and defenses: single-statement enforcement, statement timeouts, and credential-protected configuration via connections.json.

Quick Start

Configure a read-only connections.json and run python3 skills/postgres/scripts/query.py --db production --query 'SELECT 1'.

Frequently Asked Questions about postgres

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run read-only PostgreSQL queries safely for schema exploration?

Configure a read-only connections.json file with your database credentials, then execute queries using the Python query script. This setup enforces a read-only session, single-statement policy, and statement timeouts to prevent unauthorized writes during schema exploration.

What SQL statements are allowed in a safe read-only PostgreSQL session?

A safe read-only PostgreSQL session allows SELECT, SHOW, EXPLAIN, and schema introspection queries. It enforces a single-statement policy and blocks any data modification commands to ensure safe data validation and debugging without risking writes.

Do I need psycopg2 to execute read-only SQL queries against PostgreSQL?

Yes, you need psycopg2 installed as it is the required dependency for executing the read-only SQL queries. The Python script relies on it to connect to PostgreSQL databases and enforce the single-statement, read-only session policies.

Can I inspect table schemas across multiple configured PostgreSQL databases?

Yes, you can inspect table schemas across multiple configured PostgreSQL databases. The tool supports listing configured databases and executing targeted read-only queries with optional row limits for comprehensive schema exploration.

What are the limitations of enforcing a single-statement policy for PostgreSQL queries?

The single-statement policy limits executing multiple SQL commands in one query, preventing complex transactions or batch operations. This constraint, combined with statement timeouts, ensures strict read-only safety but restricts advanced multi-statement query chaining.