pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #18459: running pg_ctl.exe from inside a program running as a Windows service returns "error code 6"
2+ messages / 2 participants
[nested] [flat]

* BUG #18459: running pg_ctl.exe from inside a program running as a Windows service returns "error code 6"
@ 2024-05-09 18:28 PG Bug reporting form <noreply@postgresql.org>
  2025-09-02 15:57 ` Re: BUG #18459: running pg_ctl.exe from inside a program running as a Windows service returns "error code 6" Martin Fernau <martin.fernau@fernausoft.de>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2024-05-09 18:28 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: rfrank@riministreet.com

The following bug has been logged on the website:

Bug reference:      18459
Logged by:          Rick Frank
Email address:      rfrank@riministreet.com
PostgreSQL version: 15.3
Operating system:   Windows
Description:        

We have a program written in Go that launches postgressql. Postgres starts
as a separate process, but under control of our program. This works fine
running the program interactively with our program in a folder under
“C:\Program Files”.  But Postgres won’t start when we run our program as a
Windows service, even if the postgres programs and database are in a
different folder.  If we have our program in any folder except “C:\Program
Files”, it works running as a service.
  
I tried with the service running under "Local System" and with a named
Administrator account; same error each time. I made sure that all users have
Full Control permissions to the folder where Postgres resides. Postgres
programs and data are in the same folder, in "C:\ProgramData" folder.

The program is using a Go package called embedded-postgres. That package
starts Postgres using pg_ctl.exe. Here is the error that pg_ctl.exe
returns:
     "pg_ctl: could not start server: error code 6"

I can’t find any info saying what this message means.  Any ideas what this
means?



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #18459: running pg_ctl.exe from inside a program running as a Windows service returns "error code 6"
  2024-05-09 18:28 BUG #18459: running pg_ctl.exe from inside a program running as a Windows service returns "error code 6" PG Bug reporting form <noreply@postgresql.org>
@ 2025-09-02 15:57 ` Martin Fernau <martin.fernau@fernausoft.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Martin Fernau @ 2025-09-02 15:57 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org

I know this is an old thread – but were you ever able to find a solution?

I'm facing exactly the same issue and can't figure out the root cause. 
The odd thing is that our software has been running fine for years in 
this exact setup, but it suddenly started to fail on one single machine.

Postgres just won’t start (exit code 6) when launched from within our 
Windows service (Java process). However, it starts perfectly fine if I 
run it manually from the command line using the SYSTEM account.

I'm really clueless at this point…

Regards,
Martin

Am 09.05.24 um 20:28 schrieb PG Bug reporting form:
> The following bug has been logged on the website:
>
> Bug reference:      18459
> Logged by:          Rick Frank
> Email address:      rfrank@riministreet.com
> PostgreSQL version: 15.3
> Operating system:   Windows
> Description:
>
> We have a program written in Go that launches postgressql. Postgres starts
> as a separate process, but under control of our program. This works fine
> running the program interactively with our program in a folder under
> “C:\Program Files”.  But Postgres won’t start when we run our program as a
> Windows service, even if the postgres programs and database are in a
> different folder.  If we have our program in any folder except “C:\Program
> Files”, it works running as a service.
>    
> I tried with the service running under "Local System" and with a named
> Administrator account; same error each time. I made sure that all users have
> Full Control permissions to the folder where Postgres resides. Postgres
> programs and data are in the same folder, in "C:\ProgramData" folder.
>
> The program is using a Go package called embedded-postgres. That package
> starts Postgres using pg_ctl.exe. Here is the error that pg_ctl.exe
> returns:
>       "pg_ctl: could not start server: error code 6"
>
> I can’t find any info saying what this message means.  Any ideas what this
> means?
>






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-09-02 15:57 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-05-09 18:28 BUG #18459: running pg_ctl.exe from inside a program running as a Windows service returns "error code 6" PG Bug reporting form <noreply@postgresql.org>
2025-09-02 15:57 ` Martin Fernau <martin.fernau@fernausoft.de>

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