pgtc — Postgres terminal commander

A PostgreSQL administration and query tool for the terminal — locally or over SSH, on Linux, Windows and macOS. Midnight Commander's look and keys, pgAdmin's functions.

pgtc: the object tree on the left, a query tab with its result on the right
Object tree and a query tab. Click a picture to enlarge it.

Chapters

Object treeThe cluster's objects, read lazily from the system catalogs; find by name. DefinitionsDDL of the selected object, reconstructed from the catalogs. Query tabsOne session per tab: streamed result sets, messages, cancel, transaction control, PL/pgSQL mode. EditorHighlighting, find / replace, undo, autocomplete from the catalogs. Files and exportSQL files; result sets to CSV, JSON or XML. psql-style commandsdt, d table, df…, and generators of DML, triggers and views for a table. Developer templatesA form per template; the rendered DDL goes to the cursor. Template editorParameters, Jinja helpers, live preview, test. AI assistantSQL written by a model that is given the schema, never the data. Nothing is executed. Schema syncExport a schema to a .pgdef file; generate the DDL that brings another database to it. DashboardActivity, blocking, progress views, locks; cancel or terminate backends. SQL profilerEvery statement the cluster executes, from the server log. Database statisticspg_stat_database for one database. SettingsOptions, colour schemes, keymap.

Using this help

Supported servers and terminals