pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres service not starting on windows after install if not installed into standard locations
8+ messages / 3 participants
[nested] [flat]
* Postgres service not starting on windows after install if not installed into standard locations
@ 2024-11-18 17:22 Thomas Schweikle <tschweikle@bfs.de>
2024-11-18 17:48 ` Re: Postgres service not starting on windows after install if not installed into standard locations Adrian Klaver <adrian.klaver@aklaver.com>
2024-11-18 18:43 ` Re: Postgres service not starting on windows after install if not installed into standard locations Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 2 replies; 8+ messages in thread
From: Thomas Schweikle @ 2024-11-18 17:22 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Hi!
Had installed PostgreSQL 16.5 on Windows 10:
Install directory: "C:\PRGS\pgSQL\16"
DB-Directory: "C:\DB\pgSQL\16\data"
Environment variable "PGDATA" is set to "C:\DB\pgSQL\16\data".
Initialized the database. Then started postgres services using:
c:\PRGS\pgSQL\16\bin\pg_ctl.exe start
Worked nice. Server starts, the serves as expected. But: if I try to
start the service by "net start pgSQL" I am reported that "pg_ctl.exe"
could not find "postgres.exe".
What I've tried:
- added environment variable "PGPATH" pointing to "C:\PRGS\pgSQL\16\bin"
-> did not help.
- added "C:\PRGS\pgSQL\16\bin" to path. -> did not help either, even
after rebooting. I've added it to system path.
Are paths somewhere within some configuration file or registry entry?
And set to standard install locations?
Any idea is welcome to solve this problem!
--
Thomas
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Postgres service not starting on windows after install if not installed into standard locations
2024-11-18 17:22 Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
@ 2024-11-18 17:48 ` Adrian Klaver <adrian.klaver@aklaver.com>
2024-11-20 10:10 ` Re: Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
1 sibling, 1 reply; 8+ messages in thread
From: Adrian Klaver @ 2024-11-18 17:48 UTC (permalink / raw)
To: Thomas Schweikle <tschweikle@bfs.de>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On 11/18/24 09:22, Thomas Schweikle wrote:
> Hi!
>
> Had installed PostgreSQL 16.5 on Windows 10:
Using what installer?
>
> Install directory: "C:\PRGS\pgSQL\16"
> DB-Directory: "C:\DB\pgSQL\16\data"
>
> Environment variable "PGDATA" is set to "C:\DB\pgSQL\16\data".
>
> Initialized the database. Then started postgres services using:
>
> c:\PRGS\pgSQL\16\bin\pg_ctl.exe start
>
> Worked nice. Server starts, the serves as expected. But: if I try to
> start the service by "net start pgSQL" I am reported that "pg_ctl.exe"
> could not find "postgres.exe".
>
> What I've tried:
> - added environment variable "PGPATH" pointing to "C:\PRGS\pgSQL\16\bin"
> -> did not help.
>
> - added "C:\PRGS\pgSQL\16\bin" to path. -> did not help either, even
> after rebooting. I've added it to system path.
>
> Are paths somewhere within some configuration file or registry entry?
> And set to standard install locations?
>
> Any idea is welcome to solve this problem!
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Postgres service not starting on windows after install if not installed into standard locations
2024-11-18 17:22 Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
2024-11-18 17:48 ` Re: Postgres service not starting on windows after install if not installed into standard locations Adrian Klaver <adrian.klaver@aklaver.com>
@ 2024-11-20 10:10 ` Thomas Schweikle <tschweikle@bfs.de>
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Schweikle @ 2024-11-20 10:10 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Am Mo., 18.Nov..2024 um 18:48:56 schrieb Adrian Klaver:
> On 11/18/24 09:22, Thomas Schweikle wrote:
>> Hi!
>>
>> Had installed PostgreSQL 16.5 on Windows 10:
>
> Using what installer?
postgresql-16.5-1-windows-x64.exe as found on
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
>> Install directory: "C:\PRGS\pgSQL\16"
>> DB-Directory: "C:\DB\pgSQL\16\data"
>>
>> Environment variable "PGDATA" is set to "C:\DB\pgSQL\16\data".
>>
>> Initialized the database. Then started postgres services using:
>>
>> c:\PRGS\pgSQL\16\bin\pg_ctl.exe start
>>
>> Worked nice. Server starts, the serves as expected. But: if I try to
>> start the service by "net start pgSQL" I am reported that "pg_ctl.exe"
>> could not find "postgres.exe".
>>
>> What I've tried:
>> - added environment variable "PGPATH" pointing to "C:\PRGS\pgSQL\16\bin"
>> -> did not help.
>>
>> - added "C:\PRGS\pgSQL\16\bin" to path. -> did not help either, even
>> after rebooting. I've added it to system path.
>>
>> Are paths somewhere within some configuration file or registry entry?
>> And set to standard install locations?
>>
>> Any idea is welcome to solve this problem!
--
Thomas
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Postgres service not starting on windows after install if not installed into standard locations
2024-11-18 17:22 Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
@ 2024-11-18 18:43 ` Laurenz Albe <laurenz.albe@cybertec.at>
2024-11-20 13:26 ` Re: Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
1 sibling, 1 reply; 8+ messages in thread
From: Laurenz Albe @ 2024-11-18 18:43 UTC (permalink / raw)
To: Thomas Schweikle <tschweikle@bfs.de>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On Mon, 2024-11-18 at 17:22 +0000, Thomas Schweikle wrote:
> Had installed PostgreSQL 16.5 on Windows 10:
>
> Install directory: "C:\PRGS\pgSQL\16"
> DB-Directory: "C:\DB\pgSQL\16\data"
>
> Environment variable "PGDATA" is set to "C:\DB\pgSQL\16\data".
>
> Initialized the database. Then started postgres services using:
>
> c:\PRGS\pgSQL\16\bin\pg_ctl.exe start
>
> Worked nice. Server starts, the serves as expected. But: if I try to
> start the service by "net start pgSQL" I am reported that "pg_ctl.exe"
> could not find "postgres.exe".
>
> What I've tried:
> - added environment variable "PGPATH" pointing to "C:\PRGS\pgSQL\16\bin"
> -> did not help.
>
> - added "C:\PRGS\pgSQL\16\bin" to path. -> did not help either, even
> after rebooting. I've added it to system path.
>
> Are paths somewhere within some configuration file or registry entry?
> And set to standard install locations?
How exactly is the Windows service defined?
Perhaps you need to use an absolute path for the executable.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Postgres service not starting on windows after install if not installed into standard locations
2024-11-18 17:22 Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
2024-11-18 18:43 ` Re: Postgres service not starting on windows after install if not installed into standard locations Laurenz Albe <laurenz.albe@cybertec.at>
@ 2024-11-20 13:26 ` Thomas Schweikle <tschweikle@bfs.de>
2024-11-20 17:15 ` Re: Postgres service not starting on windows after install if not installed into standard locations Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Schweikle @ 2024-11-20 13:26 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Am Mo., 18.Nov..2024 um 19:43:36 schrieb Laurenz Albe:
> On Mon, 2024-11-18 at 17:22 +0000, Thomas Schweikle wrote:
>> Had installed PostgreSQL 16.5 on Windows 10:
>>
>> Install directory: "C:\PRGS\pgSQL\16"
>> DB-Directory: "C:\DB\pgSQL\16\data"
>>
>> Environment variable "PGDATA" is set to "C:\DB\pgSQL\16\data".
>>
>> Initialized the database. Then started postgres services using:
>>
>> c:\PRGS\pgSQL\16\bin\pg_ctl.exe start
>>
>> Worked nice. Server starts, the serves as expected. But: if I try to
>> start the service by "net start pgSQL" I am reported that "pg_ctl.exe"
>> could not find "postgres.exe".
>>
>> What I've tried:
>> - added environment variable "PGPATH" pointing to "C:\PRGS\pgSQL\16\bin"
>> -> did not help.
>>
>> - added "C:\PRGS\pgSQL\16\bin" to path. -> did not help either, even
>> after rebooting. I've added it to system path.
>>
>> Are paths somewhere within some configuration file or registry entry?
>> And set to standard install locations?
>
> How exactly is the Windows service defined?
> Perhaps you need to use an absolute path for the executable.
Servicename: postgresql-x64-16
Name: postgresql-x64-16-PostgreSQL Server 16
Comment: Provides relational database storage
Path: "C:\PRGS\pgSQL\16\bin\pg_ctl.exe"
runservice -N "postgresql-x64-16"
-D "C:\DB\pgSQL\16\data" -w
Type: Automatic
Account: Networkservice
Password: set
Dependencies:RPC, DCOM-Service, RPC-Endpoint
Errors found within system logs:
pg_ctl: could not find program 'postgres.exe'
Seems, since "C:\PRGS\pgSQL\16\bin" is in system path, it does not
search there at all:
# dir "C:\PRGS\pgSQL\16\bin"
[...]
Mi, 13.Nov.2024 13:24 123.392 pg_ctl.exe
[...]
Mi, 13.Nov.2024 13:24 8.659.968 postgres.exe
Any way to tell a service in Windows to use a path?
Any registry key to assign a path to?
# sc qc "postgresql-x64-16"
[SC] QueryServiceConfig ERFOLG
SERVICE_NAME: postgresql-x64-16
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : "C:\PRGS\pgSQL\16\bin\pg_ctl.exe"
runservice -N "postgresql-x64-16" -D "C:\DB\pgSQL\16\data" -w
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : postgresql-x64-16 - PostgreSQL Server 16
DEPENDENCIES : RPCSS
SERVICE_START_NAME : NT AUTHORITY\NetworkService
--
Thomas
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Postgres service not starting on windows after install if not installed into standard locations
2024-11-18 17:22 Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
2024-11-18 18:43 ` Re: Postgres service not starting on windows after install if not installed into standard locations Laurenz Albe <laurenz.albe@cybertec.at>
2024-11-20 13:26 ` Re: Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
@ 2024-11-20 17:15 ` Adrian Klaver <adrian.klaver@aklaver.com>
2024-11-21 14:10 ` Re: Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
0 siblings, 1 reply; 8+ messages in thread
From: Adrian Klaver @ 2024-11-20 17:15 UTC (permalink / raw)
To: Thomas Schweikle <tschweikle@bfs.de>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On 11/20/24 05:26, Thomas Schweikle wrote:
> Am Mo., 18.Nov..2024 um 19:43:36 schrieb Laurenz Albe:
>> On Mon, 2024-11-18 at 17:22 +0000, Thomas Schweikle wrote:
>>> Had installed PostgreSQL 16.5 on Windows 10:
>> How exactly is the Windows service defined?
>> Perhaps you need to use an absolute path for the executable.
>
> Servicename: postgresql-x64-16
> Name: postgresql-x64-16-PostgreSQL Server 16
> Comment: Provides relational database storage
> Path: "C:\PRGS\pgSQL\16\bin\pg_ctl.exe"
> runservice -N "postgresql-x64-16"
> -D "C:\DB\pgSQL\16\data" -w
> Type: Automatic
> Account: Networkservice
> Password: set
> Dependencies:RPC, DCOM-Service, RPC-Endpoint
Did you change settings during the install?
Here on my Windows machine I get:
C:\Program Files\PostgreSQL\bin
>
> Errors found within system logs:
> pg_ctl: could not find program 'postgres.exe'
>
> Seems, since "C:\PRGS\pgSQL\16\bin" is in system path, it does not
> search there at all:
>
> # dir "C:\PRGS\pgSQL\16\bin"
> [...]
> Mi, 13.Nov.2024 13:24 123.392 pg_ctl.exe
> [...]
> Mi, 13.Nov.2024 13:24 8.659.968 postgres.exe
>
> Any way to tell a service in Windows to use a path?
> Any registry key to assign a path to?
>
> # sc qc "postgresql-x64-16"
> [SC] QueryServiceConfig ERFOLG
>
> SERVICE_NAME: postgresql-x64-16
> TYPE : 10 WIN32_OWN_PROCESS
> START_TYPE : 2 AUTO_START
> ERROR_CONTROL : 1 NORMAL
> BINARY_PATH_NAME : "C:\PRGS\pgSQL\16\bin\pg_ctl.exe"
> runservice -N "postgresql-x64-16" -D "C:\DB\pgSQL\16\data" -w
> LOAD_ORDER_GROUP :
> TAG : 0
> DISPLAY_NAME : postgresql-x64-16 - PostgreSQL Server 16
> DEPENDENCIES : RPCSS
> SERVICE_START_NAME : NT AUTHORITY\NetworkService
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Postgres service not starting on windows after install if not installed into standard locations
2024-11-18 17:22 Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
2024-11-18 18:43 ` Re: Postgres service not starting on windows after install if not installed into standard locations Laurenz Albe <laurenz.albe@cybertec.at>
2024-11-20 13:26 ` Re: Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
2024-11-20 17:15 ` Re: Postgres service not starting on windows after install if not installed into standard locations Adrian Klaver <adrian.klaver@aklaver.com>
@ 2024-11-21 14:10 ` Thomas Schweikle <tschweikle@bfs.de>
2024-11-21 16:45 ` Re: Postgres service not starting on windows after install if not installed into standard locations Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Schweikle @ 2024-11-21 14:10 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Am Mi., 20.Nov..2024 um 18:15:42 schrieb Adrian Klaver:
> On 11/20/24 05:26, Thomas Schweikle wrote:
>> Am Mo., 18.Nov..2024 um 19:43:36 schrieb Laurenz Albe:
>>> On Mon, 2024-11-18 at 17:22 +0000, Thomas Schweikle wrote:
>>>> Had installed PostgreSQL 16.5 on Windows 10:
>
>>> How exactly is the Windows service defined?
>>> Perhaps you need to use an absolute path for the executable.
>>
>> Servicename: postgresql-x64-16
>> Name: postgresql-x64-16-PostgreSQL Server 16
>> Comment: Provides relational database storage
>> Path: "C:\PRGS\pgSQL\16\bin\pg_ctl.exe"
>> runservice -N "postgresql-x64-16"
>> -D "C:\DB\pgSQL\16\data" -w
>> Type: Automatic
>> Account: Networkservice
>> Password: set
>> Dependencies:RPC, DCOM-Service, RPC-Endpoint
>
>
> Did you change settings during the install?
I called the installer with:
.\postgresql-16.5-1-windows-x64.exe
Then changed install path to: "C:\PRGS\pgSQL"
And database path to: "C:\DB\pgSQL"
After a while postgres got installed into "C:\PRGS\pgSQL\16" and the
database path was created: "C:\DB\pgSQL\16\data", but the database was
not created. Calling pg_initdb did the job and created the database
within the given folder.
Calling "pg_ctl start" gave a message, that "pg_ctl.exe" could not find
"postgres.exe" -- I prepended "C:\PRGS\pgSQL\16\bin" to %PATH%. Next
thing was that pg_ctl could not find the just, with pg_initdb, created
database. So I've set up PGDATA to point to "C:\DB\pgSQL\16\data". Both
within the global system environment of windows.
Tried again to start postgres via "pg_ctl start". This time postgres got
up and running instantly.
Then stopped postgres again: "pg_ctl.exe stop". And tried it using "net
start postgresql-x64-16". This failed. "pg_ctl.exe" called could not
find "postgres.exe".
Looking at the logs "pg_ctl.exe" stated it could not find "postgres.exe"
again. Since %PGDATA% and %PATH% where set within system environment
these are to be global and shall be active for services too.
Looking closer on "pg_ctl.exe" I found it using a build in path of
"C:\Program files\PostgreSQL\16\bin\postgres.exe", regardless of any
environment variables set if started without any of stdout, stdin,
stderr, what is the case if it is started as a service.
> Here on my Windows machine I get:
>
> C:\Program Files\PostgreSQL\bin
>> Errors found within system logs:
>> pg_ctl: could not find program 'postgres.exe'
>>
>> Seems, since "C:\PRGS\pgSQL\16\bin" is in system path, it does not
>> search there at all:
>>
>> # dir "C:\PRGS\pgSQL\16\bin"
>> [...]
>> Mi, 13.Nov.2024 13:24 123.392 pg_ctl.exe
>> [...]
>> Mi, 13.Nov.2024 13:24 8.659.968 postgres.exe
>>
>> Any way to tell a service in Windows to use a path?
>> Any registry key to assign a path to?
>>
>> # sc qc "postgresql-x64-16"
>> [SC] QueryServiceConfig ERFOLG
>>
>> SERVICE_NAME: postgresql-x64-16
>> TYPE : 10 WIN32_OWN_PROCESS
>> START_TYPE : 2 AUTO_START
>> ERROR_CONTROL : 1 NORMAL
>> BINARY_PATH_NAME : "C:\PRGS\pgSQL\16\bin\pg_ctl.exe"
>> runservice -N "postgresql-x64-16" -D "C:\DB\pgSQL\16\data" -w
>> LOAD_ORDER_GROUP :
>> TAG : 0
>> DISPLAY_NAME : postgresql-x64-16 - PostgreSQL Server 16
>> DEPENDENCIES : RPCSS
>> SERVICE_START_NAME : NT AUTHORITY\NetworkService
>>
>>
>
--
Thomas
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Postgres service not starting on windows after install if not installed into standard locations
2024-11-18 17:22 Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
2024-11-18 18:43 ` Re: Postgres service not starting on windows after install if not installed into standard locations Laurenz Albe <laurenz.albe@cybertec.at>
2024-11-20 13:26 ` Re: Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
2024-11-20 17:15 ` Re: Postgres service not starting on windows after install if not installed into standard locations Adrian Klaver <adrian.klaver@aklaver.com>
2024-11-21 14:10 ` Re: Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
@ 2024-11-21 16:45 ` Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 0 replies; 8+ messages in thread
From: Adrian Klaver @ 2024-11-21 16:45 UTC (permalink / raw)
To: Thomas Schweikle <tschweikle@bfs.de>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On 11/21/24 06:10, Thomas Schweikle wrote:
> Am Mi., 20.Nov..2024 um 18:15:42 schrieb Adrian Klaver:
>> On 11/20/24 05:26, Thomas Schweikle wrote:
>>> Am Mo., 18.Nov..2024 um 19:43:36 schrieb Laurenz Albe:
>>>> On Mon, 2024-11-18 at 17:22 +0000, Thomas Schweikle wrote:
>>>>> Had installed PostgreSQL 16.5 on Windows 10:
>> Did you change settings during the install?
>
> I called the installer with:
>
> .\postgresql-16.5-1-windows-x64.exe
>
> Then changed install path to: "C:\PRGS\pgSQL"
> And database path to: "C:\DB\pgSQL"
>
> After a while postgres got installed into "C:\PRGS\pgSQL\16" and the
> database path was created: "C:\DB\pgSQL\16\data", but the database was
> not created. Calling pg_initdb did the job and created the database
> within the given folder.
>
> Calling "pg_ctl start" gave a message, that "pg_ctl.exe" could not find
> "postgres.exe" -- I prepended "C:\PRGS\pgSQL\16\bin" to %PATH%. Next
> thing was that pg_ctl could not find the just, with pg_initdb, created
> database. So I've set up PGDATA to point to "C:\DB\pgSQL\16\data". Both
> within the global system environment of windows.
>
> Tried again to start postgres via "pg_ctl start". This time postgres got
> up and running instantly.
>
> Then stopped postgres again: "pg_ctl.exe stop". And tried it using "net
> start postgresql-x64-16". This failed. "pg_ctl.exe" called could not
> find "postgres.exe".
>
> Looking at the logs "pg_ctl.exe" stated it could not find "postgres.exe"
> again. Since %PGDATA% and %PATH% where set within system environment
> these are to be global and shall be active for services too.
>
> Looking closer on "pg_ctl.exe" I found it using a build in path of
> "C:\Program files\PostgreSQL\16\bin\postgres.exe", regardless of any
> environment variables set if started without any of stdout, stdin,
> stderr, what is the case if it is started as a service.
>
Looks like your choices are:
1) Keep the default paths during the install.
2) Raise an issue here:
https://github.com/EnterpriseDB/edb-installers/issues
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2024-11-21 16:45 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-11-18 17:22 Postgres service not starting on windows after install if not installed into standard locations Thomas Schweikle <tschweikle@bfs.de>
2024-11-18 17:48 ` Adrian Klaver <adrian.klaver@aklaver.com>
2024-11-20 10:10 ` Thomas Schweikle <tschweikle@bfs.de>
2024-11-18 18:43 ` Laurenz Albe <laurenz.albe@cybertec.at>
2024-11-20 13:26 ` Thomas Schweikle <tschweikle@bfs.de>
2024-11-20 17:15 ` Adrian Klaver <adrian.klaver@aklaver.com>
2024-11-21 14:10 ` Thomas Schweikle <tschweikle@bfs.de>
2024-11-21 16:45 ` Adrian Klaver <adrian.klaver@aklaver.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox