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

Commitda33a38

Browse files
committed
Revert exporting of internal GUC variable "data_directory".
This undoes a poorly-thought-out choice in commit970a186, namelyto export guc.c's internal variable data_directory. The authoritativevariable so far as C code is concerned is DataDir; there is no reason foranything except specific bits of GUC code to look at the GUC variable.After yesterday's commits fixing the fsync-on-restart patch, the onlyremaining misuse of data_directory was in AlterSystemSetConfigFile(),which would be much better off just using a relative path anyhow: it'sless code and it doesn't break if the DBA moves the data directory of arunning system, which is a case we've taken some pains over in the past.This is mostly cosmetic, so no need for a back-patch (and I'd be hesitantto remove a global variable in stable branches anyway).
1 parentd8179b0 commitda33a38

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

‎src/backend/utils/misc/guc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,6 @@ inttemp_file_limit = -1;
435435
intnum_temp_buffers=1024;
436436

437437
char*cluster_name="";
438-
char*data_directory;
439438
char*ConfigFileName;
440439
char*HbaFileName;
441440
char*IdentFileName;
@@ -476,6 +475,7 @@ static char *timezone_string;
476475
staticchar*log_timezone_string;
477476
staticchar*timezone_abbreviations_string;
478477
staticchar*XactIsoLevel_string;
478+
staticchar*data_directory;
479479
staticchar*session_authorization_string;
480480
staticintmax_function_args;
481481
staticintmax_index_keys;
@@ -6895,11 +6895,11 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt)
68956895
}
68966896

68976897
/*
6898-
*Use data directory as reference path for PG_AUTOCONF_FILENAME and its
6899-
*corresponding temporary file.
6898+
*PG_AUTOCONF_FILENAME and its corresponding temporary file are always in
6899+
*the data directory, so we can reference them by simple relative paths.
69006900
*/
6901-
join_path_components(AutoConfFileName,data_directory,PG_AUTOCONF_FILENAME);
6902-
canonicalize_path(AutoConfFileName);
6901+
snprintf(AutoConfFileName,sizeof(AutoConfFileName),"%s",
6902+
PG_AUTOCONF_FILENAME);
69036903
snprintf(AutoConfTmpFileName,sizeof(AutoConfTmpFileName),"%s.%s",
69046904
AutoConfFileName,
69056905
"tmp");

‎src/include/utils/guc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ extern inttemp_file_limit;
247247
externintnum_temp_buffers;
248248

249249
externchar*cluster_name;
250-
externchar*data_directory;
251250
externchar*ConfigFileName;
252251
externchar*HbaFileName;
253252
externchar*IdentFileName;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp