postgresql-psql

Connect to PostgreSQL databases and execute SQL queries via psql.

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/brixtonpham/claude-config --skill postgresql-psql-brixtonpham
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql-psql
Source: https://github.com/brixtonpham/claude-config/tree/main/skills/postgresql-psql
Command: npx skills add https://github.com/brixtonpham/claude-config --skill postgresql-psql-brixtonpham

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL teams often rely on a mix of GUIs and ad-hoc commands to manage databases, and this skill consolidates authoritative guidance for using the psql CLI to connect, query, and administer PostgreSQL from a single, consistent source.

Core Features & Use Cases

  • Comprehensive coverage of connection options, meta-commands, and command-line flags
  • Scripting and automation patterns for maintenance, backups, and data retrieval
  • Real-world usage scenarios for daily admin tasks, development workflows, and troubleshooting

Quick Start

Install the psql client, open a terminal, and run a basic query to verify connectivity.

Frequently Asked Questions about postgresql-psql

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

FAQPage Schema
How do I connect to a PostgreSQL database using psql over an SSH tunnel or with SSL?

To connect to PostgreSQL via psql, use command-line flags specifying the host, port, and user, with SSL options for encrypted connections or SSH-tunneled endpoints for remote database administration and querying.

What are psql meta-commands and how do they help with PostgreSQL administration on the CLI?

Psql meta-commands are backslash-prefixed shortcuts for database object administration, providing quick access to inspect schemas, manage users and permissions, and gather performance insights without writing full SQL queries.

How do I automate PostgreSQL database backups and data retrieval scripts with psql?

Automate PostgreSQL backups and data retrieval by scripting psql commands in shell loops, leveraging file I/O meta-commands and command-line flags to execute SQL queries and transaction control blocks unattended.

Can I control transaction blocks and output formatting when running SQL queries in psql?

Yes, psql supports transaction control commands like BEGIN and COMMIT alongside extensive output formatting options, allowing you to customize query result display for command-line workflows and file export.

Does psql CLI work for both local development and remote PostgreSQL operations?

Psql CLI handles both local development and remote PostgreSQL operations, supporting connection handling across local sockets, remote hosts, SSL-encrypted endpoints, and SSH-tunneled sessions for database administration.

What's the best way to troubleshoot PostgreSQL performance issues from the command line?

Troubleshoot PostgreSQL performance from the command line by running psql meta-commands and SQL queries to gather performance insights, inspect database objects, and analyze query execution plans for operations.