All notable changes to this project will be documented in this file.
- Checkpoint Verdict False Positive: The Checkpoints readout no longer recommends raising
max_wal_sizeon low-write systems. The old rule keyed on therequested-checkpoint share alone, butrequestedcheckpoints also come from manualCHECKPOINT,CREATE/DROP DATABASE, base backups, and forced WAL-segment switches — so a quiet node flushing ~0.1 MB per checkpoint was wrongly told to raisemax_wal_size(which had no effect). The verdict now keys on checkpoint frequency vscheckpoint_timeoutgated by MB written per checkpoint, and only mentionsmax_wal_sizewhen checkpoints are both frequent and flushing real I/O. - Checkpoint Interval With 0 Timed: The interval is now computed from the total checkpoint count (
timed + requested) instead oftimedalone, so low-write systems (where scheduled checkpoints are skipped andtimedcan be 0) show the real ~cadence instead of-.
- Lagging/Stalled Checkpointer Detection: The readout now reads the last checkpoint age from
pg_control_checkpoint()and surfaces a red verdict when no checkpoint has completed in well overcheckpoint_timeout, or when an average checkpoint overruns a whole cycle while doing real I/O — the genuinely dangerous condition (a restart in this state can force very long WAL replay). Executingpg_control_checkpoint()needspg_monitor/superuser; a less-privileged role still gets the rest of the readout. - Last Checkpoint Age: A new
Last ckptline shows how long ago the last checkpoint (or restartpoint) completed. - WAL Throughput & Sizing Context: New
WAL(generation rate + total sincepg_stat_walreset) andSegment(wal_segment_size+min_wal_size) lines make it obvious when WAL pressure cannot be the trigger (e.g. tiny write rate, large segments forcing checkpoints). - Standby-Aware Wording: On a standby (
pg_is_in_recovery()), the verdict describes restartpoints instead of checkpoints.
- Verdict Priorities: Reordered by operational severity — lagging/stalled and timeout-overrunning checkpointers are red, checkpoint frequency is a yellow advisory (short write bursts are normal, and PostgreSQL 18 removed
checkpoint_warning), and the readout never recommends changingcheckpoint_timeout(an availability/RTO trade-off, not a throughput knob).
- Checkpoint Readout: The Activity chart panel has a new
Checkpointsview (cycle withm) — a text readout (no graph, since checkpoints are rare events) showing the checkpoint interval, timed-vs-requested split, I/O per checkpoint (MB written, write/sync time), themax_wal_size/checkpoint_timeout/completion_targetsettings, and an operator verdict (Healthy / raisemax_wal_size/ slowfsync). Readspg_stat_checkpointeron PostgreSQL 17+ andpg_stat_bgwriteron 14–16. - All Sessions Subview: The Activity view now has an unfiltered
A:Allsubview that lists every session, including plainidleconnections, so you can see who is holding connection slots (e.g. a pool). The default subview remainsa:Active. - Active Subview Highlight: The Activity sessions panel now highlights the selected subview filter (
A:All/a:Active/w:Waiting/b:Blocking/t:IdleInTxn) in its accent color so the active one is easy to identify. - Devcontainer: Added a compose-based DevPod devcontainer (app + always-on PostgreSQL 18) with a mise-managed toolchain (
just,psql,psycopg2,pg_activity),dev-up/dev-sshscripts, and ajust loadrecipe for runningpgload.py.
- Display Limit Defaults To All: The
-n, --top-nrow limit now defaults to0("All", no truncation); pass a value of1–100to cap the rows shown. - Activity Color Alignment:
idle in transaction (aborted)sessions now use a distinct color from plainidle in transaction, aligning withpg_activity(aborted-in-transaction is the riskiest idle state). - sqlx 0.9: Upgraded sqlx from 0.8 to 0.9, wrapping dynamically-built queries in
AssertSqlSafefor the newSqlSafeStrAPI.
- Safe Explain From Both Query Info Flows:
xnow runs planner-only explain from bothActivityandStatements, with generic estimated plans for normalizedpg_stat_statementsSQL on PostgreSQL 16+. auto_explainGuidance: Query info and explain modals now show whetherauto_explainis loaded or enabled for the inspected database, plus concise guidance for collecting real execution plans in PostgreSQL logs.- Explain Safety Test Hook: Added opt-in live PostgreSQL explain-safety tests via
PGMON_TEST_DSN/just test-explain-safety. - Explain Safety CI Coverage: Added GitHub Actions coverage for the live explain-safety path against PostgreSQL 16+ so generic-plan validation is exercised outside local container setups.
- Missing-Index Demo Workload:
pgload.pynow creates largerpgload_accounts,pgload_orders, andpgload_audit_logtables, periodically reports whether the expected demo indexes are actually present or missing, and emits a few tagged long SQL samples for layout testing.
- Non-Executing Diagnosis: Replaced in-app
EXPLAIN ANALYZEwith safe estimated planning modes so query diagnosis no longer executes the inspected SQL. - Explain Safety Guardrails: Explain now uses PostgreSQL-parser validation to only accept single
SELECT/INSERT/UPDATE/DELETE/MERGEstatements, rejects utility/session statements before they reach PostgreSQL, and avoidsGENERIC_PLANon PostgreSQL 14/15. - Parameterized INSERT Classification: Fixed explain-mode detection for
INSERT ... VALUES ($1, $2)and similar parameterized DML so PostgreSQL 16+ usesGENERIC_PLANinstead of failing validation after parsing. - Footer Controls: Standardized the
i:Infolabel, removed redundant1-8:Tabshints, and dropped the inline query preview so theControlsfooter stays consistent while navigating rows. pgload.pyStability: Fixed setup SQL placeholder parsing with psycopg2, scratch-table sequence collisions, and deadlock cleanup so the demo loader starts cleanly and runs without accumulating errors.
- PostgreSQL Support Floor: pgmon now explicitly targets PostgreSQL 14+.
- Database Layer: Replaced the synchronous
postgresclient path with a sharedtokio+sqlxruntime and pooled connection handling to align the codebase with the project's newer Rust/PostgreSQL stack. - Query Inspection UX: Updated the query modals and README to emphasize planner-only diagnosis, parameterized-query caveats, version-aware generic-plan limits, and the fresh-session limitations of in-app explain output.
- Expanded Theme Support: Improved the theme engine to customize more UI elements including table headers, row highlight colors (foreground and background), and chart line colors.
- Rich Built-in Themes: Updated all built-in themes (
calibrachoa,sky,mint,retro) to provide a fully themed experience across all views. - Themed UI Accents: Keybinding labels in the footer and active tab highlights now dynamically follow the active theme's accent colors.
- Strict Linting Compliance: Fixed multiple Clippy warnings related to unnecessary casts and collapsible match arms, ensuring 100% compliance with strict pedantic rules.
- Code Organization: Refactored theme definitions and session rendering into smaller, more maintainable functions to meet clean code standards.
- Formatting: Standardized the entire codebase with
cargo fmt.
- Deep Activity Diagnostics: Pressing
iin the Activity view now shows extended details including exact wait events (ClientRead,Lock, etc.), transaction start times, and state change timestamps. - Blocking Chain Visibility: The Activity detail view now explicitly lists sessions that are being blocked by the selected PID, including their queries, state, and wait durations.
- "Waiting on PIDs" Detection: Sessions that are waiting for other transactions now display the specific blocker PIDs in the detail view, enabling rapid tracing of locking bottlenecks.
- Lock Inspection: Added a dedicated section in the Activity detail modal to list all locks currently held by the session and the relations they apply to.
- Direct Session Termination: Added
K(capital K) shortcut within the Activity detail modal to immediately terminate the inspected session with a secure confirmation workflow. - Activity Visual Alerts: Implemented functional color-coding in the main Activity list to make issues "glanceable":
- Red: Blocked sessions (Critical bottleneck).
- Magenta: Blocking sessions (Root cause of contention).
- Cyan: Idle in transaction (Potential risk).
- Bold Red Time: Long-running sessions (> 5 minutes).
- UX Refinement: Removed the "Theme switched" notice message to keep the UI clean, as the color change provides immediate feedback.
- Diagnostics Tooling: Upgraded
pgload.pyto support advanced row-level locking, blocking chain simulation, and periodic deadlock generation for robust TUI testing.
- Configuration & Validation: Added
pgmon.yaml/pgmon.ymlsupport for aliases, default connections, export defaults, custom themes, and a newpgmon check-configcommand to validate config loading and connection resolution without starting the TUI. - Themes: Added built-in themes (
calibrachoa,sky,mint,retro) plus runtime theme switching from inside the TUI. - Contextual Help Overlay: Added
?to open per-view in-app help with shortcuts, metric definitions, and capability/Explain limitations. - Database Admin Actions: Added context-aware
VACUUM ANALYZE,REINDEX, and table-definition inspection from the Database tree view. - Activity Chart Switching: Added
mto cycle the Activity chart between Connections, TPS, DML/s, Temp Bytes/s, and Growth Bytes/s.
- Explain Availability: Restricted
EXPLAIN (ANALYZE, BUFFERS)to query inspection opened fromActivity, and prevented execution for normalized SQL without literal values. - Statements and Export UX: Removed unavailable actions from views where they created noise, including
ExplainfromStatementsand export from non-primary views. - Replication Empty State: Reworked the Replication view to show a clear capability/status panel instead of misaligned empty panels when replication is not enabled.
- Reconnect Behavior: Kept the last successful data on screen after transient refresh failures, added retry backoff, and preserved a manual reconnect path.
- Capability Messaging: Replaced synthetic placeholder rows with explicit availability panels for
pg_stat_statements,pg_stat_io, and replication features.
- Activity Summary & Footer Layout: Simplified the Activity summary metadata row and reduced footer duplication so connection identity, offline state, and slow-link signals are easier to scan.
- Connection Workflow: Added alias-based startup, explicit config-path loading, default-connection fallback, and support for both
.yamland.ymlconfig discovery. - Documentation Refresh: Expanded the README to cover config aliases, themes,
check-config, contextual help, chart metrics, and current query-inspection behavior.
- New Replication View (shortcut 8): Added a dedicated read-only replication dashboard showing WAL senders, standby receiver status, and replication slot state.
- Statements Sorting Contract: Aligned the CLI and runtime behavior so
--sortnow consistently supportstotal_time,mean_time, andcalls. - Waiting Session Accuracy: Corrected Activity waiting counts so blocking sessions are no longer misreported as waiting.
- Replica Query Labels: Replaced raw
START_REPLICATION SLOT ...activity text with compact replica labels across Activity previews. - PostgreSQL Compatibility: Extended
pg_stat_statementscompatibility to tolerate installations where block timing columns are absent while still supporting newer timing column names.
- Default Statements Sort: Changed the default statements sort mode to
total_time. - Documentation Cleanup: Removed stale references to the unimplemented
g/interestingActivity subview and updated keybinding/docs for the Replication tab.
- New Tools View (shortcut 6): Integrated administrative actions like terminating idle sessions, canceling long-running queries, and resetting statistics with a secure confirmation workflow.
- New Settings View (shortcut 7): Full scrollable access to every PostgreSQL configuration parameter (
pg_settings) organized by category. - Fuzzy Search (shortcut /): Real-time subsequence matching for all tables, allowing quick navigation (e.g., searching
mxconformax_connections). - Dynamic Refresh Interval (shortcut r): Interactive modal to change monitoring frequency (0.5s to 10s) on the fly.
- Dynamic Top-N Limit (shortcut n): Toggle display limits between 10, 20, 50, 100, or All rows.
- Vim Motion Support: Added standard
jandkkeys for navigating all tables and session lists. - Enhanced Visuals: Implemented a consistent "Identity-White / Metric-Gray" aesthetic across all views with functional color-coding (Red/Yellow/Green) for critical performance indicators.
- Blocking Chain Detection: The Locks view now identifies blocking vs. blocked PIDs and calculates wait durations.
- Postgres Version Compatibility: Automatically detect and support different
pg_stat_statementscolumn names (handling the v12 vs v13+ naming changes). - PostgreSQL Connection Reuse: Refactored background worker to reuse client connections, drastically reducing network and database overhead.
- Robust DSN Parsing: Fixed summarization of connection strings containing query parameters or quoted values with spaces.
- Client IP Formatting: Correctly extract host addresses from
inettypes without network masks. - TUI Navigation: Standardized row selection and fixed bugs where navigation keys would become non-functional in certain views.
- Modal Layout: Redesigned popups to handle massive SQL statements and high-resolution screens without hiding action hints.
- Architectural Refactoring: Split monolithic files into a clean, modular directory structure (
src/tui/app/andsrc/tui/ui/) for easier maintenance. - Symmetrical Activity Layout: Reorganized the Activity Summary into a balanced 2x2 grid for better scanability.
- Restored Unit Tests: Fully recovered and expanded the unit test suite to 19 tests, covering core logic and data shaping.