query-postgres

Inspect PostgreSQL database schemas, tables, keys, and run read-only queries.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill helps DevOps and data engineers quickly understand database structures by listing schemas, tables, and keys, and by running safe read-only queries against PostgreSQL databases.

Core Features & Use Cases

  • Inspect schemas and metadata: view databases, schemas, tables, columns, primary keys, indexes, and foreign keys.
  • Execute read-only queries: run SQL statements and receive results in table or JSON formats for rapid analysis.
  • Use cases span development, testing, and production readiness tasks such as schema discovery, data validation, and ad-hoc data exploration.

Quick Start

Connect to a PostgreSQL database and list its schema objects or run a sample read-only query.

Frequently Asked Questions about query-postgres

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

FAQPage Schema
How do I inspect a PostgreSQL database schema and list its tables?

Inspect a PostgreSQL database schema by connecting via a read-only psycopg2 connection to list databases, schemas, tables, columns, primary keys, indexes, and foreign keys for structural discovery.

Can I run read-only SQL queries against a PostgreSQL database for ad-hoc analysis?

You can run read-only SQL queries against PostgreSQL databases and receive results in table or JSON formats, enabling safe ad-hoc data exploration across development, staging, and production environments.

Do I need a specific Python version or driver to query PostgreSQL schemas?

Querying PostgreSQL schemas requires Python 3 and the psycopg2 driver, connecting through either an individual connection parameters setup or a direct connection string.

What's the best way to safely explore a production PostgreSQL database without risking data modification?

Safely explore production PostgreSQL databases by using a read-only connection that restricts actions to schema inspection and SQL querying, preventing any unintended data modifications.

What metadata can I retrieve when inspecting PostgreSQL schemas?

Inspecting PostgreSQL schemas retrieves structural metadata including databases, schemas, tables, columns, primary keys, indexes, and foreign keys to help you understand database organization.

Are there limitations when using read-only queries for PostgreSQL schema inspection?

Read-only queries limit PostgreSQL inspection to data retrieval and schema discovery, preventing any write operations, schema modifications, or database administration tasks during exploration.