Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j2f1x-0006rt-7x for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Feb 2020 17:45:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j2f1w-0001rp-0z for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Feb 2020 17:45:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j2f1v-0001ri-Lr for pgsql-bugs@lists.postgresql.org; Fri, 14 Feb 2020 17:45:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j2f1t-00083G-Ck; Fri, 14 Feb 2020 17:45:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 01EHjRhe022620; Fri, 14 Feb 2020 12:45:27 -0500 From: Tom Lane To: jkatz@postgresql.org cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16259: Cannot Use "pg_ctl start -l logfile" on Clean Install on Windows Server 2012/2016 In-reply-to: <16259-c5ebed32a262a8b1@postgresql.org> References: <16259-c5ebed32a262a8b1@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Fri, 14 Feb 2020 17:35:00 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22618.1581702327.1@sss.pgh.pa.us> Date: Fri, 14 Feb 2020 12:45:27 -0500 Message-ID: <22619.1581702327@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > 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. So ... why aren't we seeing that in the buildfarm? The TAP tests certainly do that, and I think the core regression tests do too. > 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. Without an explanation for why it's not failing everywhere, I don't have a lot of faith in that being an improvement. regards, tom lane