Skip to content

Always list PostgreSQL 18 to 12 in the backup dialog, with an install guide - #42

Merged
necessarylion merged 3 commits into
mainfrom
pg-tool-guide
Nov 8, 2026
Merged

necessarylion merged 3 commits into
mainfrom
pg-tool-guide

Conversation

@necessarylion

Copy link
Copy Markdown
Owner

Problem

The PostgreSQL backup and restore dialog listed only the pg_dump / pg_restore versions found on this computer. A user with no matching version did not see what to install.

What changed

  • The version select always lists PostgreSQL 18, 17, 16, 15, 14, 13 and 12 (PG_TOOL_VERSIONS). Another installed version, like 11, is listed too.
  • An installed version shows its full version, like "PostgreSQL 17.6". A missing one says "(not installed)".
  • The default is the same as before: the installed version of the server, else the newest installed one. With no tool at all, it picks the server version, so the guide shows for it.
  • When a missing version is picked, Back up / Restore is off and a short install guide shows (PgInstallGuide):
    • macOS: brew install postgresql@N, plus Postgres.app and the EDB installer if Homebrew no longer has it.
    • Linux: sudo apt install postgresql-client-N (apt repo link) and sudo dnf install postgresqlN (PGDG link).
    • Windows: the EDB installer, tick only "Command Line Tools".
  • Each command has a Copy button. "Check again" reloads the list without closing the dialog and keeps the picked version.
  • The app had no way to open a web page, so there is a small open_link command. It opens only https:// links, with open, xdg-open or explorer.
  • The "not found" error of the backend now points to the guide.
  • The app does not download or install any tool.

Fixes from the review of #41

  • A cancelled restore keeps its "Restore cancelled" status when the reload of the tables fails.
  • A slow tool list from an older open of the dialog is dropped (PgToolLoader).

Checks

  • bun run lint, bun run typecheck, bun test (400 pass)
  • cargo clippy --all-targets (no warnings), cargo test, cargo fmt
  • cargo test --test service with Docker PostgreSQL 17: pass. It found pg_dump 17 (libpq@17) and 15 (/opt/homebrew/opt/postgresql@15/bin), so the Homebrew path after brew install postgresql@N is found.

…install a missing version

The backup and restore dialog listed only the pg_dump and pg_restore versions found on
this computer. Now it always lists PostgreSQL 18 to 12. A missing version is marked
"not installed". When the user picks it, the button is off and a short install guide
for this platform shows, with a Copy button and a Check again button. The app does
not download or install any tool.

Also:
- An installed version shows its full version, like PostgreSQL 17.6.
- The "not found" error now points to the guide.
- A slow tool list from an older open of the dialog is dropped.
- A cancelled restore keeps its status when the reload of the tables fails.
- Show brew install only for PostgreSQL 15 to 18. Homebrew has disabled the older ones.
- Find tools from the macOS EDB installer in /Library/PostgreSQL.
- open_link opens only the guide links, and waits for the opener so no process is left.
- The Linux guide says old versions may need the PGDG archive repository.
@necessarylion
necessarylion merged commit 32c280a into main Nov 8, 2026
5 checks passed
@necessarylion
necessarylion deleted the pg-tool-guide branch November 8, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant