PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16259
PG Version12.2
OSWindows Server 2012, Windows Server 2016
Opened2020-02-14 17:35:00+00
Reported byJonathan Katz
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16259
Logged by:          Jonathan Katz
Email address:      (redacted)
PostgreSQL version: 12.2
Operating system:   Windows Server 2012, Windows Server 2016
Description:        

Hi,

When testing PostgreSQL 12.2 on Windows built using MSVC (this potentially
affects mingw too, though untested) on both Windows Server 2012 & 2016, we
are having issues with a newly generated log file on a fresh PostgreSQL
cluster when PostgreSQL is started with pg_ctl. If the log file was created
with a prior version of PostgreSQL, or if you manually create the log file
and grant the executing user the appropriate file access permissions,
everything works fine.

In other words, the issue occurs when passing a file name to the `-l` flag
where the log file does not already exist. The steps to reproduce this
are:

1. Install a PostgreSQL 12.2 Windows build on a Windows Server 2012 or a
Windows Server 2016 machien
2. Run initdb to initialize a new PostgreSQL cluster
3. Run `pg_ctl start -l logfile` where "logfile" does not currently exist

The resulting output should look like:

  Access is denied.
  waiting for server to start... stopped waiting
  pg_ctl: could not start server
  Examine the log output.

If you try to look at the logfile you will see that it is completely empty. 
If you then change the permissions to grant the current user full access to
the logfile and run the above command again it will start without any
issues.

We think this was introduced in 0da33c76. One approach for a fix would be to
add a condition so the added code only executes if the file already exists,
and if the file does not exist it executes the "snprintf" command like
before.

Please let me know if you need any clarifications. Thanks!

Jonathan

Messages

DateAuthorSubject
2020-02-14 17:35:00+00PG Bug reporting formBUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016
2020-02-14 17:45:27+00Tom LaneRe: BUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016
2020-02-14 18:04:06+00"Jonathan S(dot) Katz"Re: BUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016
2020-02-14 19:40:07+00Heath LordRe: BUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016
2020-02-14 19:57:13+00Tom LaneRe: BUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016
2020-02-14 21:22:40+00Heath LordRe: BUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016
2020-02-14 21:46:16+00Tom LaneRe: BUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016
2020-02-15 04:44:44+00Alexander LakhinRe: BUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016
2020-02-15 05:22:18+00Tom LaneRe: BUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016
2020-02-16 00:23:11+00Heath LordRe: BUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016
2020-02-16 17:21:17+00Tom LaneRe: BUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016