postgres

Run read-only SELECT, EXPLAIN, and SHOW queries across configured PostgreSQL databases.

9|2|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/hongmaple0820/agent-academy --skill postgres-hongmaple0820
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres
Source: https://github.com/hongmaple0820/agent-academy/tree/main/skills/data-analysis/sanjay-postgres
Command: npx skills add https://github.com/hongmaple0820/agent-academy --skill postgres-hongmaple0820

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Running queries across multiple PostgreSQL databases safely is challenging due to risk of write operations, credential exposure, and inconsistent access controls. This skill provides a centralized, read-only interface to connect to configured databases, explore schemas, and fetch data without altering state.

Core Features & Use Cases

  • Read-only sessions that block writes and enforce query safety.
  • Explore schemas, list tables, and run SELECT queries across configured databases.
  • Use cases include data analysis, data discovery, and quick health checks across environments.

Quick Start

Run a safe, read-only query against a configured PostgreSQL database to start exploring data.

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 across multiple databases?

Safe read-only PostgreSQL queries are executed by enforcing query validation that allows only SELECT, EXPLAIN, and SHOW statements. The system establishes read-only sessions, enforces single-statement execution, and applies per-query timeouts to prevent write operations across multiple configured databases.

What is the best way to explore database schemas without risking accidental writes?

Exploring schemas without accidental writes requires a read-only interface that enforces query validation for SELECT, EXPLAIN, and SHOW statements. This approach blocks write operations through single-statement enforcement and read-only sessions, ensuring safe schema discovery and data analysis.

Does PostgreSQL query validation support large data analysis outputs?

PostgreSQL query validation supports data analysis but implements a result cap to prevent large outputs. It also enforces per-query timeouts, ensuring that data fetching and quick health checks across configured databases remain controlled and do not overwhelm the system.

How do I enforce single-statement execution for SQL queries in PostgreSQL?

Single-statement execution for SQL queries is enforced by a validation layer that blocks multi-statement inputs. Combined with read-only sessions and a whitelist of SELECT, EXPLAIN, and SHOW commands, this mechanism ensures only one safe, validated query runs at a time.

What are the limitations of using read-only sessions for PostgreSQL data discovery?

The limitations of read-only sessions for PostgreSQL data discovery include the inability to perform write operations, execute multi-statement queries, or bypass per-query timeouts. Additionally, a result cap is enforced to prevent large outputs, restricting bulk data extraction.