diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-01-05 13:23:33 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-01-05 13:23:33 +0000 |
commit | 35c129cab31ae64ee882bdc4867d889be3d905fa (patch) | |
tree | 21055ce0056b05db86b59abae61426a689861a9a /src | |
parent | c63b9b1ddc374ab52086d4a0e9469220f051371d (diff) | |
download | postgresql-35c129cab31ae64ee882bdc4867d889be3d905fa.tar.gz postgresql-35c129cab31ae64ee882bdc4867d889be3d905fa.zip |
Fix define_custom_variable to preserve any sourcefile/sourceline information
present in the placeholder. Noted while testing pg_stat_statements.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/misc/guc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 303329167a8..0f535c8fa03 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut <peter_e@gmx.net>. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.488 2009/01/03 20:03:08 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.489 2009/01/05 13:23:33 tgl Exp $ * *-------------------------------------------------------------------- */ @@ -5747,9 +5747,17 @@ define_custom_variable(struct config_generic * variable) value = *pHolder->variable; if (value) - set_config_option(name, value, - phcontext, pHolder->gen.source, - GUC_ACTION_SET, true); + { + if (set_config_option(name, value, + phcontext, pHolder->gen.source, + GUC_ACTION_SET, true)) + { + /* Also copy over any saved source-location information */ + if (pHolder->gen.sourcefile) + set_config_sourcefile(name, pHolder->gen.sourcefile, + pHolder->gen.sourceline); + } + } /* * Free up as much as we conveniently can of the placeholder structure |