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

Commitbdc3e95

Browse files
committed
Fix processing of PGC_BACKEND GUC parameters on Windows.
EXEC_BACKEND builds (i.e., Windows) failed to absorb values of PGC_BACKENDparameters if they'd been changed post-startup via the config file. Thisfor example prevented log_connections from working if it were turned onpost-startup. The mechanism for handling this case has always been a bitof a kluge, and it wasn't revisited when we implemented EXEC_BACKEND.While in a normal forking environment new backends will inherit thepostmaster's value of such settings, EXEC_BACKEND backends have to readthe settings from the CONFIG_EXEC_PARAMS file, and they were mistakenlyrejecting them. So this case has always been broken in the Windows port;so back-patch to all supported branches.Amit Kapila
1 parent1a496a1 commitbdc3e95

File tree

1 file changed

+20
-0
lines changed
  • src/backend/utils/misc

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5225,9 +5225,23 @@ set_config_option(const char *name, const char *value,
52255225
* ignore it in existing backends.This is a tad klugy, but
52265226
* necessary because we don't re-read the config file during
52275227
* backend start.
5228+
*
5229+
* In EXEC_BACKEND builds, this works differently: we load all
5230+
* nondefault settings from the CONFIG_EXEC_PARAMS file during
5231+
* backend start. In that case we must accept PGC_SIGHUP
5232+
* settings, so as to have the same value as if we'd forked
5233+
* from the postmaster. We detect this situation by checking
5234+
* IsInitProcessingMode, which is a bit ugly, but it doesn't
5235+
* seem worth passing down an explicit flag saying we're doing
5236+
* read_nondefault_variables().
52285237
*/
5238+
#ifdefEXEC_BACKEND
5239+
if (IsUnderPostmaster&& !IsInitProcessingMode())
5240+
return-1;
5241+
#else
52295242
if (IsUnderPostmaster)
52305243
return-1;
5244+
#endif
52315245
}
52325246
elseif (context!=PGC_POSTMASTER&&context!=PGC_BACKEND&&
52335247
source!=PGC_S_CLIENT)
@@ -7636,6 +7650,12 @@ read_nondefault_variables(void)
76367650
GucSourcevarsource;
76377651
GucContextvarscontext;
76387652

7653+
/*
7654+
* Assert that PGC_BACKEND case in set_config_option() will do the right
7655+
* thing.
7656+
*/
7657+
Assert(IsInitProcessingMode());
7658+
76397659
/*
76407660
* Open file
76417661
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp