postgres

Query PostgreSQL databases read-only via psql for schema introspection and EXPLAIN plans.

2|Updated Feb 10, 2026
One-click install
npx skills add https://github.com/dversoza/claude-skills --skill postgres-dversoza
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres
Source: https://github.com/dversoza/claude-skills/tree/main/postgres
Command: npx skills add https://github.com/dversoza/claude-skills --skill postgres-dversoza

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides secure, read-only access to PostgreSQL databases, allowing you to query data, inspect schemas, and analyze query plans without the risk of accidental data modification.

Core Features & Use Cases

  • Read-Only Access: Enforces default_transaction_read_only=on at the PostgreSQL session level, preventing writes and DDL.
  • Database Introspection: Easily list schemas, tables, columns, and indexes.
  • Query Execution & Planning: Run SQL queries and generate EXPLAIN plans for performance analysis.
  • Use Case: You need to check the number of users in the users table of your staging database.

Quick Start

Use the postgres skill to list all tables in the public schema of the staging database.

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 database auditing?

Read-only PostgreSQL queries are enforced by setting default_transaction_read_only=on at the session level, preventing accidental writes and DDL while allowing schema introspection and data retrieval.

How do I introspect a PostgreSQL database schema to list tables and columns?

PostgreSQL database schema introspection lets you list schemas, tables, columns, and indexes using the psql client, provided database connection URIs are configured in your environment.

What's the best way to analyze PostgreSQL query plans for performance tuning?

PostgreSQL query plan analysis generates EXPLAIN plans through the psql client, enabling performance evaluation for development and auditing tasks within a secure read-only session.

Do I need psql installed to query a PostgreSQL database with this approach?

Yes, the psql client must be installed locally, and database connection URIs must be configured in CLAUDE.local.md to establish secure read-only PostgreSQL database access.

Can I modify data or run DDL statements during a read-only PostgreSQL session?

No, read-only PostgreSQL sessions enforce default_transaction_read_only=on at the session level, which blocks all write operations and DDL statements to prevent accidental data modification.

How do I configure database connection URIs for PostgreSQL access?

Database connection URIs for PostgreSQL access are configured in the CLAUDE.local.md file, which the psql client reads to establish a secure read-only session for querying and introspection.