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

Commit3fa9c41

Browse files
committed
Issue a warning if a change-on-restart-only postgresql.conf value is
modified and the server config files are reloaded
1 parentbc6a824 commit3fa9c41

File tree

3 files changed

+52
-5
lines changed

3 files changed

+52
-5
lines changed

‎doc/TODO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Administration
8383
o %Allow postgresql.conf file values to be changed via an SQL
8484
API, perhaps using SET GLOBAL
8585
o Allow the server to be stopped/restarted via an SQL API
86-
o Issue a warning if a change-on-restart-only postgresql.conf value
86+
o-Issue a warning if a change-on-restart-only postgresql.conf value
8787
is modified and the server config files are reloaded
8888
o Mark change-on-restart-only values in postgresql.conf
8989

‎doc/src/FAQ/TODO.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h1><a name="section_2">Administration</a></h1>
2626

2727
<ul>
2828
<li>%Remove behavior of postmaster -o
29-
</li><li>-*%Allow pooled connections to list all prepared statements*
29+
</li><li>-<em>%Allow pooled connections to list all prepared statements</em>
3030
<p> This would allow an application inheriting a pooled connection to know
3131
the statements prepared in the current session.
3232
</p>
@@ -79,8 +79,8 @@ <h1><a name="section_2">Administration</a></h1>
7979
</li><li>%Allow postgresql.conf file values to be changed via an SQL
8080
API, perhaps using SET GLOBAL
8181
</li><li>Allow the server to be stopped/restarted via an SQL API
82-
</li><li>Issue a warning if a change-on-restart-only postgresql.conf value
83-
is modified and the server config files are reloaded
82+
</li><li>-<em>Issue a warning if a change-on-restart-only postgresql.conf value
83+
is modified and the server config files are reloaded</em>
8484
</li><li>Mark change-on-restart-only values in postgresql.conf
8585
</li></ul>
8686
</li><li>Tablespaces

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

Lines changed: 48 additions & 1 deletion
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.309 2006/01/09 10:05:31 petere Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.310 2006/02/04 12:50:47 petere Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -2201,6 +2201,7 @@ static void ReportGUCOption(struct config_generic * record);
22012201
staticvoidShowGUCConfigOption(constchar*name,DestReceiver*dest);
22022202
staticvoidShowAllGUCConfig(DestReceiver*dest);
22032203
staticchar*_ShowOption(structconfig_generic*record);
2204+
staticboolis_newvalue_equal(structconfig_generic*record,constchar*newvalue);
22042205

22052206

22062207
/*
@@ -3631,7 +3632,15 @@ set_config_option(const char *name, const char *value,
36313632
break;
36323633
casePGC_POSTMASTER:
36333634
if (context==PGC_SIGHUP)
3635+
{
3636+
if (changeVal&& !is_newvalue_equal(record,value))
3637+
ereport(elevel,
3638+
(errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),
3639+
errmsg("parameter \"%s\" cannot be changed after server start; configuration file change ignored",
3640+
name)));
3641+
36343642
return true;
3643+
}
36353644
if (context!=PGC_POSTMASTER)
36363645
{
36373646
ereport(elevel,
@@ -5079,6 +5088,44 @@ _ShowOption(struct config_generic * record)
50795088
}
50805089

50815090

5091+
staticbool
5092+
is_newvalue_equal(structconfig_generic*record,constchar*newvalue)
5093+
{
5094+
switch (record->vartype)
5095+
{
5096+
casePGC_BOOL:
5097+
{
5098+
structconfig_bool*conf= (structconfig_bool*)record;
5099+
boolnewval;
5100+
5101+
returnparse_bool(newvalue,&newval)&&*conf->variable==newval;
5102+
}
5103+
casePGC_INT:
5104+
{
5105+
structconfig_int*conf= (structconfig_int*)record;
5106+
intnewval;
5107+
5108+
returnparse_int(newvalue,&newval)&&*conf->variable==newval;
5109+
}
5110+
casePGC_REAL:
5111+
{
5112+
structconfig_real*conf= (structconfig_real*)record;
5113+
doublenewval;
5114+
5115+
returnparse_real(newvalue,&newval)&&*conf->variable==newval;
5116+
}
5117+
casePGC_STRING:
5118+
{
5119+
structconfig_string*conf= (structconfig_string*)record;
5120+
5121+
returnstrcmp(*conf->variable,newvalue)==0;
5122+
}
5123+
}
5124+
5125+
return false;
5126+
}
5127+
5128+
50825129
#ifdefEXEC_BACKEND
50835130

50845131
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp