← ClaudeAtlas

postgres-clilisted

Query and inspect PostgreSQL databases via the `psql` CLI for [Project A]/[Project B]/[Company] data needs. Use this skill whenever the user asks to "query the DB", "check schema", "run migrations", "inspect rows", "explain query", or anything that touches a Postgres connection. Replaces low-trust community Postgres MCPs. Stack-aware for Supabase, self-hosted Postgres, and cloud variants.
Xipher-Labs/walter-os · ★ 5 · API & Backend · score 67
Install: claude install-skill Xipher-Labs/walter-os
# Postgres CLI (`psql`) Direct database access via the official Postgres client. Replaces unmaintained community MCPs (low-star, single-maintainer) which were our weakest links. Mature, multi-decade-stable tooling, available everywhere. ## Setup ```bash # Already in setup/Brewfile: brew install postgresql@16 # provides psql + pg_dump + pg_restore # Verify psql --version ``` Connection strings live in **Infisical** (project-scoped) or `~/.config/walter-os/secrets.env` (operator-local). NEVER hardcode in scripts. ```bash # From Infisical (preferred for runtime) DATABASE_URL=$(infisical secrets get DATABASE_URL --raw --project [project-a]-staging) # From walter-os env (operator interactive use) source ~/.config/walter-os/secrets.env psql "$DATABASE_URL" ``` ## Common operations ### Connect ```bash psql "$DATABASE_URL" # interactive shell psql "$DATABASE_URL" -c '\dt' # one-shot command psql "$DATABASE_URL" -f script.sql ``` ### Inspect schema ```sql \dt -- list tables \dt+ -- with sizes \d users -- describe a table \d+ users -- with comments + storage \df -- list functions \du -- list roles \l -- list databases \dn -- list schemas \dx -- list extensions ``` ### Query patterns ```bash # Top 10 rows of a ta