|
10 | 10 | * Written by Peter Eisentraut <peter_e@gmx.net>.
|
11 | 11 | *
|
12 | 12 | * 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 $ |
14 | 14 | *
|
15 | 15 | *--------------------------------------------------------------------
|
16 | 16 | */
|
@@ -2201,6 +2201,7 @@ static void ReportGUCOption(struct config_generic * record);
|
2201 | 2201 | staticvoidShowGUCConfigOption(constchar*name,DestReceiver*dest);
|
2202 | 2202 | staticvoidShowAllGUCConfig(DestReceiver*dest);
|
2203 | 2203 | staticchar*_ShowOption(structconfig_generic*record);
|
| 2204 | +staticboolis_newvalue_equal(structconfig_generic*record,constchar*newvalue); |
2204 | 2205 |
|
2205 | 2206 |
|
2206 | 2207 | /*
|
@@ -3631,7 +3632,15 @@ set_config_option(const char *name, const char *value,
|
3631 | 3632 | break;
|
3632 | 3633 | casePGC_POSTMASTER:
|
3633 | 3634 | 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 | + |
3634 | 3642 | return true;
|
| 3643 | +} |
3635 | 3644 | if (context!=PGC_POSTMASTER)
|
3636 | 3645 | {
|
3637 | 3646 | ereport(elevel,
|
@@ -5079,6 +5088,44 @@ _ShowOption(struct config_generic * record)
|
5079 | 5088 | }
|
5080 | 5089 |
|
5081 | 5090 |
|
| 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 | + |
5082 | 5129 | #ifdefEXEC_BACKEND
|
5083 | 5130 |
|
5084 | 5131 | /*
|
|