Releases: DiegoDAF/pgcli.daf
Releases · DiegoDAF/pgcli.daf
v4.4.4
Features
- SET autocomplete with pg_settings — Typing
SETand pressing TAB now suggests PostgreSQL runtime parameters likestatement_timeout,work_mem,search_path, etc. Parameters are queried live from the connected server (pg_catalog.pg_settings). Neither pgAdmin nor upstream pgcli have this feature.
Full changelog since v4.4.3
See changelog.rst for the complete history.
pgcli.daf v4.4.2 (upstream: 4.4.0)
Changes since v4.3.13
This release includes all changes from v4.3.15 through v4.4.2.
Upstream Compatibility
Compatible with upstream pgcli 4.4.0 — includes all upstream features plus pgcli.daf exclusives.
v4.4.2 (2026-03-02)
Bug Fixes
- Fix trailing SQL comments causing query execution failure.
vacuum freeze verbose t; -- 82% towards emergencynow works correctlyrstrip(";")failed when a comment followed the semicolon- Comments are now stripped before semicolon removal in
pgexecute.py
- Fix multiline mode not submitting queries with trailing comments.
_is_complete()inpgbuffer.pynow strips comments before checking for a trailing semicolon- Previously
SELECT 1; -- notewould never submit in multiline mode
v4.4.1 (2026-02-24)
Features
- Add
pgcli_isreadycommand —pg_isreadywrapper with SSH tunnel support. - Complete
\restrictmeta-command blocking (CVE-2025-8714). - Migrate SSH tunnel from
sshtunnelto native Paramiko.- Eliminates dependency on unmaintained
sshtunnellibrary - Allows
paramiko >= 3.0without upper version bound (paramiko 4.x compatible) - Refactored
main.pyto useSSHTunnelManager(eliminated ~115 lines of duplicate code)
- Eliminates dependency on unmaintained
- Add
--no-timingsand--no-statusCLI flags. - Change
-t/--tuples-onlyto a pure boolean flag (fixes bug where-tconsumed next CLI argument). - Read
IdentityFilefrom~/.ssh/configfor SSH tunnel authentication. - Configurable SSH host key verification policy (
auto-add,warn,reject). - Add named query quiet mode
\nqto hide query text during execution (upstream dbcli#1551). - Add
\Tprompt escape sequence to display transaction status (upstream dbcli#1553).
Security
- Sanitize SSH tunnel passwords from debug logs.
- Mask passwords in
--list-dsnoutput. - Use
re.fullmatch()for SSH tunnel regex matching (prevents partial hostname matches). - Redact PASSWORD clauses from SQL debug logs.
- Sanitize file paths in
\i,\o, and\log-filecommands (path traversal prevention).
v4.3.17 (2026-02-13)
Features
- Add support for
\restrictand\unrestrictcommands (CVE-2025-8714).
Bug Fixes
- Fix
\npcommand autocomplete not suggesting named queries.
v4.3.16 (2026-01-20)
Bug Fixes
- Restore
dsn=uriparameter inconnect_uri()for proper.pgpasssupport.
Internal
- Fix all mypy type checking errors (136 errors resolved).
- Fix log directory creation to properly create the full path.
v4.3.15 (2026-01-20)
Features
- Add
allow_agentconfig option in[ssh tunnels]section. - Add
\nrcommand to reload named queries without restarting pgcli. - Add mypy type checking to CI pipeline and pre-commit hooks.
- Add autocomplete support for
SET ROLEcommand.
Bug Fixes
- Fix bash completion showing "includedir" instead of DSN aliases.
- Fix
.pgpasspassword lookup forpgcli_dumpandpgcli_dumpallwith SSH tunnels.
v4.3.13
Features
- Add support for organizing DSN aliases in separate files via
dsn.ddirectory - Add support for organizing named queries in separate files via
namedqueries.ddirectory - Sort named queries alphabetically in
\noutput for easier navigation
Installation
uv tool install --force "pgcli-4.3.13-py3-none-any.whl[sshtunnel]"Made with ❤️ and 🤖 Claude
pgcli v4.3.9 - First Forked version.
4.3.9 (2025-12-17)
Features:
- Add support for
init-commandto run when the connection is established.- Command line option
--init-command - Provide
init-commandin the config file - Support dsn specific init-command in the config file
- Command line option
- Add suggestion when setting the search_path
- Allow per dsn_alias ssh tunnel selection
- Add support for forcing destructive commands without confirmation.
- Command line option
-yor--yes. - Skips the destructive command confirmation prompt when enabled.
- Useful for automated scripts and CI/CD pipelines.
- Command line option
- Add support for executing SQL commands from command line.
- Command line option
-cor--commandto execute SQL and exit - Supports multiple
-coptions executed sequentially - Example:
pgcli -c "SELECT 1" -c "SELECT 2"
- Command line option
- Add support for executing SQL from files.
- Command line option
-for--fileto execute SQL from file and exit - Supports multiple files executed in order
- Example:
pgcli -f setup.sql -f data.sql
- Command line option
- Add tuples-only output mode (psql-compatible).
- Command line option
-tor--tuples-onlyto print only rows without headers/status - Supports custom format:
-t minimal,-t simple, etc. - Defaults to
csv-noheaderformat - Suppresses timing, status messages, and headers
- Command line option
- Add output file redirection (psql-compatible).
- Command line option
-oor--outputto redirect output to file - Similar to psql's
\ocommand but from command line - Validates file is writable before execution
- Example:
pgcli -o results.txt -c "SELECT * FROM users"
- Command line option
- Add log rotation support with multiple modes (inspired by PostgreSQL
log_filename).- Config option
log_rotation_mode:none(default),day-of-week,day-of-month,date - Config option
log_destination: customize log directory location - Day-of-week mode creates files like
pgcli-Mon.log, overwrites weekly - Day-of-month mode creates files like
pgcli-01.log, overwrites monthly - Date mode creates files like
pgcli-20250127.log, never overwrites - Backward compatible: defaults to single
pgcli.logfile whenlog_rotation_mode = none
- Config option
- Enable .pgpass support for SSH tunnel connections
- Preserve original hostname for .pgpass lookup when using SSH tunnels
- Use PostgreSQL's
hostaddrparameter to specify tunnel endpoint - Add SSH configuration options (ssh_config_file, allow_agent, compression)
.pgpassfile now works seamlessly with--ssh-tunneloption
Internal:
- Moderize the repository
- Use uv instead of pip
- Use github trusted publisher for pypi release
- Update dev requirements and replace requirements-dev.txt with pyproject.toml
- Use ruff instead of black
Bug fixes:
- Improve display of larger durations when passed as floats
Installation
# Install with SSH tunnel support
uv tool install 'pgcli[sshtunnel] @ https://github.com/DiegoDAF/pgcli.dev/releases/download/v4.3.9/pgcli-4.3.9-py3-none-any.whl'
# Or with pip
pip install 'pgcli[sshtunnel] @ https://github.com/DiegoDAF/pgcli.dev/releases/download/v4.3.9/pgcli-4.3.9-py3-none-any.whl'Configuration Example
Add to ~/.config/pgcli/config:
[main]
# Log rotation mode
log_rotation_mode = day-of-week
# Custom log directory (optional)
log_destination = /var/log/pgcli
# Log level
log_level = INFOWhat's Included
This release also includes all v4.3.8 features:
-c/--command- Execute SQL from CLI-f/--file- Execute SQL from file-t/--tuples-only- Print only rows without headers-o/--output- Redirect output to file-y/--yes- Skip destructive query confirmations
Testing
- 5 pytest unit tests for log rotation
- 4 behave integration tests
- Full SSH tunnel test coverage
Dependencies
paramiko >= 3.0, < 4.0(sshtunnel compatibility)sshtunnel >= 0.4.0(for SSH tunnel support)