You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Team,
I have been working on some features for my daily work in my own fork, ofc (DiegoDAF/pgcli.daf), and maybe you want them.
Happy to open a PR for any of them. Just pick a number, and I will open the PR:
SSH/connectivity
pgcli_dump and pgcli_dumpall: wrappers around pg_dump / pg_dumpall that auto-open the same SSH tunnel pgcli uses, so backups work through bastions transparently.
pgcli_isready: a pg_isready wrapper that is SSH-tunnel aware.
Native paramiko SSH tunnels (replacing the sshtunnel lib): reads IdentityFile from ~/.ssh/config, supports ProxyCommand, configurable host key verification (host_key_policy), and allow_agent.
Config in directories (drop-in files)
5. dsn.d/: DSN aliases as individual *.conf files instead of one big section. 6. namedqueries.d/: named queries as individual files.
6. Server-versioned named queries (namedqueries.d, psqlrc-style). Files in namedqueries.d/ can carry a version suffix in the filename, like psql's ~/.psqlrc-17: activity-17.conf is only offered when the connected server is 17+, and among variants of one query name the highest version <= the server wins (a suffix-less file is the fallback). Queries whose requirements the server doesn't meet disappear from \n entirely. The server version comes from the connection's startup packet, so there's no extra round-trip.
Non-interactive / scripting
7. -c/--command and -f/--file: run SQL or a file and exit (repeatable). Open as #1542 (-c) and #1543 (-f).
8. -o/--output: redirect results to a file.
9. -y/--yes: skip destructive-query confirmations. Open as #1544.
10. -t/--tuples-only: rows only, no headers/status. Open as #1545.
11. --no-timings and --no-status: quieter output for scripts.
Autocompletion
13. SET <param> completion from live pg_settings.
14. SET ROLE <role> completion.
Output
15. Streaming NOTICE output: VACUUM VERBOSE, ANALYZE VERBOSE, REINDEX, etc. print server NOTICEs line by line as they arrive instead of buffering until the end.
22. stream_results config option: print each statement's result as soon as it finishes instead of buffering all of them until the end. Pasting several statements (select a; select b; select c;) shows each result live as its statement completes, similar to psql/pgAdmin. Off by default.
Safety
16. \restrict / \unrestrict support and blocking.
17. Password and path sanitization in logs.
Others
18. EXPLAIN analysis summary. With explain mode (F5) on, the plan tree is followed by a compact summary: slowest nodes by exclusive time, time grouped by relation, and the worst planner row-estimate misses. Inspired by pgAdmin's graphical explain. Config explain_summary, default off.
Query-tool niceties:\autocommit [on|off] (manual-transaction mode with a toolbar indicator), \hist [N] (this session's SQL with elapsed time and ok/error), and an F9 binding that runs only the selected text.
psql-style paste mode (paste_mode + F6): pasting a multi-statement block echoes each statement followed by its result, interleaved, like psql.
log_truncate_on_rotation (default off), like the PostgreSQL setting: with day-of-week/day-of-month log rotation, a slot's file is truncated when it comes around again instead of appending forever.
Connection
23. --timeout command line option and a connect_timeout config default (30s). pgcli currently inherits libpq's default of 0, so an unreachable host hangs until the OS gives up on the TCP connection. Precedence: --timeout, then the connection string, then $PGCONNECT_TIMEOUT, then the config value. Open as #1622.
Status (updated 2026-08-19)
Merged so far: #4 (.pgpass through SSH tunnels, #1546) and \ne to edit a named query in the external editor (#1609, which was not on this list).
While maintaining the fork I also ran into three things that are plain bugs in upstream rather than features of mine, so I sent them separately. They are not items on this list:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi Team,
I have been working on some features for my daily work in my own fork, ofc (DiegoDAF/pgcli.daf), and maybe you want them.
Happy to open a PR for any of them. Just pick a number, and I will open the PR:
SSH/connectivity
pgcli_dumpandpgcli_dumpall: wrappers aroundpg_dump/pg_dumpallthat auto-open the same SSH tunnel pgcli uses, so backups work through bastions transparently.pgcli_isready: apg_isreadywrapper that is SSH-tunnel aware.paramikoSSH tunnels (replacing thesshtunnellib): readsIdentityFilefrom~/.ssh/config, supportsProxyCommand, configurable host key verification (host_key_policy), andallow_agent..pgpassworks through SSH tunnels (original host preserved for lookup,hostaddrused for the actual connection). Merged in Enable .pgpass support for SSH tunnel connections #1546.Config in directories (drop-in files)
5.
dsn.d/: DSN aliases as individual*.conffiles instead of one big section.6.namedqueries.d/: named queries as individual files.6. Server-versioned named queries (
namedqueries.d, psqlrc-style). Files innamedqueries.d/can carry a version suffix in the filename, like psql's~/.psqlrc-17:activity-17.confis only offered when the connected server is 17+, and among variants of one query name the highest version <= the server wins (a suffix-less file is the fallback). Queries whose requirements the server doesn't meet disappear from\nentirely. The server version comes from the connection's startup packet, so there's no extra round-trip.Non-interactive / scripting
7.
-c/--commandand-f/--file: run SQL or a file and exit (repeatable). Open as #1542 (-c) and #1543 (-f).8.
-o/--output: redirect results to a file.9.
-y/--yes: skip destructive-query confirmations. Open as #1544.10.
-t/--tuples-only: rows only, no headers/status. Open as #1545.11.
--no-timingsand--no-status: quieter output for scripts.Logging
12.
log_rotation_mode(none / day-of-week / day-of-month / date) andlog_destination.Autocompletion
13.
SET <param>completion from livepg_settings.14.
SET ROLE <role>completion.Output
15. Streaming NOTICE output:
VACUUM VERBOSE,ANALYZE VERBOSE,REINDEX, etc. print server NOTICEs line by line as they arrive instead of buffering until the end.22.
stream_resultsconfig option: print each statement's result as soon as it finishes instead of buffering all of them until the end. Pasting several statements (select a; select b; select c;) shows each result live as its statement completes, similar to psql/pgAdmin. Off by default.Safety
16.
\restrict/\unrestrictsupport and blocking.17. Password and path sanitization in logs.
Others
18. EXPLAIN analysis summary. With explain mode (F5) on, the plan tree is followed by a compact summary: slowest nodes by exclusive time, time grouped by relation, and the worst planner row-estimate misses. Inspired by pgAdmin's graphical explain. Config
explain_summary, default off.Query-tool niceties:
\autocommit [on|off](manual-transaction mode with a toolbar indicator),\hist [N](this session's SQL with elapsed time and ok/error), and an F9 binding that runs only the selected text.psql-style paste mode (
paste_mode+ F6): pasting a multi-statement block echoes each statement followed by its result, interleaved, like psql.log_truncate_on_rotation(default off), like the PostgreSQL setting: with day-of-week/day-of-month log rotation, a slot's file is truncated when it comes around again instead of appending forever.Connection
23.
--timeoutcommand line option and aconnect_timeoutconfig default (30s). pgcli currently inherits libpq's default of 0, so an unreachable host hangs until the OS gives up on the TCP connection. Precedence:--timeout, then the connection string, then$PGCONNECT_TIMEOUT, then the config value. Open as #1622.Status (updated 2026-08-19)
Merged so far: #4 (
.pgpassthrough SSH tunnels, #1546) and\neto edit a named query in the external editor (#1609, which was not on this list).Currently open from this list: #7 as #1542 + #1543, #9 as #1544, #10 as #1545, #23 as #1622.
While maintaining the fork I also ran into three things that are plain bugs in upstream rather than features of mine, so I sent them separately. They are not items on this list:
edit sql in file with external editorscenario errors intermittently on CI (2 secondexpect_exact), which then fail-fast cancels the rest of the matrix.EXPLAIN (...)prefix and is sent as SQL, so\q,\d,exitand friends fail and there is no way to leave the session.-l/--listand--pingdiscard a connection string, falling back to a local socket connection as the OS user.(Numbering note 2: item 23 was added on 2026-08-19.)
Still happy to open a PR for any numbered item above, one at a time. Just pick a number.
(Numbering note: there were two items numbered 18; the
stream_resultsone is now 22 so the numbers are unique.)All reactions