mirror of
https://github.com/postgres/postgres.git
synced 2025-08-06 18:42:54 +03:00
Add "source file" and "source line" information to each GUC variable.
initdb forced due to changes in the pg_settings view. Magnus Hagander and Alvaro Herrera.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.56 2008/08/22 00:20:40 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.57 2008/09/10 18:09:19 alvherre Exp $
|
||||
*/
|
||||
|
||||
%{
|
||||
@@ -39,6 +39,8 @@ struct name_value_pair
|
||||
{
|
||||
char *name;
|
||||
char *value;
|
||||
char *filename;
|
||||
int sourceline;
|
||||
struct name_value_pair *next;
|
||||
};
|
||||
|
||||
@@ -307,8 +309,12 @@ ProcessConfigFile(GucContext context)
|
||||
/* If we got here all the options checked out okay, so apply them. */
|
||||
for (item = head; item; item = item->next)
|
||||
{
|
||||
set_config_option(item->name, item->value, context,
|
||||
PGC_S_FILE, GUC_ACTION_SET, true);
|
||||
if (set_config_option(item->name, item->value, context,
|
||||
PGC_S_FILE, GUC_ACTION_SET, true))
|
||||
{
|
||||
set_config_sourcefile(item->name, item->filename,
|
||||
item->sourceline);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remember when we last successfully loaded the config file. */
|
||||
@@ -483,6 +489,8 @@ ParseConfigFile(const char *config_file, const char *calling_file,
|
||||
pfree(item->value);
|
||||
item->name = opt_name;
|
||||
item->value = opt_value;
|
||||
item->filename = pstrdup(config_file);
|
||||
item->sourceline = ConfigFileLineno-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -490,6 +498,8 @@ ParseConfigFile(const char *config_file, const char *calling_file,
|
||||
item = palloc(sizeof *item);
|
||||
item->name = opt_name;
|
||||
item->value = opt_value;
|
||||
item->filename = pstrdup(config_file);
|
||||
item->sourceline = ConfigFileLineno-1;
|
||||
item->next = *head_p;
|
||||
*head_p = item;
|
||||
if (*tail_p == NULL)
|
||||
@@ -502,6 +512,8 @@ ParseConfigFile(const char *config_file, const char *calling_file,
|
||||
item = palloc(sizeof *item);
|
||||
item->name = opt_name;
|
||||
item->value = opt_value;
|
||||
item->filename = pstrdup(config_file);
|
||||
item->sourceline = ConfigFileLineno-1;
|
||||
item->next = NULL;
|
||||
if (*head_p == NULL)
|
||||
*head_p = item;
|
||||
@@ -553,6 +565,7 @@ free_name_value_list(struct name_value_pair *list)
|
||||
|
||||
pfree(item->name);
|
||||
pfree(item->value);
|
||||
pfree(item->filename);
|
||||
pfree(item);
|
||||
item = next;
|
||||
}
|
||||
|
Reference in New Issue
Block a user