postgresql-cli
PostgreSQL interactive terminal (psql) reference and usage guide. Use this skill whenever the user mentions psql, PostgreSQL command-line client, backslash commands, meta-commands, \d commands, database inspection, SQL scripting in PostgreSQL, importing/exporting data with psql, \copy,...
npx skills add sickn33/agentic-awesome-skills --skill postgresql-cli --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
The skill instructs the agent on how to use psql for interacting with PostgreSQL, covering connection methods, object inspection commands, query execution techniques, data import/export options (including the client-side \copy), and output formatting and large object operations. It enumerates specific commands, flags, and backslash/meta-commands the agent can employ to perform typical database tasks.
How it works
It provides explicit procedures and command examples to:
- Verify and establish a psql connection using CLI flags, environment variables, service files, or connection URIs.
- Inspect database objects with the \d family of commands and their modifiers, detailing what each command shows (tables, views, data types, etc.).
- Execute queries and control the result display using \g, \watch, \crosstabview, and related data-output options.
- Perform data import/export with server-side COPY or client-side \copy, including handling of CSV formats and NULLs, and notes on security considerations like using ~/.pgpass.
- Manage output formatting settings and large objects (\lo_ commands).
- Use scripting and control flow features such as \i for file inclusion.
When to use it
Use when the user references psql, PostgreSQL command-line client, backslash commands, meta-commands, \d commands, database inspection, SQL scripting in PostgreSQL, importing/exporting data with psql, or the \copy utility.
What it can touch
The skill references and relies on tools/commands such as: "psql", backslash commands like "\d", and client-side commands like "\copy". It also mentions environment variables and file paths (e.g., ~/.pgpass) for authentication and file handling. (Note: The review describes the commands and their usage; it does not execute them.)
Caveats
It notes security considerations, such as the visibility of passwords in shell history/process listings and recommends using ~/.pgpass for production. It also warns that the server-side COPY requires superuser privileges for file access and highlights potential command injection when using the program option in \copy FROM/TO with untrusted data.
# psql — PostgreSQL Interactive Terminal psql is PostgreSQL's feature-rich interactive terminal. It lets you write and execute queries, inspect database objects, import/export data, script batch operations, and customize output formatting — all from the command line. ## Prerequisites Before using psql, verify it is installed and available: ```bash # Check if psql is installed psql --version # If not found, install PostgreSQL client tools: # macOS (Homebrew) brew install libpq brew link --force libpq # Ubuntu / Debian sudo apt install postgresql-client # CentOS / RHEL sudo yum install postgresql # Alpine apk add postgresql-client # Windows — install PostgreSQL via the official installer or use WSL ``` psql ships as part of the `postgresql-client` package. The server (`postgresql`) is not required — you only need the client to connect to a remote PostgreSQL instance. ## Quick Reference ### Connecting ``` # 1. CLI flags psql -h host -p port -U user -d dbname # 2. Connection URI # WARNING: Password in URI is visible in shell history and process listings. # Prefer ~/.pgpass for production use (see method 4 below). psql "postgresql://user:YOUR_PASSWORD@host:port/dbname" # 3. Environment
- Prerequisites
- Quick Reference
- Connecting
- Object Inspection (\d family)
- Query Execution
- Data Import/Export
- Output Formatting
- Large Objects
- Scripting & Control Flow
- Session Management
- Pipeline Mode (PostgreSQL 14+)
- \watch Syntax
- Exit Codes
- Security Considerations
Check if psql is installed psql --version If not found, install PostgreSQL client tools: macOS (Homebrew) brew install libpq brew link --force libpq Ubuntu / Debian sudo apt install postgresql-client CentOS / RHEL sudo yum install postgresql
What does the postgresql-cli skill do?
PostgreSQL interactive terminal (psql) reference and usage guide. Use this skill whenever the user mentions psql, PostgreSQL command-line client, backslash commands, meta-commands, \d commands, database inspection, SQL scripting in PostgreSQL, importing/exporting data with psql, \copy,...
How do I install it?
Run `npx skills add sickn33/agentic-awesome-skills --skill postgresql-cli --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From sickn33/agentic-awesome-skills, a repository with 44,414 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.