pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Read extension script files in text not binary mode.
Date: Fri, 25 Oct 2024 16:20:01 +0000
Message-ID: <E1t4N2f-002PVD-Np@gemulon.postgresql.org> (raw)

Read extension script files in text not binary mode.

This change affects only Windows, where it should cause DOS-style
newlines (\r\n) to be converted to plain \n during script loading.
This eliminates one potential discrepancy in the behavior of
extension script files between Windows and non-Windows.  While
there's a small chance that this might cause undesirable behavior
changes for some extensions, it can also be argued that this may
remove behavioral surprises for others.  An example is that in
the buildfarm, we are getting different results for the tests
added by commit 774171c4f depending on whether our git tree has
been checked out with Unix or DOS newlines.

The choice to use binary mode goes all the way back to our invention
of extensions in commit d9572c4e3.  However, I suspect it was not
thought through carefully but was just a side-effect of the ready
availability of an almost-suitable function read_binary_file().
On balance, changing to text mode seems like a better answer than
other ways in which we might fix the inconsistent test results.

Discussion: https://postgr.es/m/2480333.1729784872@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/924e03917d6f7c7536b2a1228b5422f175f58f9e

Modified Files
--------------
src/backend/commands/extension.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Message-ID: <E1t4N2f-002PVD-Np@gemulon.postgresql.org>
Permalink:  ../E1t4N2f-002PVD-Np@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1t4N2f-002PVD-Np@gemulon.postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Read extension script files in text not binary mode.
  In-Reply-To: <E1t4N2f-002PVD-Np@gemulon.postgresql.org>

* 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