All notable changes to this project will be documented in this file.
- 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.