pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Thomas Kellerer <shammat@gmx.net>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Is this a bug in pg_current_logfile() on Windows?
Date: Thu, 9 Jul 2020 09:43:53 -0400
Message-ID: <fcf4b905-8aff-2c65-ae4c-ec28a9a02370@2ndQuadrant.com> (raw)
In-Reply-To: <1777519.1594262442@sss.pgh.pa.us>
References: <412ae8da-76bb-640f-039a-f3513499e53d@gmx.net>
	<1716646.1594226496@sss.pgh.pa.us>
	<bb8f2c7f-2bee-35bd-d57e-62864e95bb89@gmx.net>
	<1733826.1594243608@sss.pgh.pa.us>
	<252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com>
	<1739104.1594250997@sss.pgh.pa.us>
	<1777519.1594262442@sss.pgh.pa.us>


On 7/8/20 10:40 PM, Tom Lane wrote:
> I wrote:
>> Andrew Dunstan <andrew.dunstan@2ndquadrant.com> 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.


It's possible. I do see some mangling of that kind in IPC::Run's
Win32IO.pm and Win32Pump.pm.


Attached for reference is the IPC::Run package I usually use on Windows.


>
> 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?
>
> 			


In general I make the condition for such hacks as restrictive as
possible. I don't guarantee that I have been perfectly consistent about
that, though.


cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

  IPC-Run-Win-0.94.tgz (application/x-compressed-tar, 64.0K) download

view thread (18+ messages)  latest in thread

Message-ID: <fcf4b905-8aff-2c65-ae4c-ec28a9a02370@2ndQuadrant.com>
Permalink:  ../fcf4b905-8aff-2c65-ae4c-ec28a9a02370@2ndQuadrant.com/
Also on:    postgresql.org/message-id/fcf4b905-8aff-2c65-ae4c-ec28a9a02370@2ndQuadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: andrew.dunstan@2ndquadrant.com, tgl@sss.pgh.pa.us, shammat@gmx.net, pgsql-hackers@lists.postgresql.org
  Subject: Re: Is this a bug in pg_current_logfile() on Windows?
  In-Reply-To: <fcf4b905-8aff-2c65-ae4c-ec28a9a02370@2ndQuadrant.com>
  References: <412ae8da-76bb-640f-039a-f3513499e53d@gmx.net> <1716646.1594226496@sss.pgh.pa.us> <bb8f2c7f-2bee-35bd-d57e-62864e95bb89@gmx.net> <1733826.1594243608@sss.pgh.pa.us> <252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com> <1739104.1594250997@sss.pgh.pa.us> <1777519.1594262442@sss.pgh.pa.us> <fcf4b905-8aff-2c65-ae4c-ec28a9a02370@2ndQuadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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