Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit924e039

Browse files
committed
Read extension script files in text not binary mode.
This change affects only Windows, where it should cause DOS-stylenewlines (\r\n) to be converted to plain \n during script loading.This eliminates one potential discrepancy in the behavior ofextension script files between Windows and non-Windows. Whilethere's a small chance that this might cause undesirable behaviorchanges for some extensions, it can also be argued that this mayremove behavioral surprises for others. An example is that inthe buildfarm, we are getting different results for the testsadded by commit774171c depending on whether our git tree hasbeen checked out with Unix or DOS newlines.The choice to use binary mode goes all the way back to our inventionof extensions in commitd9572c4. However, I suspect it was notthought through carefully but was just a side-effect of the readyavailability of an almost-suitable function read_binary_file().On balance, changing to text mode seems like a better answer thanother ways in which we might fix the inconsistent test results.Discussion:https://postgr.es/m/2480333.1729784872@sss.pgh.pa.us
1 parentde380a6 commit924e039

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/commands/extension.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3639,7 +3639,7 @@ read_whole_file(const char *filename, int *length)
36393639
errmsg("file \"%s\" is too large",filename)));
36403640
bytes_to_read= (size_t)fst.st_size;
36413641

3642-
if ((file=AllocateFile(filename,PG_BINARY_R))==NULL)
3642+
if ((file=AllocateFile(filename,"r"))==NULL)
36433643
ereport(ERROR,
36443644
(errcode_for_file_access(),
36453645
errmsg("could not open file \"%s\" for reading: %m",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp