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

Commit31ec957

Browse files
committed
Fix define_custom_variable so that SUSET custom variables behave
somewhat reasonably. It's not perfect, but it beats the klugeproposed in the auto-explain patch ...
1 parentcd35e9d commit31ec957

File tree

1 file changed

+25
-2
lines changed
  • src/backend/utils/misc

1 file changed

+25
-2
lines changed

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.478 2008/11/1901:10:23 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.479 2008/11/1902:07:07 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -5657,6 +5657,7 @@ define_custom_variable(struct config_generic * variable)
56575657
constchar**nameAddr=&name;
56585658
constchar*value;
56595659
structconfig_string*pHolder;
5660+
GucContextphcontext;
56605661
structconfig_generic**res;
56615662

56625663
/*
@@ -5702,6 +5703,28 @@ define_custom_variable(struct config_generic * variable)
57025703
*/
57035704
*res=variable;
57045705

5706+
/*
5707+
* Infer context for assignment based on source of existing value.
5708+
* We can't tell this with exact accuracy, but we can at least do
5709+
* something reasonable in typical cases.
5710+
*/
5711+
switch (pHolder->gen.source)
5712+
{
5713+
casePGC_S_DEFAULT:
5714+
casePGC_S_ENV_VAR:
5715+
casePGC_S_FILE:
5716+
casePGC_S_ARGV:
5717+
phcontext=PGC_SIGHUP;
5718+
break;
5719+
casePGC_S_DATABASE:
5720+
casePGC_S_USER:
5721+
casePGC_S_CLIENT:
5722+
casePGC_S_SESSION:
5723+
default:
5724+
phcontext=PGC_USERSET;
5725+
break;
5726+
}
5727+
57055728
/*
57065729
* Assign the string value stored in the placeholder to the real variable.
57075730
*
@@ -5713,7 +5736,7 @@ define_custom_variable(struct config_generic * variable)
57135736

57145737
if (value)
57155738
set_config_option(name,value,
5716-
pHolder->gen.context,pHolder->gen.source,
5739+
phcontext,pHolder->gen.source,
57175740
GUC_ACTION_SET, true);
57185741

57195742
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp