Repository navigation
feat(installer)!: find PostgreSQL by its service, not EDB keys - #26
Merged
Merged
Conversation
Setup found the PostgreSQL it configures through EDB's HKLM\SOFTWARE\PostgreSQL registration. A server installed without EDB was invisible to it, and the registry had states of its own that led nowhere: an incomplete or orphaned registration and a registered port nothing answered on. Setup now runs a new read-only command, semibase engine, which reads the Windows service list with query-only rights and keeps the services whose command line runs pg_ctl.exe runservice -D <data>. Everything else follows from that line and the data folder: the major from PG_VERSION (the N.M form before 10 included), the configured port from -o, then postgresql.auto.conf, then postgresql.conf with its includes, and the listening port from postmaster.pid. It classifies the machine as found, fresh, ambiguous, incomplete, unreadable, port-mismatch or other-major, and Setup maps each to a page or a refusal that never sends the reader to uninstall a server whose only fault is its configuration. A service of another major beside the 17 does not stop it. Two limits come with it: the superuser is postgres on every machine, and a server whose administrator has another name, or a PostgreSQL that runs with no Windows service, is outside what Setup configures. The CI installer job builds every state with fake services and asserts each refusal and its detail line. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mrcsin
force-pushed
the
setup-without-registry
branch
from
October 28, 2026 08:38
c12baac to
e57474e
Compare
mrcsin
marked this pull request as ready for review
October 28, 2026 08:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Setup found the PostgreSQL it configures through EDB's
HKLM\SOFTWARE\PostgreSQLregistration. A server installed without EDB was invisible to it, and the registry had dead-end states of its own: an incomplete or orphaned registration and a registered port nothing answered on.Change
semibase engine --expected-major 17(internal/engine): reads the Windows service list with query-only rights, keeps the services whose command line runspg_ctl.exe runservice -D <data>, and prints the state askey=valuelines.PG_VERSION(the pre-10N.Mform included), the configured port from-o,postgresql.auto.conf, thenpostgresql.confwith its includes, the listening port frompostmaster.pid.found,fresh,ambiguous,incomplete,unreadable,port-mismatch,other-major.Installer/SemiBase.issmaps each to a page or a refusal; a configuration error never leads to "remove PostgreSQL". A service of another major beside the 17 does not stop Setup.grep -cF 'SOFTWARE\PostgreSQL' Installer/SemiBase.issis 0, 3 on master) and no longer passes--superuser.AGENTS.mdanddocs/architecturedescribe the service-list detection; the plan is archived indocs/plans/completed/.Breaking: the superuser is
postgreson every machine, and a PostgreSQL that runs with no Windows service is outside what Setup configures.Verification
semibase engine --expected-major 17printsstate=found,postgresql-x64-17, port 5432, withpostgresql-14running beside it.postgresql-x64-17with no restart; the site log ends withDone: site completed against localhost:5432/scada_archive.The readable server error text in the site log is a separate PR from branch
decode-server-errors.Per-task commits before collapse
🤖 Generated with Claude Code