postgres

Executes read-only SQL queries on configured PostgreSQL databases with schema exploration support.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill allows you to safely execute read-only SQL queries against multiple PostgreSQL databases, making data exploration and retrieval efficient and secure.

Core Features & Use Cases

  • Read-only Access: Ensures no data modification by enforcing read-only sessions.
  • Multiple Database Support: Connect to and query various PostgreSQL databases using a configuration file.
  • Schema and Table Exploration: Easily list tables and view database schemas.
  • Safe Query Execution: Validates queries to allow only SELECT, SHOW, EXPLAIN, and WITH statements, preventing multi-statement attacks.
  • Use Case: You need to find the total number of users in the production database. Use this skill to query the 'users' table and get the count.

Quick Start

Use the postgres skill to list all tables in the 'production' database.

Frequently Asked Questions about postgres

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

FAQPage Schema
How do I safely run read-only SQL queries against a PostgreSQL database?

Use a Skill that enforces read-only sessions, validates statements to allow only SELECT, SHOW, EXPLAIN, and WITH commands, and prevents multi-statement execution to safely query a PostgreSQL database without risking data modification.

Can I explore database schemas and list tables in PostgreSQL without modifying data?

Yes, you can explore database schemas and list tables in PostgreSQL without modifying data by executing queries through a read-only session that restricts all write operations and enforces single-statement execution.

Does querying PostgreSQL with Python require installing additional dependencies?

Querying PostgreSQL with Python requires installing the psycopg2-binary dependency to establish database connectivity and execute SQL queries safely through the configured read-only sessions.

What SQL statements are allowed when executing read-only queries in PostgreSQL?

When executing read-only queries in PostgreSQL, only SELECT, SHOW, EXPLAIN, and WITH statements are allowed. The query validation process rejects multi-statement attacks and enforces single-statement execution.

How do I configure connections to query multiple PostgreSQL databases at once?

To query multiple PostgreSQL databases, you configure connections using a configuration file that allows you to connect to and query various databases safely while enforcing timeouts and memory caps.

What are the limitations of using a read-only PostgreSQL query tool?

Limitations of using a read-only PostgreSQL query tool include the inability to modify data, execute INSERT or UPDATE statements, run multiple statements in a single query, and exceed configured query timeouts or memory caps.