diff --git a/Directory.Build.props b/Directory.Build.props index 126c0d0..0b4fdb5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 0.1.0-alpha.3 + 0.1.0-alpha.4 enable enable true diff --git a/README.md b/README.md index 9dbfbd8..f725e8b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ English | [Português (Brasil)](README.pt-BR.md) **The SQL Server Management Studio experience, for PostgreSQL.** A native Windows client with Object Explorer, F5 to run, execution plans, session monitoring and backup/restore, built for people who already think in SSMS. -**[Download v0.1.0-alpha.3 for Windows x64](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.3)** · Graphical installer (EN/pt-BR) or portable ZIP, .NET runtime included · Works with PostgreSQL 17 and 18 +**[Download v0.1.0-alpha.4 for Windows x64](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.4)** · Graphical installer (EN/pt-BR) or portable ZIP, .NET runtime included · Works with PostgreSQL 16–18 ![PGMS editor, Object Explorer and query results](docs/assets/pgms-results-m959.jpg) @@ -46,14 +46,14 @@ Get-FileHash .\PGMS-* -Algorithm SHA256 Compare the hashes with `SHA256SUMS.txt` in the release. Starting with v0.1.0-alpha.2 the assets are built by the [release workflow](.github/workflows/release.yml) on GitHub Actions and carry a build provenance attestation, so you can also confirm that the ZIP or installer came from that workflow and this repository (requires the [GitHub CLI](https://cli.github.com/)): ```powershell -gh attestation verify .\PGMS-0.1.0-alpha.3-Setup-x64.exe --repo leoars/PostgresManagementStudio +gh attestation verify .\PGMS-0.1.0-alpha.4-Setup-x64.exe --repo leoars/PostgresManagementStudio ``` v0.1.0-alpha.1 was built on the maintainer's machine and has checksums only. Code signing through the SignPath Foundation open source program is planned. ### Build from source -For development: Windows x64, PowerShell 7 and the .NET SDK selected by [global.json](global.json) (`10.0.400`, latest installed patch in that feature band). PostgreSQL 17/18 and matching-major tools are needed for database tests and backup/restore. +For development: Windows x64, PowerShell 7 and the .NET SDK selected by [global.json](global.json) (`10.0.400`, latest installed patch in that feature band). PostgreSQL 16–18 and matching-major tools are needed for database tests and backup/restore. ```powershell git clone https://github.com/leoars/PostgresManagementStudio.git diff --git a/README.pt-BR.md b/README.pt-BR.md index 798beae..fd94602 100644 --- a/README.pt-BR.md +++ b/README.pt-BR.md @@ -6,7 +6,7 @@ **A experiência do SQL Server Management Studio, para PostgreSQL.** Cliente nativo Windows com Object Explorer, F5 para executar, planos de execução, monitor de sessões e backup/restore, feito para quem já pensa em SSMS. -**[Baixar v0.1.0-alpha.3 para Windows x64](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.3)** · Instalador gráfico (EN/pt-BR) ou ZIP portátil, runtime .NET incluído · Funciona com PostgreSQL 17 e 18 +**[Baixar v0.1.0-alpha.4 para Windows x64](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.4)** · Instalador gráfico (EN/pt-BR) ou ZIP portátil, runtime .NET incluído · Funciona com PostgreSQL 16 a 18 ![Editor, Object Explorer e resultados do PGMS](docs/assets/pgms-results-m959.jpg) @@ -46,14 +46,14 @@ Get-FileHash .\PGMS-* -Algorithm SHA256 Compare os hashes com o `SHA256SUMS.txt` da release. A partir da v0.1.0-alpha.2 os assets são compilados pelo [workflow de release](.github/workflows/release.yml) no GitHub Actions e trazem atestado de proveniência de build, então você também pode confirmar que o ZIP ou o instalador saiu desse workflow e deste repositório (exige o [GitHub CLI](https://cli.github.com/)): ```powershell -gh attestation verify .\PGMS-0.1.0-alpha.3-Setup-x64.exe --repo leoars/PostgresManagementStudio +gh attestation verify .\PGMS-0.1.0-alpha.4-Setup-x64.exe --repo leoars/PostgresManagementStudio ``` A v0.1.0-alpha.1 foi compilada na máquina do mantenedor e tem apenas checksums. A assinatura de código pelo programa open source da SignPath Foundation está planejada. ### Compilar a partir do código -Para desenvolvimento: Windows x64, PowerShell 7 e SDK .NET selecionado por [global.json](global.json) (`10.0.400`, com o patch mais recente instalado nessa faixa). PostgreSQL 17/18 e ferramentas da mesma versão principal são necessários para testes com banco e backup/restore. +Para desenvolvimento: Windows x64, PowerShell 7 e SDK .NET selecionado por [global.json](global.json) (`10.0.400`, com o patch mais recente instalado nessa faixa). PostgreSQL 16–18 e ferramentas da mesma versão principal são necessários para testes com banco e backup/restore. ```powershell git clone https://github.com/leoars/PostgresManagementStudio.git diff --git a/SECURITY.md b/SECURITY.md index 4a0d36b..2a086c6 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ English | [Português (Brasil)](SECURITY.pt-BR.md) -PGMS is in development. There is no published supported release series or guaranteed response time. Current development and the v0.1.0-alpha.3 pre-release are the starting points for investigation; historical packages do not automatically receive fixes. +PGMS is in development. There is no published supported release series or guaranteed response time. Current development and the v0.1.0-alpha.4 pre-release are the starting points for investigation; historical packages do not automatically receive fixes. Do not disclose an unpatched vulnerability or real credentials in a public issue. Use GitHub's **Report a vulnerability** on this repository if private reporting is enabled. If it is unavailable, open an issue asking the maintainer for a private contact channel without including vulnerability details. Never post database dumps, saved profiles, DPAPI payloads, access tokens or private keys. diff --git a/SECURITY.pt-BR.md b/SECURITY.pt-BR.md index 35a101e..eb0e0cd 100644 --- a/SECURITY.pt-BR.md +++ b/SECURITY.pt-BR.md @@ -2,7 +2,7 @@ [English](SECURITY.md) | Português (Brasil) -O PGMS está em desenvolvimento. Não há série de releases publicada com suporte nem prazo de resposta garantido. O desenvolvimento atual e a pré-release v0.1.0-alpha.3 são o ponto de partida para investigação; pacotes históricos não recebem correções automaticamente. +O PGMS está em desenvolvimento. Não há série de releases publicada com suporte nem prazo de resposta garantido. O desenvolvimento atual e a pré-release v0.1.0-alpha.4 são o ponto de partida para investigação; pacotes históricos não recebem correções automaticamente. Não divulgue vulnerabilidade sem correção ou credenciais reais em uma issue pública. Use **Report a vulnerability** no GitHub deste repositório se o relato privado estiver habilitado. Se estiver indisponível, abra uma issue pedindo ao mantenedor um canal privado, sem detalhes da vulnerabilidade. Nunca publique dumps, perfis salvos, payloads DPAPI, tokens ou chaves privadas. diff --git a/docs/en/distribution.md b/docs/en/distribution.md index 115a66f..ff09696 100644 --- a/docs/en/distribution.md +++ b/docs/en/distribution.md @@ -1,8 +1,8 @@ -# PGMS v0.1.0-alpha.3 — portable distribution (M1022) +# PGMS v0.1.0-alpha.4 — portable distribution (M1030) English | Português (Brasil): LEIA-ME.md in the package, or docs/pt-BR/distribution.md in the source repository. -Extract the entire directory and run PGMS.exe. A win-x64 self-contained package includes .NET/WPF; keep its DLLs, resources, LICENSE, notices and licenses directory together. No SSMS is required. No PostgreSQL server or client tools are bundled. Use PostgreSQL 17/18 and matching-major pg_dump/pg_restore/psql/pg_dumpall for applicable operations. No signed installer, MSI or automatic update is provided. +Extract the entire directory and run PGMS.exe. A win-x64 self-contained package includes .NET/WPF; keep its DLLs, resources, LICENSE, notices and licenses directory together. No SSMS is required. No PostgreSQL server or client tools are bundled. Use PostgreSQL 16–18 and matching-major pg_dump/pg_restore/psql/pg_dumpall for applicable operations. No signed installer, MSI or automatic update is provided. Connect with the intended PostgreSQL role and appropriate TLS settings (VerifyFull by default). Review SQL, target and role before administering. Only run trusted restore scripts; SQL can issue COMMIT, reconnect or execute local psql commands. Cancel is a request and may arrive after COMMIT. Check the destination before retrying. diff --git a/docs/en/getting-started.md b/docs/en/getting-started.md index af8c2cb..49ed6e0 100644 --- a/docs/en/getting-started.md +++ b/docs/en/getting-started.md @@ -2,7 +2,7 @@ English | [Português (Brasil)](../pt-BR/getting-started.md) -[Download v0.1.0-alpha.3](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.3): [graphical installer](graphical-installer.md), portable ZIP or PowerShell 7 installer. The graphical installer offers current-user and all-users modes and does not require PowerShell. See [release notes](release-notes.md). +[Download v0.1.0-alpha.4](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.4): [graphical installer](graphical-installer.md), portable ZIP or PowerShell 7 installer. The graphical installer offers current-user and all-users modes and does not require PowerShell. See [release notes](release-notes.md). ### Windows SmartScreen warning @@ -15,16 +15,16 @@ Get-FileHash .\PGMS-* -Algorithm SHA256 Compare the hashes with `SHA256SUMS.txt` in the release. Starting with v0.1.0-alpha.2 the assets are built by the [release workflow](../../.github/workflows/release.yml) on GitHub Actions and carry a build provenance attestation, so you can also confirm that the ZIP or installer came from that workflow and this repository (requires the [GitHub CLI](https://cli.github.com/); see [development](development.md)): ```powershell -gh attestation verify .\PGMS-0.1.0-alpha.3-Setup-x64.exe --repo leoars/PostgresManagementStudio +gh attestation verify .\PGMS-0.1.0-alpha.4-Setup-x64.exe --repo leoars/PostgresManagementStudio ``` v0.1.0-alpha.1 was built on the maintainer's machine and has checksums only. Code signing through the SignPath Foundation open source program is planned. ## Requirements -PGMS targets Windows x64. Building requires PowerShell 7 and a .NET 10 SDK compatible with [global.json](../../global.json): 10.0.400 with latest-patch roll-forward. Dependencies are pinned in NuGet lockfiles. The M1022 package was built with SDK 10.0.403 and bundles .NET/WPF 10.0.14; a rebuild may use different installed runtime packs. +PGMS targets Windows x64. Building requires PowerShell 7 and a .NET 10 SDK compatible with [global.json](../../global.json): 10.0.400 with latest-patch roll-forward. Dependencies are pinned in NuGet lockfiles. The M1030 package was built with SDK 10.0.403 and bundles .NET/WPF 10.0.14; a rebuild may use different installed runtime packs. -PostgreSQL 17/18 with same-major client tools is the supported database scope. The historical matrix tested 17.11/18.6. A server is not needed just to open the shell. Backup/restore requires external pg_dump, pg_restore, psql and pg_dumpall as applicable; PGMS installs none of them. +PostgreSQL 16–18 with same-major client tools is the supported database scope. The complete regression runs on 17.11; Activity Monitor and Query Statistics suites also ran on 16.15 and 18.6. On PostgreSQL 16, Query Statistics needs `pg_stat_statements` 1.10 or later. A server is not needed just to open the shell. Backup/restore requires external pg_dump, pg_restore, psql and pg_dumpall as applicable; PGMS installs none of them. ```powershell ./scripts/Build.ps1 @@ -35,11 +35,11 @@ dotnet run --project src/PGMS.Desktop ```powershell ./scripts/Publish.ps1 -SelfContained -./scripts/Verify-Package.ps1 -PackagePath artifacts/M1022-win-x64 -./scripts/New-PackageArchive.ps1 -PackagePath artifacts/M1022-win-x64 +./scripts/Verify-Package.ps1 -PackagePath artifacts/M1030-win-x64 +./scripts/New-PackageArchive.ps1 -PackagePath artifacts/M1030-win-x64 ``` -Paths follow `BuildInfo.Milestone`; replace M1022 if the build label changes. Existing package folders and ZIPs are refused rather than overwritten. A fresh clone contains neither local ZIPs nor acceptance artifacts. Extract the entire package and run PGMS.exe, retaining adjacent libraries and licenses. Without `-SelfContained`, the package needs an installed .NET10 Desktop Runtime. No SSMS is required. +Paths follow `BuildInfo.Milestone`; replace M1030 if the build label changes. Existing package folders and ZIPs are refused rather than overwritten. A fresh clone contains neither local ZIPs nor acceptance artifacts. Extract the entire package and run PGMS.exe, retaining adjacent libraries and licenses. Without `-SelfContained`, the package needs an installed .NET10 Desktop Runtime. No SSMS is required. Optional managed installation/update/rollback uses the packaged PowerShell 7 scripts. Read `LEIA-ME.md` shipped with the exact package before using them. Portable execution does not require PowerShell 7. The current ZIP has no MSI, code signature or automatic updater; SmartScreen behavior has not been tested. diff --git a/docs/en/graphical-installer.md b/docs/en/graphical-installer.md index dfaf900..d8d2409 100644 --- a/docs/en/graphical-installer.md +++ b/docs/en/graphical-installer.md @@ -2,7 +2,7 @@ English | [Português (Brasil)](../pt-BR/graphical-installer.md) -Download `PGMS-0.1.0-alpha.3-Setup-x64.exe` from the [alpha.3 release](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.3) and check it against `SHA256SUMS.txt` (and, optionally, `gh attestation verify`). Since v0.1.0-alpha.3 the installer is built by the release workflow from the same payload as the portable ZIP of that release; in v0.1.0-alpha.1 it was added later to wrap the existing M1022 payload. The installer does not require PowerShell or a separately installed .NET runtime. +Download `PGMS-0.1.0-alpha.4-Setup-x64.exe` from the [alpha.4 release](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.4) and check it against `SHA256SUMS.txt` (and, optionally, `gh attestation verify`). Since v0.1.0-alpha.2 the installer is built by the release workflow from the same payload as the portable ZIP of that release; in v0.1.0-alpha.1 it was added later to wrap the existing M1008 payload. The installer does not require PowerShell or a separately installed .NET runtime. ## Installation choices @@ -23,10 +23,10 @@ The executable is unsigned; SmartScreen reputation and a clean Windows VM have n ## Build and test -Use the official [Inno Setup 7.1.1 x64 compiler](https://jrsoftware.org/isdl.php), retaining its license. Extract the existing release ZIP into `artifacts/M1022-win-x64`. The builder checks every payload file, the frozen manifest and application version, and refuses an existing output directory. A local application rebuild may have a different manifest and is intentionally refused by this release-specific builder. Update the release configuration for a future frozen release. The [release workflow](../../.github/workflows/release.yml) passes `-SkipFrozenManifest` because it builds the payload itself; milestone and product version are still enforced, and the frozen hash remains required for local builds. +Use the official [Inno Setup 7.1.1 x64 compiler](https://jrsoftware.org/isdl.php), retaining its license. Extract the existing release ZIP into `artifacts/M1030-win-x64`. The builder checks every payload file, the frozen manifest and application version, and refuses an existing output directory. A local application rebuild may have a different manifest and is intentionally refused by this release-specific builder. Update the release configuration for a future frozen release. The [release workflow](../../.github/workflows/release.yml) passes `-SkipFrozenManifest` because it builds the payload itself; milestone and product version are still enforced, and the frozen hash remains required for local builds. ```powershell -./scripts/Build-GraphicalInstaller.ps1 -PackagePath artifacts/M1022-win-x64 -CompilerPath 'C:\Tools\Inno Setup 7\ISCC.exe' +./scripts/Build-GraphicalInstaller.ps1 -PackagePath artifacts/M1030-win-x64 -CompilerPath 'C:\Tools\Inno Setup 7\ISCC.exe' ./scripts/Test-GraphicalInstaller.ps1 -InstallerPath artifacts/graphical-installer/0.1.0-alpha.1/PGMS-0.1.0-alpha.1-Setup-x64.exe ``` diff --git a/docs/en/release-notes.md b/docs/en/release-notes.md index db2758b..ae6bee0 100644 --- a/docs/en/release-notes.md +++ b/docs/en/release-notes.md @@ -1,23 +1,25 @@ -# v0.1.0-alpha.3 — Windows x64 +# v0.1.0-alpha.4 — Windows x64 English | [Português (Brasil)](../pt-BR/release-notes.md) -Third public pre-release of PGMS. It is an alpha for evaluation with synthetic/disposable data. Build label: M1022. Unlike v0.1.0-alpha.2, this release changes the application: it adds Query Statistics over `pg_stat_statements`, stops `$n` placeholders from closing the query session and gives grid rows short screen-reader names. The binaries are built and attested by the same [release workflow](../../.github/workflows/release.yml) as alpha.2. Original work is MIT; dependency notices and licenses accompany the package. +Fourth public pre-release of PGMS. It is an alpha for evaluation with synthetic/disposable data. Build label: M1030. This release rebuilds the Activity Monitor as a document tab with the SSMS panels, adds concurrent detach and sub-partitions to the Partitions dialog and supports PostgreSQL 16. The binaries are built and attested by the same [release workflow](../../.github/workflows/release.yml) as alpha.2 and alpha.3. Original work is MIT; dependency notices and licenses accompany the package. -## What changed since v0.1.0-alpha.2 +## What changed since v0.1.0-alpha.3 -- **Query Statistics (View → Query Statistics…).** Read-only analysis of `pg_stat_statements` for the connected database, with a purpose similar to SQL Server Query Store: calls, execution time (total, mean, minimum, maximum, standard deviation), rows, cache hit %, shared/temporary blocks, I/O time and WAL bytes per normalized statement. Server-side filters and ordering with a 1,000-row limit, sortable headers, a top-N chart beside the grid, cumulative/since-baseline/last 5, 15 or 60 minute windows, **Show Plan** with `EXPLAIN (GENERIC_PLAN)` in a new query tab, confirmed per-statement and full resets, optional auto-refresh and filters saved per connection target. PGMS never installs or configures the extension; the window explains what the server is missing. See the [user guide](user-guide.md#query-statistics). -- **`$n` placeholders no longer close the session.** Executing, explaining or analyzing SQL that contains `$1`-style placeholders used to fail with protocol error 08P01, after which the driver closed the tab's connection. PGMS now detects placeholders before sending (ignoring literals, quoted identifiers, comments and dollar quotes; `PREPARE` and function/procedure bodies are exempt), refuses the statement with **Go to Error** on the placeholder and keeps the session open. **Estimated Plan** switches to a generic plan. -- **Shorter screen-reader names for grid rows.** Every WPF grid, including query results, names each row from its first visible columns (for example `Query ID 42, Database app, …`) instead of exposing the whole underlying record. +- **Activity Monitor as a document tab with six panels.** **View → Activity Monitor** (`Ctrl+Alt+A`) opens one tab per server and role, reused when opened again. Collapsible panels as in SSMS: **Overview** (charts of active sessions, waiting sessions, database I/O from `pg_stat_io` and transactions per second), **Processes**, **Resource Waits** (sampled wait categories), **Data File I/O** (per database), **Recent Expensive Queries** (the change in `pg_stat_statements` between refreshes) and **Active Expensive Queries** (with **Edit Query Text** and **Show Execution Plan**, an estimated plan that does not execute the query). The Overview context menu sets the interval and pauses, resumes or refreshes the monitor; while paused the header reads "Overview (paused)". See the [user guide](user-guide.md#activity-monitor). +- **Session list closer to SSMS.** Host, **Blocked by PID** and **Head blocker** columns (computed from server-wide `pg_locks`), header tooltips, a row menu (**Details…**, **Cancel Query**, **Terminate Session…**), a **Session Details** dialog with the most recent query, server-side filters and pages by PID (First/Previous/Next). Auto-refresh starts on, every 10 seconds, with intervals from 1 second to 1 hour. +- **Partitions.** **Detach concurrently** runs `DETACH PARTITION … CONCURRENTLY` outside a transaction, without blocking queries, after checking for a DEFAULT partition and for another pending detach; a pending partition is finished with `FINALIZE`. The dialog also creates a partition that is itself partitioned (**Sub-partition by**, keyed by columns of the parent), attaches partitioned tables and detaches partitioned partitions with their sub-tree. +- **PostgreSQL 16.** The supported scope is now PostgreSQL 16 to 18. Query Statistics and Recent Expensive Queries read `pg_stat_statements` 1.10 on PostgreSQL 16; versions older than 1.10 are refused with the `ALTER EXTENSION … UPDATE` they need. +- **Visual fixes.** Inactive document tabs use dark text and the inactive grid selection stays blue, as in SSMS. ## Downloads -From [this release](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.3): +From [this release](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.4): | File | Purpose | | --- | --- | -| `PGMS-0.1.0-alpha.3-Setup-x64.exe` | Graphical installer (English/pt-BR). Current user without administrator rights, or all users with elevation. No PowerShell or separate .NET runtime required. | -| `PGMS-0.1.0-alpha.3-win-x64.zip` | Portable application with .NET/WPF runtime. Extract the entire folder and run PGMS.exe. Includes the managed PowerShell 7 scripts. | +| `PGMS-0.1.0-alpha.4-Setup-x64.exe` | Graphical installer (English/pt-BR). Current user without administrator rights, or all users with elevation. No PowerShell or separate .NET runtime required. | +| `PGMS-0.1.0-alpha.4-win-x64.zip` | Portable application with .NET/WPF runtime. Extract the entire folder and run PGMS.exe. Includes the managed PowerShell 7 scripts. | | `SHA256SUMS.txt` | SHA256 of every asset in this release. Hashes check correspondence, not authorship. | | `package-manifest.json` | SHA256 manifest of every file inside the ZIP, as checked by `Verify-Package.ps1`. | | `RELEASE-NOTES.md`, `RELEASE-NOTES.pt-BR.md` | These notes. | @@ -28,27 +30,27 @@ The binaries are not code-signed, so Windows SmartScreen may warn on first launc ```powershell Get-FileHash .\PGMS-* -Algorithm SHA256 -gh attestation verify .\PGMS-0.1.0-alpha.3-Setup-x64.exe --repo leoars/PostgresManagementStudio +gh attestation verify .\PGMS-0.1.0-alpha.4-Setup-x64.exe --repo leoars/PostgresManagementStudio ``` Compare the hashes with `SHA256SUMS.txt`. The second command needs the [GitHub CLI](https://cli.github.com/) and confirms that the file was produced by this repository's release workflow at the tagged commit; run it for the ZIP as well. Code signing through the SignPath Foundation open source program is planned; no date is promised. ## Scope -SQL editor and independent sessions, Object Explorer, bounded Results/Messages and CSV/JSON export, reviewed PostgreSQL administration, identity/privileges, session monitoring, query statistics and logical backup/restore. PostgreSQL 17/18 and same-major client tools are required for database operations and backup/restore; server/tools are not bundled. Query Statistics also requires the `pg_stat_statements` extension on the server. SSMS is neither required nor distributed. +SQL editor and independent sessions, Object Explorer, bounded Results/Messages and CSV/JSON export, reviewed PostgreSQL administration (partitions included), identity/privileges, Activity Monitor, query statistics and logical backup/restore. PostgreSQL 16 to 18 and same-major client tools are required for database operations and backup/restore; server/tools are not bundled. Query Statistics and Recent Expensive Queries also require the `pg_stat_statements` extension on the server. SSMS is neither required nor distributed. ## Validation -Application behavior: the M1022 source passed the complete PostgreSQL 17.11 regression of this repository (**2,236 integration + 3,315 WPF = 5,551 checks**) on an isolated loopback cluster started with `pg_stat_statements` preloaded; the host PostgreSQL service is not used. The focused Query Statistics suite (`Test-Integration.ps1 -QueryStatisticsOnly`) passed 90 integration + 224 WPF checks. The regression does not run in CI. The Query Statistics window was also compared with the SQL Server Query Store of SSMS 22.11 on an identical synthetic workload; differences are documented in [validation](validation.md). +Application behavior: the M1030 source passed the complete PostgreSQL 17.11 regression of this repository (**2,318 integration + 3,429 WPF = 5,747 checks**) on an isolated loopback cluster started with `pg_stat_statements` preloaded; the host PostgreSQL service is not used. On the same source, the focused Activity Monitor suite (`Test-Integration.ps1 -ActivityOnly`) passed 71 integration + 152 WPF checks on PostgreSQL 16.15 and 18.6; the Query Statistics suite passed on 16.15 and 18.6 on the M1029 source, and the Query Statistics code has not changed since. The regression does not run in CI. The Activity Monitor was compared twice with the one in SSMS 22.11 under the same blocking workload; remaining differences are listed in [validation](validation.md). -Release pipeline: unchanged from v0.1.0-alpha.2. The workflow validates that the tag matches `installer/release.json`, `Directory.Build.props` and `BuildInfo.cs`; publishes with `Publish.ps1 -SelfContained`; runs `Verify-Package.ps1`, `Test-Package.ps1` and `Test-PackageGuides.ps1`; creates the ZIP; builds the installer with the pinned, hash-verified Inno Setup 7.1.1; runs an informational launch smoke on the runner; attests the ZIP and the installer; and opens a draft pre-release that the maintainer reviews before publishing. The draft assets are verified locally before publication, as for alpha.2, and the result is reported in the release pull request. +Release pipeline: unchanged from v0.1.0-alpha.2. The workflow validates that the tag matches `installer/release.json`, `Directory.Build.props` and `BuildInfo.cs`; publishes with `Publish.ps1 -SelfContained`; runs `Verify-Package.ps1`, `Test-Package.ps1` and `Test-PackageGuides.ps1`; creates the ZIP; builds the installer with the pinned, hash-verified Inno Setup 7.1.1; runs an informational launch smoke on the runner; attests the ZIP and the installer; and opens a draft pre-release that the maintainer reviews before publishing. The draft assets are verified locally before publication, and the result is reported in the release pull request. -All-users (elevated) installation, a clean-Windows VM installation and physical DPI/keyboard/screen-reader observations of the new window are not newly certified by this release. +All-users (elevated) installation, a clean-Windows VM installation, a complete regression on PostgreSQL 16 and 18 and physical DPI/keyboard/screen-reader observations of the new screens are not newly certified by this release. ## Known limits -Windows x64 only. Unsigned executable and installer; SmartScreen warns. No MSI, automatic update or production-support guarantee. Full SSMS parity is not claimed. Query Statistics is a snapshot of cumulative server counters, not continuous monitoring: sliding windows sample only while the window is open, minimum/maximum are not available for a window and PostgreSQL has no per-statement CPU time. The placeholder check assumes `standard_conforming_strings = on` and offers no parameter-value dialog. Results/recovery are bounded; large SQL lines may pause rendering. Cancellation is not proof of rollback. Restore SQL must be trusted and can control transactions, reconnect or execute local psql commands. DPAPI state is tied to the Windows user. The frozen manifest hash in `installer/release.json` describes a locally built payload, not the CI payload; the CI build compares milestone and product version instead. See [validation](validation.md) and [security](../../SECURITY.md). +Windows x64 only. Unsigned executable and installer; SmartScreen warns. No MSI, automatic update or production-support guarantee. Full SSMS parity is not claimed. Activity Monitor: Data File I/O is per database, not per file (PostgreSQL has no per-file statistics); Resource Waits is sampled at each refresh, not cumulative; session pages are separate reads and sorting applies within a page; nothing was tested with more than 1,000 sessions. Query Statistics is a snapshot of cumulative server counters, not continuous monitoring; with `pg_stat_statements` 1.10 a time window can count low a statement that was removed and tracked again. The placeholder check assumes `standard_conforming_strings = on` and offers no parameter-value dialog. Results/recovery are bounded; large SQL lines may pause rendering. Cancellation is not proof of rollback. Restore SQL must be trusted and can control transactions, reconnect or execute local psql commands. DPAPI state is tied to the Windows user. The frozen manifest hash in `installer/release.json` describes a locally built payload, not the CI payload; the CI build compares milestone and product version instead. See [validation](validation.md) and [security](../../SECURITY.md). ## Previous releases -v0.1.0-alpha.2 (2026-11-01, first CI-built release with attestation) and v0.1.0-alpha.1 (2026-10-31) remain available with their original assets and notes. +v0.1.0-alpha.3 (2026-11-02, Query Statistics), v0.1.0-alpha.2 (2026-11-01, first CI-built release with attestation) and v0.1.0-alpha.1 (2026-10-31) remain available with their original assets and notes. diff --git a/docs/en/user-guide.md b/docs/en/user-guide.md index 644d09b..a181ead 100644 --- a/docs/en/user-guide.md +++ b/docs/en/user-guide.md @@ -14,13 +14,26 @@ Results are bounded: 10,000 rows, 100 result sets, 256 columns per result, 4,096 Object Explorer loads folders on demand, filters and inspects objects. Supported operations offer SQL preview and explicit Apply. Script output does not include all concurrent-change protections of Apply. Use the least PostgreSQL privileges required; PGMS does not bypass server authorization. Check target database/schema/object and role before applying. -Identity and sequence operations distinguish configured START from RESTART. A restart can repeat existing values. Privilege changes, delegation, CASCADE and COMMIT reconciliation have specific review and concurrency rules. Activity Monitor distinguishes **Cancel Refresh**, **Cancel Query** and **Terminate Session**. Refreshing a snapshot is not authorization to terminate a session. See the [documentation index](../README.md) for supported behavior. +Identity and sequence operations distinguish configured START from RESTART. A restart can repeat existing values. The **Partitions** dialog creates, attaches and detaches partitions. A new child can itself be partitioned (**Sub-partition by**, keyed by columns of the parent), and a partitioned table can be attached or detached with its sub-tree. **Detach concurrently** runs `DETACH PARTITION … CONCURRENTLY` outside a transaction, without blocking queries; it is refused for a DEFAULT partition or while another detach is pending, and a pending detach is finished with `FINALIZE`. Privilege changes, delegation, CASCADE and COMMIT reconciliation have specific review and concurrency rules. See the [documentation index](../README.md) for supported behavior. + +## Activity Monitor + +**View → Activity Monitor** (`Ctrl+Alt+A`) opens a document tab for the connected server and role (`host:port (role) - Activity Monitor`); opening it again activates the same tab. It has six collapsible panels, following the SSMS layout: + +- **Overview**: charts of active sessions, waiting sessions, database I/O (`pg_stat_io`) and transactions per second. Its context menu sets the refresh interval and pauses, resumes or refreshes the whole monitor. +- **Processes**: sessions from `pg_stat_activity` with host, state, query and transaction age, wait, **Blocked by PID** and **Head blocker**, filters applied on the server and pages by PID. **Details…** opens the session's most recent query; **Cancel Query** and **Terminate Session…** act on the selected session. +- **Resource Waits**: wait categories sampled at each refresh. PostgreSQL keeps no cumulative wait time, so these are estimates; idle waits and `pg_sleep` are left out. +- **Data File I/O**: reads, temporary writes, read time and buffer hit per database (`pg_stat_database`), not per file: PostgreSQL has no per-file statistics. +- **Recent Expensive Queries**: the change in `pg_stat_statements` between refreshes; requires the extension, as Query Statistics does. +- **Active Expensive Queries**: statements running now. **Edit Query Text** opens one in a query tab; **Show Execution Plan** shows an estimated plan without executing it. + +Auto-refresh starts on, every 10 seconds, with intervals from 1 second to 1 hour. **Cancel Refresh**, **Cancel Query** and **Terminate Session** are distinct actions; refreshing a snapshot is not authorization to terminate a session. Pages are separate reads, so a session can move between pages, and sorting applies within the loaded page. Roles outside `pg_read_all_stats` may not see other roles' queries and waits. ## Query statistics **View → Query Statistics…** reads `pg_stat_statements` for the connected database: normalized statements with calls, execution time (total, mean, minimum, maximum, standard deviation), rows, cache hit %, shared and temporary blocks, I/O time and WAL bytes. The purpose is similar to SQL Server Query Store; it is not a copy of its screens or reports. -PGMS never loads, creates or configures the extension. The server needs `shared_preload_libraries = 'pg_stat_statements'` (a restart) and `CREATE EXTENSION pg_stat_statements` in a database; when something is missing, a yellow band says what. Roles outside `pg_read_all_stats` see other users' statements without SQL text, as PostgreSQL decides. I/O time is only recorded with `track_io_timing` on. PostgreSQL has no per-statement CPU time. +PGMS never loads, creates or configures the extension. The server needs `shared_preload_libraries = 'pg_stat_statements'` (a restart) and `CREATE EXTENSION pg_stat_statements` in a database; when something is missing, a yellow band says what. Roles outside `pg_read_all_stats` see other users' statements without SQL text, as PostgreSQL decides. I/O time is only recorded with `track_io_timing` on. PostgreSQL has no per-statement CPU time. Extension version 1.10 (PostgreSQL 16) is read without `stats_since`: a statement removed and tracked again during a time window can count low, and the window status says so. Versions older than 1.10 are not read; the band names the `ALTER EXTENSION pg_stat_statements UPDATE` a privileged user can run, and PGMS changes nothing. Filters (database, user, SQL text, minimum calls) and ordering run on the server before a 1,000-row limit. Clicking the Total, Mean, Max, Calls, Rows or metric headers reloads in that order; other headers sort only the loaded rows. **Window** shows cumulative values since the last reset, values since a saved baseline, or the last 5/15/60 minutes, computed by subtracting an earlier reading; sliding windows sample only while the window is open, and minimum/maximum are not available for a window. A top-N chart beside the grid follows the applied order. **Show Plan** opens the selected statement in a new query tab with `EXPLAIN (GENERIC_PLAN)`, without executing it or binding `$n` values. **Reset Selected** and **Reset All** call `pg_stat_statements_reset` after a confirmation whose default is No; the server decides whether the role may reset. Auto-refresh is optional and starts off. Filters, chart choices and baselines are stored per connection target in the PGMS state folder, without passwords or SQL results. diff --git a/docs/en/validation.md b/docs/en/validation.md index c3fa5c9..f57f9ac 100644 --- a/docs/en/validation.md +++ b/docs/en/validation.md @@ -2,11 +2,11 @@ English | [Português (Brasil)](../pt-BR/validation.md) -Current pre-release: v0.1.0-alpha.3, build label M1022 (adds Query Statistics, placeholder protection and grid row names to the M1008 source of alpha.1/alpha.2; built by the release workflow on GitHub Actions with a build provenance attestation). Milestone labels are internal identifiers, not guarantees that a local rebuild has the same binary identity. The initial public source import used M1002. The private operational history and raw acceptance evidence are intentionally not included. +Current pre-release: v0.1.0-alpha.4, build label M1030 (adds the Activity Monitor document tab and panels, concurrent detach and sub-partitions, and PostgreSQL 16 support to the M1022 source of alpha.3; built by the release workflow on GitHub Actions with a build provenance attestation). Milestone labels are internal identifiers, not guarantees that a local rebuild has the same binary identity. The initial public source import used M1002. The private operational history and raw acceptance evidence are intentionally not included. The imported implementation previously passed 5,187 automated checks (2,115 PostgreSQL integration and 3,072 WPF), plus package opening, installed profile preservation and three-draft recovery through rollback/restart. Those are historical observations, not newly executed tests for every source revision. Reproduce current behavior with the public build and test scripts; report your actual environment and results. The clean-import checks for the initial public revision are recorded below after execution. -Known limits: Windows x64; PostgreSQL 17/18 with same-major tools, historical17.11/18.6 coverage;16 and earlier unsupported. No full SSMS parity. Huge SQL lines may pause rendering. Results and recovery have bounded retention. Cancellation is not proof of rollback. DPAPI is user-bound. The package is unsigned, without MSI/automatic update; SmartScreen is not certified. DPI100/125/150/175% were exercised internally;200% was accepted without execution. Automatic reappearance after disconnect, cross-user DPAPI portability and a new clean-Windows test of this import are not certified. External clipboard/keyboard/screen-reader observations are historical and not reproduced by ordinary WPF tests. +Known limits: Windows x64; PostgreSQL 16–18 with same-major tools, complete regression on 17.11 and focused suites on 16.15/18.6; 15 and earlier unsupported. No full SSMS parity. Huge SQL lines may pause rendering. Results and recovery have bounded retention. Cancellation is not proof of rollback. DPAPI is user-bound. The package is unsigned, without MSI/automatic update; SmartScreen is not certified. DPI100/125/150/175% were exercised internally;200% was accepted without execution. Automatic reappearance after disconnect, cross-user DPAPI portability and a new clean-Windows test of this import are not certified. External clipboard/keyboard/screen-reader observations are historical and not reproduced by ordinary WPF tests. ```powershell ./scripts/Build.ps1 -Configuration Release @@ -37,3 +37,9 @@ Package and release-installer results are recorded in the [release notes](releas A complete run passed 2,236 integration + 3,315 WPF = 5,551 checks on PostgreSQL 17.11. The disposable loopback cluster now starts with `shared_preload_libraries=pg_stat_statements`; the host service is not touched, and the cluster stopped afterward. The focused suite `Test-Integration.ps1 -QueryStatisticsOnly` passed 90 integration + 224 WPF checks. Integration checks cover detection without the extension (nothing is installed), ordinary roles versus `pg_read_all_stats`, server-side filters/order and the 1,000-row sentinel, per-statement and full resets refused or authorized by PostgreSQL, baselines and windows, generic plans, and placeholder detection across literals, comments and dollar quotes with the session kept open. WPF checks cover loading, cancellation under a real lock, preserved selection, header ordering, chart, window selector, saved preferences (including a corrupt file left untouched), row accessibility names and minimum-size layout. The window was compared, during development, with the Query Store of SSMS 22.11 on an identical synthetic workload against SQL Server LocalDB and the disposable PostgreSQL cluster. Both listed the same statements with matching counts. Differences found then: one window instead of seven Query Store reports; server-wide cumulative counters instead of per-database time intervals; no chart, plan, logical reads or header sorting; full records exposed as row names to screen readers. Header sorting, I/O and block metrics, generic plans, the top-N chart, time windows and short row names were added afterward. Remaining differences: one window instead of separate reports, windows computed by subtracting samples rather than stored intervals, and no per-statement CPU time, which PostgreSQL does not record. Physical DPI and screen-reader observations of this window are not newly certified. + +## v0.1.0-alpha.4 / M1030 — 2026-11-04 + +A complete run passed 2,318 integration + 3,429 WPF = 5,747 checks on PostgreSQL 17.11, on the same disposable loopback cluster with `pg_stat_statements` preloaded; the cluster stopped afterward. In the public checkout, the focused suite `Test-Integration.ps1 -ActivityOnly` passed 71 integration + 152 WPF checks and `-PartitionTablesOnly` passed 113 integration + 101 WPF checks. On the same application source, in the development repository, the Activity Monitor suite passed 71 integration + 152 WPF checks on PostgreSQL 16.15 and on 18.6, with matching-major tools; the Query Statistics suite passed on both versions on the M1029 source, and its code has not changed since. Integration checks cover blocking chains and the head blocker across databases, paging by PID within one snapshot, overview metrics from `pg_stat_io` and `pg_stat_database`, sampled waits that leave out `pg_sleep`, the change in `pg_stat_statements` between refreshes, concurrent detach with its preconditions and `FINALIZE`, and creating, attaching and detaching sub-partitioned tables. WPF checks cover the document tab and its reuse, panels, charts, pause/resume, refresh intervals, row and panel menus, Session Details and minimum-size layout. + +The Activity Monitor was compared twice, during development, with the one in SSMS 22.11, under the same blocking workload against SQL Server LocalDB and the disposable PostgreSQL cluster, including real right clicks on the Overview menu. The differences found were fixed except these, kept by decision or by what PostgreSQL offers: double-clicking a session opens Session Details (SSMS does nothing); the selection follows the session when the list is re-sorted (SSMS keeps the position); Overview shows active sessions where SSMS shows processor time; Data File I/O is per database because PostgreSQL has no per-file statistics; Resource Waits is sampled rather than cumulative. Nothing was tested with more than 1,000 sessions, and physical DPI and screen-reader observations of the new screens are not newly certified. \ No newline at end of file diff --git a/docs/pt-BR/distribution.md b/docs/pt-BR/distribution.md index a5efede..336631f 100644 --- a/docs/pt-BR/distribution.md +++ b/docs/pt-BR/distribution.md @@ -1,8 +1,8 @@ -# PGMS v0.1.0-alpha.3 — distribuição portátil (M1022) +# PGMS v0.1.0-alpha.4 — distribuição portátil (M1030) [English]: READ-ME.md no pacote, ou docs/en/distribution.md no repositório. Português (Brasil). -Extraia todo o diretório e execute PGMS.exe. Pacote win-x64 self-contained inclui .NET/WPF; preserve DLLs, recursos, LICENSE, avisos e pasta licenses juntos. SSMS não é necessário. Não inclui servidor ou ferramentas PostgreSQL. Use PostgreSQL 17/18 e pg_dump/pg_restore/psql/pg_dumpall da mesma versão principal conforme a operação. Sem instalador assinado, MSI ou atualização automática. +Extraia todo o diretório e execute PGMS.exe. Pacote win-x64 self-contained inclui .NET/WPF; preserve DLLs, recursos, LICENSE, avisos e pasta licenses juntos. SSMS não é necessário. Não inclui servidor ou ferramentas PostgreSQL. Use PostgreSQL 16–18 e pg_dump/pg_restore/psql/pg_dumpall da mesma versão principal conforme a operação. Sem instalador assinado, MSI ou atualização automática. Conecte com a role pretendida e TLS adequado (VerifyFull por padrão). Revise SQL, destino e role antes de administrar. Execute restore somente com scripts confiáveis; SQL pode emitir COMMIT, reconectar ou executar comandos locais psql. Cancelar é solicitação e pode chegar após COMMIT. Confira o destino antes de repetir. diff --git a/docs/pt-BR/getting-started.md b/docs/pt-BR/getting-started.md index d6880c2..b645f4a 100644 --- a/docs/pt-BR/getting-started.md +++ b/docs/pt-BR/getting-started.md @@ -2,7 +2,7 @@ [English](../en/getting-started.md) | Português (Brasil) -[Baixar v0.1.0-alpha.3](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.3): [instalador gráfico](graphical-installer.md), ZIP portátil ou instalador PowerShell 7. O instalador gráfico oferece modos por usuário e para todos, dispensando PowerShell. Veja [notas da versão](release-notes.md). +[Baixar v0.1.0-alpha.4](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.4): [instalador gráfico](graphical-installer.md), ZIP portátil ou instalador PowerShell 7. O instalador gráfico oferece modos por usuário e para todos, dispensando PowerShell. Veja [notas da versão](release-notes.md). ### Aviso do SmartScreen do Windows @@ -15,16 +15,16 @@ Get-FileHash .\PGMS-* -Algorithm SHA256 Compare os hashes com o `SHA256SUMS.txt` da release. A partir da v0.1.0-alpha.2 os assets são compilados pelo [workflow de release](../../.github/workflows/release.yml) no GitHub Actions e trazem atestado de proveniência de build, então você também pode confirmar que o ZIP ou o instalador saiu desse workflow e deste repositório (exige o [GitHub CLI](https://cli.github.com/); veja [desenvolvimento](development.md)): ```powershell -gh attestation verify .\PGMS-0.1.0-alpha.3-Setup-x64.exe --repo leoars/PostgresManagementStudio +gh attestation verify .\PGMS-0.1.0-alpha.4-Setup-x64.exe --repo leoars/PostgresManagementStudio ``` A v0.1.0-alpha.1 foi compilada na máquina do mantenedor e tem apenas checksums. A assinatura de código pelo programa open source da SignPath Foundation está planejada. ## Pré-requisitos -O PGMS é destinado a Windows x64. Compilar exige PowerShell 7 e SDK.NET10 compatível com [global.json](../../global.json): 10.0.400 com roll-forward para o patch mais recente. Dependências são fixadas nos lockfiles NuGet. O pacote M1022 foi compilado com SDK 10.0.403 e inclui .NET/WPF 10.0.14; recompilar pode usar outros runtime packs instalados. +O PGMS é destinado a Windows x64. Compilar exige PowerShell 7 e SDK.NET10 compatível com [global.json](../../global.json): 10.0.400 com roll-forward para o patch mais recente. Dependências são fixadas nos lockfiles NuGet. O pacote M1030 foi compilado com SDK 10.0.403 e inclui .NET/WPF 10.0.14; recompilar pode usar outros runtime packs instalados. -PostgreSQL 17/18 com ferramentas da mesma versão principal é o escopo suportado. A matriz histórica testou 17.11/18.6. Não é necessário servidor para abrir o shell. Backup/restore requer pg_dump, pg_restore, psql e pg_dumpall externos conforme a operação; o PGMS não os instala. +PostgreSQL 16–18 com ferramentas da mesma versão principal é o escopo suportado. A regressão completa roda no 17.11; os recortes do Activity Monitor e do Query Statistics também rodaram no 16.15 e no 18.6. No PostgreSQL 16, o Query Statistics exige `pg_stat_statements` 1.10 ou posterior. Não é necessário servidor para abrir o shell. Backup/restore requer pg_dump, pg_restore, psql e pg_dumpall externos conforme a operação; o PGMS não os instala. ```powershell ./scripts/Build.ps1 @@ -35,11 +35,11 @@ dotnet run --project src/PGMS.Desktop ```powershell ./scripts/Publish.ps1 -SelfContained -./scripts/Verify-Package.ps1 -PackagePath artifacts/M1022-win-x64 -./scripts/New-PackageArchive.ps1 -PackagePath artifacts/M1022-win-x64 +./scripts/Verify-Package.ps1 -PackagePath artifacts/M1030-win-x64 +./scripts/New-PackageArchive.ps1 -PackagePath artifacts/M1030-win-x64 ``` -Caminhos seguem `BuildInfo.Milestone`; substitua M1022 se o rótulo mudar. Pastas e ZIPs existentes são recusados, sem sobrescrita. Um clone novo não contém ZIPs ou artefatos locais de aceitação. Extraia todo o pacote e execute PGMS.exe, mantendo bibliotecas e licenças adjacentes. Sem `-SelfContained`, o pacote exige .NET10 Desktop Runtime instalado. SSMS não é necessário. +Caminhos seguem `BuildInfo.Milestone`; substitua M1030 se o rótulo mudar. Pastas e ZIPs existentes são recusados, sem sobrescrita. Um clone novo não contém ZIPs ou artefatos locais de aceitação. Extraia todo o pacote e execute PGMS.exe, mantendo bibliotecas e licenças adjacentes. Sem `-SelfContained`, o pacote exige .NET10 Desktop Runtime instalado. SSMS não é necessário. Instalação gerenciada opcional/update/rollback usa os scripts PowerShell 7 do pacote. Leia o `LEIA-ME.md` daquela versão antes de usá-los. A execução portátil não exige PowerShell 7. O ZIP atual não tem MSI, assinatura ou atualização automática; SmartScreen não foi testado. diff --git a/docs/pt-BR/graphical-installer.md b/docs/pt-BR/graphical-installer.md index d7af4cc..0343d4a 100644 --- a/docs/pt-BR/graphical-installer.md +++ b/docs/pt-BR/graphical-installer.md @@ -2,7 +2,7 @@ [English](../en/graphical-installer.md) | Português (Brasil) -Baixe `PGMS-0.1.0-alpha.3-Setup-x64.exe` na [release alpha.3](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.3) e confira contra o `SHA256SUMS.txt` (e, opcionalmente, com `gh attestation verify`). Desde a v0.1.0-alpha.3 o instalador é compilado pelo workflow de release a partir do mesmo payload do ZIP portátil daquela release; na v0.1.0-alpha.1 ele foi adicionado depois, embrulhando o payload M1022 existente. O instalador dispensa PowerShell e runtime .NET instalado separadamente. +Baixe `PGMS-0.1.0-alpha.4-Setup-x64.exe` na [release alpha.4](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.4) e confira contra o `SHA256SUMS.txt` (e, opcionalmente, com `gh attestation verify`). Desde a v0.1.0-alpha.2 o instalador é compilado pelo workflow de release a partir do mesmo payload do ZIP portátil daquela release; na v0.1.0-alpha.1 ele foi adicionado depois, embrulhando o payload M1008 existente. O instalador dispensa PowerShell e runtime .NET instalado separadamente. ## Opções de instalação @@ -23,10 +23,10 @@ O executável não tem assinatura digital; reputação SmartScreen e VM Windows ## Compilar e testar -Use o [compilador oficial Inno Setup 7.1.1 x64](https://jrsoftware.org/isdl.php), preservando sua licença. Extraia o ZIP existente da release em `artifacts/M1022-win-x64`. O builder confere cada arquivo, o manifesto congelado e a versão do aplicativo, recusando diretório de saída existente. Uma recompilação local pode produzir outro manifesto e é intencionalmente recusada por este builder específico da release. Atualize a configuração para uma futura release congelada. O [workflow de release](../../.github/workflows/release.yml) passa `-SkipFrozenManifest` porque compila o próprio payload; marco e versão do produto continuam exigidos, e o hash congelado segue obrigatório em builds locais. +Use o [compilador oficial Inno Setup 7.1.1 x64](https://jrsoftware.org/isdl.php), preservando sua licença. Extraia o ZIP existente da release em `artifacts/M1030-win-x64`. O builder confere cada arquivo, o manifesto congelado e a versão do aplicativo, recusando diretório de saída existente. Uma recompilação local pode produzir outro manifesto e é intencionalmente recusada por este builder específico da release. Atualize a configuração para uma futura release congelada. O [workflow de release](../../.github/workflows/release.yml) passa `-SkipFrozenManifest` porque compila o próprio payload; marco e versão do produto continuam exigidos, e o hash congelado segue obrigatório em builds locais. ```powershell -./scripts/Build-GraphicalInstaller.ps1 -PackagePath artifacts/M1022-win-x64 -CompilerPath 'C:\Tools\Inno Setup 7\ISCC.exe' +./scripts/Build-GraphicalInstaller.ps1 -PackagePath artifacts/M1030-win-x64 -CompilerPath 'C:\Tools\Inno Setup 7\ISCC.exe' ./scripts/Test-GraphicalInstaller.ps1 -InstallerPath artifacts/graphical-installer/0.1.0-alpha.1/PGMS-0.1.0-alpha.1-Setup-x64.exe ``` diff --git a/docs/pt-BR/release-notes.md b/docs/pt-BR/release-notes.md index 836cb3f..72e24df 100644 --- a/docs/pt-BR/release-notes.md +++ b/docs/pt-BR/release-notes.md @@ -1,23 +1,25 @@ -# v0.1.0-alpha.3 — Windows x64 +# v0.1.0-alpha.4 — Windows x64 [English](../en/release-notes.md) | Português (Brasil) -Terceira pré-release pública do PGMS. É uma versão alpha para avaliação com dados sintéticos/descartáveis. Rótulo de build: M1022. Ao contrário da v0.1.0-alpha.2, esta release muda o aplicativo: acrescenta Query Statistics sobre o `pg_stat_statements`, impede que placeholders `$n` fechem a sessão da consulta e dá às linhas das grades nomes curtos para leitores de tela. Os binários são compilados e atestados pelo mesmo [workflow de release](../../.github/workflows/release.yml) da alpha.2. Trabalho próprio MIT; avisos e licenças das dependências acompanham o pacote. +Quarta pré-release pública do PGMS. É uma versão alpha para avaliação com dados sintéticos/descartáveis. Rótulo de build: M1030. Esta release refaz o Activity Monitor como aba de documento com os painéis do SSMS, acrescenta detach concorrente e subpartições ao diálogo Partitions e passa a suportar o PostgreSQL 16. Os binários são compilados e atestados pelo mesmo [workflow de release](../../.github/workflows/release.yml) da alpha.2 e da alpha.3. Trabalho próprio MIT; avisos e licenças das dependências acompanham o pacote. -## O que mudou desde a v0.1.0-alpha.2 +## O que mudou desde a v0.1.0-alpha.3 -- **Query Statistics (View → Query Statistics…).** Análise somente leitura do `pg_stat_statements` do banco conectado, com propósito parecido com o Query Store do SQL Server: chamadas, tempo de execução (total, médio, mínimo, máximo, desvio padrão), linhas, % de acerto em cache, blocos compartilhados/temporários, tempo de I/O e bytes de WAL por statement normalizado. Filtros e ordenação no servidor com limite de 1.000 linhas, cabeçalhos ordenáveis, gráfico top-N ao lado da grade, janelas acumulada/desde a linha de base/últimos 5, 15 ou 60 minutos, **Show Plan** com `EXPLAIN (GENERIC_PLAN)` numa nova aba de consulta, reset por statement e total com confirmação, auto-refresh opcional e filtros gravados por alvo de conexão. O PGMS nunca instala nem configura a extensão; a janela explica o que falta no servidor. Veja o [guia de uso](user-guide.md#estatísticas-de-consultas). -- **Placeholders `$n` não fecham mais a sessão.** Executar, explicar ou analisar SQL com placeholders do tipo `$1` falhava com o erro de protocolo 08P01, e o driver então fechava a conexão da aba. Agora o PGMS detecta os placeholders antes de enviar (ignorando literais, identificadores entre aspas, comentários e dollar quotes; `PREPARE` e corpos de funções/procedures ficam de fora), recusa o statement com **Go to Error** no placeholder e mantém a sessão aberta. **Estimated Plan** passa a usar um plano genérico. -- **Nomes mais curtos para linhas das grades em leitores de tela.** Todas as grades WPF, inclusive os resultados de consultas, nomeiam cada linha pelas primeiras colunas visíveis (por exemplo `Query ID 42, Database app, …`) em vez de expor o registro inteiro. +- **Activity Monitor em aba de documento, com seis painéis.** **View → Activity Monitor** (`Ctrl+Alt+A`) abre uma aba por servidor e role, reaproveitada ao abrir de novo. Painéis recolhíveis como no SSMS: **Overview** (gráficos de sessões ativas, sessões em espera, I/O do banco via `pg_stat_io` e transações por segundo), **Processes**, **Resource Waits** (categorias de espera amostradas), **Data File I/O** (por database), **Recent Expensive Queries** (variação do `pg_stat_statements` entre atualizações) e **Active Expensive Queries** (com **Edit Query Text** e **Show Execution Plan**, plano estimado que não executa a consulta). O menu de contexto do Overview define o intervalo e pausa, retoma ou atualiza o monitor; em pausa, o título mostra "Overview (paused)". Veja o [guia de uso](user-guide.md#activity-monitor). +- **Lista de sessões mais próxima do SSMS.** Colunas Host, **Blocked by PID** e **Head blocker** (calculado sobre `pg_locks` do servidor inteiro), dicas nos cabeçalhos, menu da linha (**Details…**, **Cancel Query**, **Terminate Session…**), diálogo **Session Details** com a consulta mais recente, filtros no servidor e páginas por PID (First/Previous/Next). A atualização automática começa ligada a cada 10 segundos, com intervalos de 1 segundo a 1 hora. +- **Partições.** **Detach concurrently** executa `DETACH PARTITION … CONCURRENTLY` fora de transação, sem bloquear consultas, com checagem prévia de partição DEFAULT e de outro detach pendente; uma partição pendente é concluída com `FINALIZE`. O diálogo também cria uma partição já particionada (**Sub-partition by**, com chave de colunas do pai), anexa tabelas particionadas e desanexa partições particionadas preservando a subárvore. +- **PostgreSQL 16.** O escopo suportado passa a ser PostgreSQL 16 a 18. O Query Statistics e o Recent Expensive Queries leem o `pg_stat_statements` 1.10 do PostgreSQL 16; versões anteriores à 1.10 são recusadas com a indicação do `ALTER EXTENSION … UPDATE` necessário. +- **Ajustes visuais.** Abas de documento inativas usam texto escuro e a seleção inativa nas grades fica azul, como no SSMS. ## Downloads -Nesta [release](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.3): +Nesta [release](https://github.com/leoars/PostgresManagementStudio/releases/tag/v0.1.0-alpha.4): | Arquivo | Finalidade | | --- | --- | -| `PGMS-0.1.0-alpha.3-Setup-x64.exe` | Instalador gráfico (inglês/pt-BR). Por usuário sem direitos de administrador, ou para todos com elevação. Não exige PowerShell nem runtime .NET separado. | -| `PGMS-0.1.0-alpha.3-win-x64.zip` | Aplicativo portátil com runtime .NET/WPF. Extraia toda a pasta e execute PGMS.exe. Inclui os scripts gerenciados PowerShell 7. | +| `PGMS-0.1.0-alpha.4-Setup-x64.exe` | Instalador gráfico (inglês/pt-BR). Por usuário sem direitos de administrador, ou para todos com elevação. Não exige PowerShell nem runtime .NET separado. | +| `PGMS-0.1.0-alpha.4-win-x64.zip` | Aplicativo portátil com runtime .NET/WPF. Extraia toda a pasta e execute PGMS.exe. Inclui os scripts gerenciados PowerShell 7. | | `SHA256SUMS.txt` | SHA256 de todos os assets desta release. Hash confere correspondência, não autoria. | | `package-manifest.json` | Manifesto SHA256 de cada arquivo dentro do ZIP, conferido por `Verify-Package.ps1`. | | `RELEASE-NOTES.md`, `RELEASE-NOTES.pt-BR.md` | Estas notas. | @@ -28,27 +30,27 @@ Os binários não são assinados digitalmente, então o SmartScreen do Windows p ```powershell Get-FileHash .\PGMS-* -Algorithm SHA256 -gh attestation verify .\PGMS-0.1.0-alpha.3-Setup-x64.exe --repo leoars/PostgresManagementStudio +gh attestation verify .\PGMS-0.1.0-alpha.4-Setup-x64.exe --repo leoars/PostgresManagementStudio ``` Compare os hashes com o `SHA256SUMS.txt`. O segundo comando exige o [GitHub CLI](https://cli.github.com/) e confirma que o arquivo foi produzido pelo workflow de release deste repositório no commit da tag; execute-o também para o ZIP. A assinatura de código pelo programa open source da SignPath Foundation está planejada; nenhuma data é prometida. ## Escopo -Editor SQL e sessões independentes, Object Explorer, Results/Messages com limites e exportação CSV/JSON, administração PostgreSQL revisada, identity/privilégios, monitor de sessões, estatísticas de consultas e backup/restore lógico. PostgreSQL 17/18 e ferramentas da mesma versão principal são necessários para operações com banco e backup/restore; não são incluídos. Query Statistics também exige a extensão `pg_stat_statements` no servidor. SSMS não é exigido nem distribuído. +Editor SQL e sessões independentes, Object Explorer, Results/Messages com limites e exportação CSV/JSON, administração PostgreSQL revisada (inclusive partições), identity/privilégios, Activity Monitor, estatísticas de consultas e backup/restore lógico. PostgreSQL 16 a 18 e ferramentas da mesma versão principal são necessários para operações com banco e backup/restore; não são incluídos. Query Statistics e Recent Expensive Queries também exigem a extensão `pg_stat_statements` no servidor. SSMS não é exigido nem distribuído. ## Validação -Comportamento do aplicativo: a fonte M1022 passou na regressão completa PostgreSQL 17.11 deste repositório (**2.236 integração + 3.315 WPF = 5.551 checks**) em cluster isolado em loopback iniciado com `pg_stat_statements` pré-carregado; o serviço PostgreSQL do host não é usado. A suíte focada de Query Statistics (`Test-Integration.ps1 -QueryStatisticsOnly`) passou em 90 checks de integração + 224 WPF. A regressão não roda no CI. A janela Query Statistics também foi comparada com o Query Store do SSMS 22.11 sob carga sintética idêntica; as diferenças estão em [validação](validation.md). +Comportamento do aplicativo: a fonte M1030 passou na regressão completa PostgreSQL 17.11 deste repositório (**2.318 integração + 3.429 WPF = 5.747 checks**) em cluster isolado em loopback iniciado com `pg_stat_statements` pré-carregado; o serviço PostgreSQL do host não é usado. Na mesma fonte, a suíte focada do Activity Monitor (`Test-Integration.ps1 -ActivityOnly`) passou em 71 checks de integração + 152 WPF no PostgreSQL 16.15 e no 18.6; a do Query Statistics passou no 16.15 e no 18.6 sobre a fonte M1029, e o código do Query Statistics não mudou depois dela. A regressão não roda no CI. O Activity Monitor foi comparado duas vezes com o do SSMS 22.11 sob a mesma carga de bloqueio; as diferenças restantes estão em [validação](validation.md). -Pipeline de release: igual ao da v0.1.0-alpha.2. O workflow valida que a tag corresponde a `installer/release.json`, `Directory.Build.props` e `BuildInfo.cs`; publica com `Publish.ps1 -SelfContained`; roda `Verify-Package.ps1`, `Test-Package.ps1` e `Test-PackageGuides.ps1`; cria o ZIP; compila o instalador com o Inno Setup 7.1.1 fixado e conferido por hash; executa um smoke informacional de abertura no runner; atesta o ZIP e o instalador; e abre uma pré-release em rascunho que o mantenedor revisa antes de publicar. Os assets do rascunho são verificados localmente antes da publicação, como na alpha.2, e o resultado é relatado no pull request da release. +Pipeline de release: igual ao da v0.1.0-alpha.2. O workflow valida que a tag corresponde a `installer/release.json`, `Directory.Build.props` e `BuildInfo.cs`; publica com `Publish.ps1 -SelfContained`; roda `Verify-Package.ps1`, `Test-Package.ps1` e `Test-PackageGuides.ps1`; cria o ZIP; compila o instalador com o Inno Setup 7.1.1 fixado e conferido por hash; executa um smoke informacional de abertura no runner; atesta o ZIP e o instalador; e abre uma pré-release em rascunho que o mantenedor revisa antes de publicar. Os assets do rascunho são verificados localmente antes da publicação, e o resultado é relatado no pull request da release. -Instalação para todos os usuários (elevada), instalação em VM Windows limpa e observações físicas de DPI/teclado/leitor de tela da nova janela não recebem nova certificação nesta release. +Instalação para todos os usuários (elevada), instalação em VM Windows limpa, regressão completa no PostgreSQL 16 e 18 e observações físicas de DPI/teclado/leitor de tela das novas telas não recebem nova certificação nesta release. ## Limites conhecidos -Somente Windows x64. Executável e instalador sem assinatura; o SmartScreen avisa. Sem MSI, atualização automática ou garantia de suporte em produção. Não se declara paridade integral SSMS. Query Statistics é um snapshot de contadores acumulados do servidor, não monitoramento contínuo: janelas deslizantes só amostram com a janela aberta, mínimo/máximo não existem para uma janela e o PostgreSQL não tem tempo de CPU por statement. A detecção de placeholders supõe `standard_conforming_strings = on` e não oferece diálogo de valores de parâmetros. Resultados/recuperação têm limites; linhas SQL grandes podem pausar renderização. Cancelar não comprova rollback. SQL de restore exige confiança e pode controlar transações, reconectar ou executar comandos locais psql. Estado DPAPI depende do usuário Windows. O hash de manifesto congelado em `installer/release.json` descreve um payload compilado localmente, não o do CI; o build no CI compara marco e versão do produto. Veja [validação](validation.md) e [segurança](../../SECURITY.pt-BR.md). +Somente Windows x64. Executável e instalador sem assinatura; o SmartScreen avisa. Sem MSI, atualização automática ou garantia de suporte em produção. Não se declara paridade integral SSMS. Activity Monitor: Data File I/O é por database, não por arquivo (o PostgreSQL não tem estatísticas por arquivo); Resource Waits é amostrado a cada atualização, não acumulado; as páginas de sessões são leituras separadas e a ordenação vale dentro da página; nenhum teste com mais de 1.000 sessões. Query Statistics é um snapshot de contadores acumulados do servidor, não monitoramento contínuo; no `pg_stat_statements` 1.10 uma janela de tempo pode contar a menos um statement removido e rastreado de novo. A detecção de placeholders supõe `standard_conforming_strings = on` e não oferece diálogo de valores de parâmetros. Resultados/recuperação têm limites; linhas SQL grandes podem pausar renderização. Cancelar não comprova rollback. SQL de restore exige confiança e pode controlar transações, reconectar ou executar comandos locais psql. Estado DPAPI depende do usuário Windows. O hash de manifesto congelado em `installer/release.json` descreve um payload compilado localmente, não o do CI; o build no CI compara marco e versão do produto. Veja [validação](validation.md) e [segurança](../../SECURITY.pt-BR.md). ## Releases anteriores -A v0.1.0-alpha.2 (01/11/2026, primeira compilada pelo CI com atestado) e a v0.1.0-alpha.1 (31/10/2026) continuam disponíveis com seus assets e notas originais. +A v0.1.0-alpha.3 (02/11/2026, Query Statistics), a v0.1.0-alpha.2 (01/11/2026, primeira compilada pelo CI com atestado) e a v0.1.0-alpha.1 (31/10/2026) continuam disponíveis com seus assets e notas originais. diff --git a/docs/pt-BR/user-guide.md b/docs/pt-BR/user-guide.md index 62b20c0..cbe7872 100644 --- a/docs/pt-BR/user-guide.md +++ b/docs/pt-BR/user-guide.md @@ -14,13 +14,26 @@ Resultados têm limites: 10.000 linhas, 100 conjuntos, 256 colunas por resultado Object Explorer carrega pastas sob demanda, filtra e inspeciona objetos. Operações suportadas oferecem preview SQL e Apply explícito. Script não inclui todas as proteções de concorrência do Apply. Use os privilégios PostgreSQL mínimos necessários; o PGMS não contorna autorização do servidor. Confira banco/schema/objeto e role antes de aplicar. -Identity e sequences distinguem START configurado de RESTART. Reiniciar pode repetir valores existentes. Privilégios, delegação, CASCADE e reconciliação de COMMIT têm regras próprias de revisão e concorrência. Activity Monitor distingue **Cancel Refresh**, **Cancel Query** e **Terminate Session**. Atualizar um snapshot não autoriza encerrar uma sessão. Veja o [índice da documentação](../README.md) para os comportamentos suportados. +Identity e sequences distinguem START configurado de RESTART. Reiniciar pode repetir valores existentes. O diálogo **Partitions** cria, anexa e desanexa partições. Uma filha nova pode ser ela própria particionada (**Sub-partition by**, com chave de colunas do pai), e uma tabela particionada pode ser anexada ou desanexada com sua subárvore. **Detach concurrently** executa `DETACH PARTITION … CONCURRENTLY` fora de transação, sem bloquear consultas; é recusado para partição DEFAULT ou quando já há outro detach pendente, e um detach pendente é concluído com `FINALIZE`. Privilégios, delegação, CASCADE e reconciliação de COMMIT têm regras próprias de revisão e concorrência. Veja o [índice da documentação](../README.md) para os comportamentos suportados. + +## Activity Monitor + +**View → Activity Monitor** (`Ctrl+Alt+A`) abre uma aba de documento para o servidor e a role conectados (`host:porta (role) - Activity Monitor`); abrir de novo ativa a mesma aba. Tem seis painéis recolhíveis, seguindo o layout do SSMS: + +- **Overview**: gráficos de sessões ativas, sessões em espera, I/O do banco (`pg_stat_io`) e transações por segundo. O menu de contexto define o intervalo de atualização e pausa, retoma ou atualiza o monitor inteiro. +- **Processes**: sessões de `pg_stat_activity` com host, estado, idade da consulta e da transação, espera, **Blocked by PID** e **Head blocker**, filtros aplicados no servidor e páginas por PID. **Details…** abre a consulta mais recente da sessão; **Cancel Query** e **Terminate Session…** agem sobre a sessão selecionada. +- **Resource Waits**: categorias de espera amostradas a cada atualização. O PostgreSQL não guarda tempo de espera acumulado, então os valores são estimativas; esperas ociosas e `pg_sleep` ficam de fora. +- **Data File I/O**: leituras, escritas temporárias, tempo de leitura e acerto de buffer por database (`pg_stat_database`), não por arquivo: o PostgreSQL não tem estatísticas por arquivo. +- **Recent Expensive Queries**: a variação de `pg_stat_statements` entre atualizações; exige a extensão, como o Query Statistics. +- **Active Expensive Queries**: comandos em execução. **Edit Query Text** abre um deles numa aba de consulta; **Show Execution Plan** mostra o plano estimado sem executá-lo. + +A atualização automática começa ligada, a cada 10 segundos, com intervalos de 1 segundo a 1 hora. **Cancel Refresh**, **Cancel Query** e **Terminate Session** são ações distintas; atualizar um snapshot não autoriza encerrar uma sessão. As páginas são leituras separadas, então uma sessão pode mudar de página, e a ordenação vale dentro da página carregada. Roles fora de `pg_read_all_stats` podem não ver consultas e esperas de outras roles. ## Estatísticas de consultas **View → Query Statistics…** lê o `pg_stat_statements` do banco conectado: statements normalizados com chamadas, tempo de execução (total, médio, mínimo, máximo, desvio padrão), linhas, % de acerto em cache, blocos compartilhados e temporários, tempo de I/O e bytes de WAL. O propósito é parecido com o Query Store do SQL Server; não é cópia das telas ou relatórios dele. -O PGMS nunca carrega, cria ou configura a extensão. O servidor precisa de `shared_preload_libraries = 'pg_stat_statements'` (com reinício) e de `CREATE EXTENSION pg_stat_statements` em um banco; quando algo falta, uma faixa amarela diz o quê. Roles fora de `pg_read_all_stats` veem os statements de outros usuários sem o texto SQL, por decisão do PostgreSQL. O tempo de I/O só é registrado com `track_io_timing` ligado. O PostgreSQL não tem tempo de CPU por statement. +O PGMS nunca carrega, cria ou configura a extensão. O servidor precisa de `shared_preload_libraries = 'pg_stat_statements'` (com reinício) e de `CREATE EXTENSION pg_stat_statements` em um banco; quando algo falta, uma faixa amarela diz o quê. Roles fora de `pg_read_all_stats` veem os statements de outros usuários sem o texto SQL, por decisão do PostgreSQL. O tempo de I/O só é registrado com `track_io_timing` ligado. O PostgreSQL não tem tempo de CPU por statement. A versão 1.10 da extensão (PostgreSQL 16) é lida sem `stats_since`: um statement removido e rastreado de novo durante uma janela de tempo pode ser contado a menos, e o status da janela avisa. Versões anteriores à 1.10 não são lidas; a faixa indica o `ALTER EXTENSION pg_stat_statements UPDATE` que um usuário privilegiado pode executar, e o PGMS não altera nada. Filtros (banco, usuário, texto SQL, mínimo de chamadas) e ordenação rodam no servidor antes do limite de 1.000 linhas. Clicar nos cabeçalhos Total, Mean, Max, Calls, Rows ou de métricas recarrega nessa ordem; os demais cabeçalhos ordenam só as linhas carregadas. **Window** mostra valores acumulados desde o último reset, desde uma linha de base gravada, ou dos últimos 5/15/60 minutos, calculados subtraindo uma leitura anterior; as janelas deslizantes só amostram enquanto a janela está aberta, e mínimo/máximo não existem para uma janela. Um gráfico top-N ao lado da grade segue a ordem aplicada. **Show Plan** abre o statement selecionado numa nova aba de consulta com `EXPLAIN (GENERIC_PLAN)`, sem executá-lo nem vincular valores aos `$n`. **Reset Selected** e **Reset All** chamam `pg_stat_statements_reset` depois de uma confirmação com Não como padrão; o servidor decide se a role pode zerar. O auto-refresh é opcional e começa desligado. Filtros, opções do gráfico e linhas de base ficam gravados por alvo de conexão na pasta de estado do PGMS, sem senhas nem resultados SQL. diff --git a/docs/pt-BR/validation.md b/docs/pt-BR/validation.md index 6a237ab..f465e19 100644 --- a/docs/pt-BR/validation.md +++ b/docs/pt-BR/validation.md @@ -2,11 +2,11 @@ [English](../en/validation.md) | Português (Brasil) -Pré-release atual: v0.1.0-alpha.3, rótulo M1022 (acrescenta Query Statistics, proteção contra placeholders e nomes de linhas das grades à fonte M1008 da alpha.1/alpha.2; compilada pelo workflow de release no GitHub Actions com atestado de proveniência de build). Marcos são identificadores internos, não garantia de identidade binária de uma recompilação local. A importação pública inicial usou M1002. Histórico operacional e provas brutas privados não são incluídos intencionalmente. +Pré-release atual: v0.1.0-alpha.4, rótulo M1030 (acrescenta a aba e os painéis do Activity Monitor, detach concorrente e subpartições e suporte ao PostgreSQL 16 à fonte M1022 da alpha.3; compilada pelo workflow de release no GitHub Actions com atestado de proveniência de build). Marcos são identificadores internos, não garantia de identidade binária de uma recompilação local. A importação pública inicial usou M1002. Histórico operacional e provas brutas privados não são incluídos intencionalmente. A implementação importada passou anteriormente em 5.187 checks automatizados (2.115 integração PostgreSQL e 3.072 WPF), além de abertura de pacote, preservação de perfil instalado e recuperação de três rascunhos entre rollback/reinício. São observações históricas, não testes novos a cada revisão. Reproduza o comportamento atual pelos scripts públicos e informe ambiente/resultados reais. As verificações da revisão pública inicial são registradas abaixo após execução. -Limites conhecidos: Windows x64; PostgreSQL 17/18 com ferramentas da mesma versão principal, cobertura histórica17.11/18.6;16 e anteriores não suportados. Sem paridade integral SSMS. Linhas SQL enormes podem pausar renderização. Resultados/recuperação têm limites. Cancelar não comprova rollback. DPAPI depende do usuário. Pacote sem assinatura/MSI/atualização automática; SmartScreen não certificado. DPI100/125/150/175% exercitados internamente;200% aceito sem execução. Reaparecimento automático após desconexão, DPAPI entre usuários e nova prova desta importação em Windows limpo não certificados. Observações de clipboard/teclado/leitor são históricas, não reproduzidas por checks WPF comuns. +Limites conhecidos: Windows x64; PostgreSQL 16 a 18 com ferramentas da mesma versão principal, regressão completa no 17.11 e suítes focadas no 16.15/18.6; 15 e anteriores não suportados. Sem paridade integral SSMS. Linhas SQL enormes podem pausar renderização. Resultados/recuperação têm limites. Cancelar não comprova rollback. DPAPI depende do usuário. Pacote sem assinatura/MSI/atualização automática; SmartScreen não certificado. DPI100/125/150/175% exercitados internamente;200% aceito sem execução. Reaparecimento automático após desconexão, DPAPI entre usuários e nova prova desta importação em Windows limpo não certificados. Observações de clipboard/teclado/leitor são históricas, não reproduzidas por checks WPF comuns. ```powershell ./scripts/Build.ps1 -Configuration Release @@ -37,3 +37,9 @@ Resultados do pacote e instalador estão nas [notas da versão](release-notes.md Uma execução completa passou em 2.236 checks de integração + 3.315 WPF = 5.551 no PostgreSQL 17.11. O cluster descartável em loopback agora inicia com `shared_preload_libraries=pg_stat_statements`; o serviço do host não é tocado, e o cluster foi encerrado ao final. A suíte focada `Test-Integration.ps1 -QueryStatisticsOnly` passou em 90 checks de integração + 224 WPF. A integração cobre detecção sem a extensão (nada é instalado), roles comuns contra `pg_read_all_stats`, filtros/ordem no servidor e a sentinela de 1.000 linhas, resets por statement e total recusados ou autorizados pelo PostgreSQL, linhas de base e janelas, planos genéricos e detecção de placeholders entre literais, comentários e dollar quotes com a sessão mantida aberta. O WPF cobre carga, cancelamento sob lock real, seleção preservada, ordenação pelo cabeçalho, gráfico, seletor de janela, preferências gravadas (inclusive arquivo corrompido preservado), nomes acessíveis das linhas e layout no tamanho mínimo. Durante o desenvolvimento, a janela foi comparada com o Query Store do SSMS 22.11 sob carga sintética idêntica, contra SQL Server LocalDB e o cluster PostgreSQL descartável. Os dois listaram os mesmos statements com contagens iguais. Diferenças encontradas na época: uma janela em vez de sete relatórios do Query Store; contadores acumulados do servidor em vez de intervalos de tempo por banco; sem gráfico, plano, leituras lógicas ou ordenação pelo cabeçalho; registros inteiros expostos como nome das linhas a leitores de tela. Ordenação pelo cabeçalho, métricas de I/O e blocos, planos genéricos, gráfico top-N, janelas de tempo e nomes curtos de linha foram acrescentados depois. Diferenças que permanecem: uma janela em vez de relatórios separados, janelas calculadas subtraindo amostras em vez de intervalos armazenados, e sem tempo de CPU por statement, que o PostgreSQL não registra. Observações físicas de DPI e leitor de tela desta janela não recebem nova certificação. + +## v0.1.0-alpha.4 / M1030 — 04/11/2026 + +Uma execução completa passou em 2.318 checks de integração + 3.429 WPF = 5.747 no PostgreSQL 17.11, no mesmo cluster descartável em loopback com `pg_stat_statements` pré-carregado; o cluster foi encerrado ao final. No checkout público, a suíte focada `Test-Integration.ps1 -ActivityOnly` passou em 71 checks de integração + 152 WPF e `-PartitionTablesOnly` em 113 de integração + 101 WPF. Sobre a mesma fonte do aplicativo, no repositório de desenvolvimento, a suíte do Activity Monitor passou em 71 checks de integração + 152 WPF no PostgreSQL 16.15 e no 18.6, com ferramentas da mesma versão principal; a do Query Statistics passou nas duas versões sobre a fonte M1029, e o código dela não mudou depois. A integração cobre cadeias de bloqueio e o head blocker entre databases, páginas por PID dentro de um mesmo snapshot, métricas do Overview a partir de `pg_stat_io` e `pg_stat_database`, esperas amostradas sem `pg_sleep`, a variação do `pg_stat_statements` entre atualizações, detach concorrente com suas pré-condições e `FINALIZE`, e criação, attach e detach de tabelas subparticionadas. O WPF cobre a aba de documento e seu reaproveitamento, painéis, gráficos, pausa/retomada, intervalos de atualização, menus da linha e do painel, Session Details e layout no tamanho mínimo. + +Durante o desenvolvimento, o Activity Monitor foi comparado duas vezes com o do SSMS 22.11, sob a mesma carga de bloqueio contra SQL Server LocalDB e o cluster PostgreSQL descartável, inclusive com cliques direitos reais no menu do Overview. As diferenças encontradas foram corrigidas, exceto estas, mantidas por decisão ou pelo que o PostgreSQL oferece: duplo clique numa sessão abre o Session Details (no SSMS não faz nada); a seleção acompanha a sessão quando a lista é reordenada (o SSMS mantém a posição); o Overview mostra sessões ativas onde o SSMS mostra tempo de processador; Data File I/O é por database porque o PostgreSQL não tem estatísticas por arquivo; Resource Waits é amostrado, não acumulado. Nada foi testado com mais de 1.000 sessões, e observações físicas de DPI e leitor de tela das novas telas não recebem nova certificação. \ No newline at end of file diff --git a/installer/release.json b/installer/release.json index aecdf73..d80102b 100644 --- a/installer/release.json +++ b/installer/release.json @@ -1,6 +1,6 @@ { - "Version": "0.1.0-alpha.3", - "NumericVersion": "0.1.0.3", - "Milestone": "M1022", - "ManifestSha256": "30E86634B287167AA91A910FD4B0DADFAE46EFB4738E42900CCC76D4C7B28E0D" + "Version": "0.1.0-alpha.4", + "NumericVersion": "0.1.0.4", + "Milestone": "M1030", + "ManifestSha256": "0BCAB13B5309F9113388BE8AED412E928A52BA4D8C53D902DBD435CACBFCBAEC" } diff --git a/src/PGMS.Desktop/ActivityChart.cs b/src/PGMS.Desktop/ActivityChart.cs new file mode 100644 index 0000000..b5a7e4b --- /dev/null +++ b/src/PGMS.Desktop/ActivityChart.cs @@ -0,0 +1,95 @@ +using System.Globalization; +using System.Windows; +using System.Windows.Automation.Peers; +using System.Windows.Media; + +namespace PGMS.Desktop; + +/// Line chart of the Activity Monitor Overview: dark plot with a green grid, like the SSMS 22.11 Overview charts. Null values are gaps. +public sealed class ActivityChart : FrameworkElement +{ + private static readonly Brush Plot = Freeze(new SolidColorBrush(Color.FromRgb(0x10, 0x10, 0x10))); + private static readonly Pen Grid = Freeze(new Pen(Freeze(new SolidColorBrush(Color.FromRgb(0x00, 0x80, 0x00))), 1)); + private static readonly Pen Line = Freeze(new Pen(Freeze(new SolidColorBrush(Color.FromRgb(0x7C, 0xFC, 0x00))), 1.5) { LineJoin = PenLineJoin.Round }); + private static readonly Brush Label = Freeze(new SolidColorBrush(Color.FromRgb(0x1E, 0x1E, 0x1E))); + private static readonly Pen Tick = Freeze(new Pen(Label, 1)); + /// Horizontal grid bands; the axis labels 0 … Scale sit on their edges, like the SSMS 0, 2 … 10 axis. + public const int Divisions = 5; + private const double AxisWidth = 34; + private IReadOnlyList values = []; + /// Points the horizontal axis spans; older readings scroll off the left edge. + public int Capacity { get; set; } = PGMS.PostgreSql.ActivityMetricsHistory.Capacity; + public IReadOnlyList Values => values; + /// Top of the vertical axis after the last update: the first 1, 2 or 5 × 10ⁿ above the largest value (at least 1). + public double Scale { get; private set; } = 1; + + public void SetValues(IReadOnlyList next) + { + values = next.TakeLast(Capacity).ToArray(); + double max = values.Where(v => v is { } x && double.IsFinite(x)).Select(v => v!.Value).DefaultIfEmpty(0).Max(); + Scale = NiceCeiling(max); + InvalidateVisual(); + } + + // Strictly above the value: a line equal to the top would lie on the plot border and vanish (M1030). + internal static double NiceCeiling(double value) + { + if (!(value >= 1)) return 1; + double magnitude = Math.Pow(10, Math.Floor(Math.Log10(value))); + foreach (double step in new[] { 1d, 2d, 5d, 10d }) if (step * magnitude > value) return step * magnitude; + return 20 * magnitude; + } + + protected override void OnRender(DrawingContext dc) + { + // The plot keeps half a label of room above and below so the top and bottom axis labels are not clipped. + const double inset = 6; + var bounds = new Rect(0, inset, ActualWidth - AxisWidth, ActualHeight - 2 * inset); + if (bounds.Width < 2 || bounds.Height < 2) return; + dc.DrawRectangle(Plot, null, bounds); + double half = Grid.Thickness / 2; + for (int i = 1; i < 10; i++) { double x = Math.Round(bounds.Width * i / 10) + half; dc.DrawLine(Grid, new Point(x, bounds.Top), new Point(x, bounds.Bottom)); } + double dip = VisualTreeHelper.GetDpi(this).PixelsPerDip; + for (int i = 0; i <= Divisions; i++) + { + double y = Math.Round(bounds.Top + bounds.Height * i / Divisions) + half; + if (i > 0 && i < Divisions) dc.DrawLine(Grid, new Point(bounds.Left, y), new Point(bounds.Right, y)); + dc.DrawLine(Tick, new Point(bounds.Right, y), new Point(bounds.Right + 3, y)); + var label = new FormattedText(AxisLabel(i), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface("Segoe UI"), 10, Label, dip); + dc.DrawText(label, new Point(bounds.Right + 5, y - label.Height / 2)); + } + if (values.Count == 0) return; + double step = bounds.Width / Math.Max(1, Capacity - 1), offset = Capacity - values.Count; + Point Map(int i, double v) => new((offset + i) * step, bounds.Bottom - 1 - Math.Clamp(v / Scale, 0, 1) * (bounds.Height - 2)); + var geometry = new StreamGeometry(); + using (var g = geometry.Open()) + { + bool open = false; + for (int i = 0; i < values.Count; i++) + { + if (values[i] is not { } v || !double.IsFinite(v)) { open = false; continue; } + var p = Map(i, v); + if (!open) { g.BeginFigure(p, false, false); open = true; } + else g.LineTo(p, true, true); + } + } + geometry.Freeze(); + dc.DrawGeometry(null, Line, geometry); + // A single reading has no segment; mark it so the chart is not empty. + for (int i = 0; i < values.Count; i++) + if (values[i] is { } v && double.IsFinite(v) && (i == 0 || values[i - 1] is null) && (i == values.Count - 1 || values[i + 1] is null)) + dc.DrawEllipse(Line.Brush, null, Map(i, v), 2, 2); + } + + /// Axis label of grid line , counted from the top: Scale at 0, zero at . + public string AxisLabel(int line) => (Scale * (Divisions - line) / Divisions).ToString("G4", CultureInfo.InvariantCulture); + + protected override AutomationPeer OnCreateAutomationPeer() => new ChartPeer(this); + private sealed class ChartPeer(ActivityChart owner) : FrameworkElementAutomationPeer(owner) + { + protected override AutomationControlType GetAutomationControlTypeCore() => AutomationControlType.Image; + protected override string GetClassNameCore() => nameof(ActivityChart); + } + + private static T Freeze(T value) where T : Freezable { value.Freeze(); return value; } +} diff --git a/src/PGMS.Desktop/ActivityMonitorView.xaml b/src/PGMS.Desktop/ActivityMonitorView.xaml new file mode 100644 index 0000000..86c02ae --- /dev/null +++ b/src/PGMS.Desktop/ActivityMonitorView.xaml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + +