pgedge-psql

Query and modify PostgreSQL databases via psql with compact CSV outputs.

1|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/pgEdge/pgedge-skills --skill pgedge-psql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pgedge-psql
Source: https://github.com/pgEdge/pgedge-skills/tree/main/skills/pgedge-psql
Command: npx skills add https://github.com/pgEdge/pgedge-skills --skill pgedge-psql

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Efficiently and safely interact with PostgreSQL databases using the psql command-line tool, focusing on token-efficient outputs, schema discovery, and safe write practices.

Core Features & Use Cases

  • Compact output: default to CSV and tuples-only (-t) to minimize tokens.
  • Schema-first workflow: discover schemas, list tables, describe columns, and inspect indexes before writing.
  • Safe write patterns: use transactions, begin/read-only wrappers, explicit confirmations, and rollback capability to prevent unintended changes.
  • Use Case: quickly analyze a new database by enumerating structure and validating queries with minimal data exposure.

Quick Start

Connect to a PostgreSQL database with psql and ask for a quick schema discovery.

Frequently Asked Questions about pgedge-psql

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

FAQPage Schema
How do I safely explore a PostgreSQL schema using psql?

To explore a PostgreSQL schema safely, psql defaults to read-only mode and requires discovering tables, columns, and indexes before executing any write operations. This prevents unintended changes while inspecting the database structure.

What is the best way to run psql queries with minimal token output?

The best way to run psql queries with minimal output is using tuples-only and CSV format defaults. This compact approach minimizes token usage during database exploration and routine query execution.

How do I prevent accidental data modifications when running PostgreSQL DDL statements?

Preventing accidental data modifications requires explicit write confirmations and transactional safety wrappers in PostgreSQL. The psql workflow uses rollback capabilities and read-only defaults to secure DDL statements.

Can I insert and update data in PostgreSQL through psql safely?

Yes, you can insert and update data safely by enforcing a discover-before-write workflow with psql. Explicit confirmations and transaction wrappers ensure that data modifications are intentional and reversible.

How do I inspect indexes and describe columns in a PostgreSQL database?

Inspecting indexes and describing columns requires executing schema discovery commands via psql. This process enumerates the database structure, listing tables and column details before attempting any data interactions.