Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows installer will create a non working service installation if paths are changed from defaults #209

Open
tps800 opened this issue Nov 26, 2024 · 3 comments

Comments

@tps800
Copy link

tps800 commented Nov 26, 2024

If installing PostgreSQL and you are changing paths from defaults, all seems fine, until you try to start the installed service: postgresql-x64-16.6 (for the latest 16). looking at the logs you'll see pg_ctl.exe not finding postgres.exe.

It does not help to define PGPATH to reflect your install path, nor does it help to add the install path to the system path. pg_ctl.exe keeps not finding postgres.exe. It looks like pg_ctl.exe depends on having postgres.exe installed into %ProgramFiles%\PostgreSQL\16\bin\postgres.exe if it is started without stdin, stdout and stderr as is the case with Windows services.

If you'll start cmd.exe as system or an administrator, then call pg_ctl.exe, if postgres.exe is within %PATH%, it will start postgres.exe without hassles. The commandline windows cant be closed then, because the running postgres.exe blocks stdin, stdout, and stderr. Killing this window will bring postgres.exe down with a pipe error. Mostly because stdout went away.

What I'd expect would be, the installer using the given install paths to find postgres.exe not relying on paths build in or retrived in some other way from the system by pg_ctl.exe.

@tps800
Copy link
Author

tps800 commented Nov 26, 2024

Same for PostgreSQL installers for

  • 17
  • 16
  • 15
  • 14

if install paths are changed from defaults.

@SletZh
Copy link

SletZh commented Nov 30, 2024

I changed the default installation directory of PostgreSQL, now I cannot connect to the database service.

@sandeep-edb
Copy link
Contributor

The installer is relocatable and expected to work fine. Please share the installation log

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

No branches or pull requests

3 participants