Skip to content

Fix Windows CI update for Postgresql 17#80

Merged
arkhipov merged 1 commit intoarkhipov:pg-17from
mmizutani:pg-17-revisit
Jan 12, 2026
Merged

Fix Windows CI update for Postgresql 17#80
arkhipov merged 1 commit intoarkhipov:pg-17from
mmizutani:pg-17-revisit

Conversation

@mmizutani
Copy link
Copy Markdown
Contributor

@mmizutani mmizutani commented Jan 12, 2026

Summary

This PR fixes the failures of the Windows Server 2025 x PostgreSQL 14/17 CI tests in the original PR

Observed CI failures

The error logs of the failed CI runs in the original PR #78 seem to have expired and are no longer available, so I re-ran the CI in my forked repo and observed the following failures in the Windows latest (2025) x {pg14, pg17} cases:

https://github.com/mmizutani/temporal_tables/actions/runs/20904227684

  • windows 2025 x pg14
    • "The term 'C:\Program Files\PostgreSQL\14\uninstall-postgresql.exe' is not recognized as a name of a cmdlet, | function, script file, or executable program."
  • windows 2025 x pg17
    • pg_ctl reported: service "postgresql-x64-17" already registered
      • Windows service collision: the runner already had a postgresql-x64-17 service registered. The workflow attempted to pg_ctl register the same service name, so the service registration did not reliably point at the newly initialized C:\\pgdata cluster.
      • Port ambiguity/conflict: without an explicit port, the service could bind to a default port already in use (or connect to a different instance).
    • Get-Content .\\regression.diffs | Out-Printer then failed with: Cannot find path ... regression.diffs because it does not exist

These failures might be different from what the original PR saw two months ago, though.

Key changes

This PR fixes the CI failures above with the following changes:

  • Change the version of the preinstalled postgres to uninstall in the "Install PostgreSQL" step from 14 to 17
  • Prevent the windows-2025 runner’s preinstalled pg17 service from interfering with the test cluster
    • clean up existing service and data dir
      • If the service exists, stop it and pg_ctl unregister it before initializing/registering the new cluster.
      • Remove C:\\pgdata before initdb.
    • Pin the test instance to a dedicated port
      • Set PGPORT=55432 and register the service with -o "-p 55432".
      • Set PGHOST=localhost to make connections explicit.
  • Minor enhancements:
    • Stabilize pg_regress invocation and outputs
      • Prepend PG_ROOT\\bin to PATH to stabilize DLL resolution.
    • Print regression.diffs only if it is present

With these fixes, the Windows 2025 CI matrix tests are passing for all the versions of Postgres 9.3 - 17.0:
https://github.com/mmizutani/temporal_tables/actions/runs/20908057518

windows build (17.0-1, x64)

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           9/25/2024  8:09 AM         143872 pg_regress.exe
# using postmaster on localhost, port 55432
ok 1         - install                                    69 ms
ok 2         - no_system_period                           66 ms
ok 3         - invalid_system_period                      86 ms
ok 4         - no_history_table                           68 ms
ok 5         - no_history_system_period                   76 ms
ok 6         - invalid_types                              76 ms
ok 7         - invalid_system_period_values               77 ms
ok 8         - versioning                                526 ms
ok 9         - versioning_custom_system_time             100 ms
ok 10        - structure                                 617 ms
ok 11        - uninstall                                  59 ms
1..11
# All 11 tests passed.

@mmizutani mmizutani mentioned this pull request Jan 12, 2026
…ion, clean up services, and stabilize test execution
@arkhipov arkhipov merged commit 90b251b into arkhipov:pg-17 Jan 12, 2026
29 checks passed
@mmizutani mmizutani deleted the pg-17-revisit branch January 31, 2026 02:48
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.

2 participants