Re: Is this a bug in pg_current_logfile() on Windows?

Adrian Klaver <adrian.klaver@aklaver.com>

From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Thomas Kellerer <shammat@gmx.net>, pgsql-general@lists.postgresql.org
Date: 2020-07-08T13:45:12Z
Lists: pgsql-hackers, pgsql-general
On 7/8/20 6:05 AM, Thomas Kellerer wrote:
> Hello,
> 
> I noticed the following strage output when running Postgres 12.3 (not psql) on Windows
> 
>      postgres=# select pg_current_logfile();
>               pg_current_logfile
>      ------------------------------------
>       pg_log/postgresql-2020-07-08.log\r
>      (1 row)
> 
> Note the "\r" at the end of the file name.
> 
> This does not happen when running Postgres on Linux.
> 
> Is this intended for some strange reason?
> Or a bug or a technical limitation?

I'm guessing the difference between Unix line ending:

\n

and Windows:

\r\n

> 
> Regards
> Thomas
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Commits

  1. Tighten up Windows CRLF conversion in our TAP test scripts.

  2. Fix pg_current_logfile() to not emit a carriage return on Windows.

  3. Further tighten Windows CRLF conversion in our TAP test scripts.

  4. Add test coverage for pg_current_logfile() function.

  5. Fix failures to ignore \r when reading Windows-style newlines.

  6. Fix TAP infrastructure to support Mingw better