Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtMUX-00020R-IP for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2020 02:40:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jtMUV-00055m-TM for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2020 02:40:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtMUV-00055f-MQ for pgsql-hackers@lists.postgresql.org; Thu, 09 Jul 2020 02:40:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtMUS-0006dt-PC for pgsql-hackers@lists.postgresql.org; Thu, 09 Jul 2020 02:40:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0692egrp1777520; Wed, 8 Jul 2020 22:40:42 -0400 From: Tom Lane To: Andrew Dunstan cc: Thomas Kellerer , pgsql-hackers@lists.postgresql.org Subject: Re: Is this a bug in pg_current_logfile() on Windows? In-reply-to: <1739104.1594250997@sss.pgh.pa.us> References: <412ae8da-76bb-640f-039a-f3513499e53d@gmx.net> <1716646.1594226496@sss.pgh.pa.us> <1733826.1594243608@sss.pgh.pa.us> <252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com> <1739104.1594250997@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 08 Jul 2020 19:29:57 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1777518.1594262442.1@sss.pgh.pa.us> Date: Wed, 08 Jul 2020 22:40:42 -0400 Message-ID: <1777519.1594262442@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Andrew Dunstan writes: >> Seems reasonable. If we rip it out completely we'll have to find all the >> places it breaks and fix them. And we'll almost certainly get new >> breakage. If it's hiding a real bug we'll have to do that, but I'd be >> reluctant unless there's actual proof. > Hard to tell. What I propose to do right now is change the \r filters > as shown above, and see if the test I added in 004_logrotate.pl starts > to show failures on Windows. If it does, and no other place does, > I'm willing to be satisfied with that. If we see *other* failures then > that'd prove that the problem is real, no? So I did that, and the first report is from bowerbird and it's still green. Unless I'm completely misinterpreting what's happening (always a possibility), that means we're still managing to remove "data" occurrences of \r. The most likely theory about that, I think, is that IPC::Run::run already translated any \r\n occurrences in the psql command's output to plain \n. Then, the \r generated by pg_current_logfile() would butt up against the line-ending \n, allowing the "fix" in sub psql to remove valid data. One thing I noticed while making 91bdf499b is that some of these substitutions are conditioned on "if $TestLib::windows_os" while others are conditioned on "if $Config{osname} eq 'msys'". What is the reason for this difference? Is it possible that we only really need to do it in the latter case? regards, tom lane