pgsql: Strip Windows newlines from extension script files manually. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Strip Windows newlines from extension script files manually.
Date
Msg-id E1t5TDQ-002s4c-MZ@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Strip Windows newlines from extension script files manually.

Revert commit 924e03917 in favor of adding code to convert \r\n to \n
explicitly, on Windows only.  The idea of letting text mode do the
work fails for a couple of reasons:

* Per Microsoft documentation, text mode also causes control-Z to be
interpreted as end-of-file.  While it may be unlikely that extension
scripts contain control-Z, we've historically allowed it, and breaking
the case doesn't seem wise.

* Apparently, on some Windows configurations, "r" mode is interpreted
as binary not text mode.  We could force it with "rt" but that would
be inconsistent with our code elsewhere, and it would still require
Windows-specific coding.

Thanks to Alexander Lakhin for investigation.

Discussion: https://postgr.es/m/79284195-4993-7b00-f6df-8db28ca60fa3@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6cfb3a33746990602c790199adc2debb2c4bbb87

Modified Files
--------------
src/backend/commands/extension.c | 38 ++++++++++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 4 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pgsql: Remove unused #include's from contrib, pl, test .c files
Next
From: Alexander Korotkov
Date:
Subject: Re: pgsql: Implement pg_wal_replay_wait() stored procedure