mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Code review for GUC revert-values-if-removed-from-postgresql.conf patch;
and in passing, fix some bogosities dating from the custom_variable_classes patch. Fix guc-file.l to correctly check changes in custom_variable_classes that are attempted concurrently with additions/removals of custom variables, and don't allow the new setting to be applied in advance of checking it. Clean up messy and undocumented situation for string variables with NULL boot_val. Fix DefineCustomVariable functions to initialize boot_val correctly. Prevent find_option from inserting bogus placeholders for custom variables that are simply inquired about rather than being set.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/utils/guc_tables.h,v 1.33 2007/04/21 20:02:41 petere Exp $
|
||||
* $PostgreSQL: pgsql/src/include/utils/guc_tables.h,v 1.34 2007/09/10 00:57:22 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -130,7 +130,7 @@ struct config_generic
|
||||
#define GUC_SUPERUSER_ONLY 0x0100 /* show only to superusers */
|
||||
#define GUC_IS_NAME 0x0200 /* limit string to NAMEDATALEN-1 */
|
||||
|
||||
#define GUC_UNIT_KB 0x0400 /* value is in 1 kB */
|
||||
#define GUC_UNIT_KB 0x0400 /* value is in kilobytes */
|
||||
#define GUC_UNIT_BLOCKS 0x0800 /* value is in blocks */
|
||||
#define GUC_UNIT_XBLOCKS 0x0C00 /* value is in xlog blocks */
|
||||
#define GUC_UNIT_MEMORY 0x0C00 /* mask for KB, BLOCKS, XBLOCKS */
|
||||
@ -144,6 +144,11 @@ struct config_generic
|
||||
#define GUC_HAVE_TENTATIVE 0x0001 /* tentative value is defined */
|
||||
#define GUC_HAVE_LOCAL 0x0002 /* a SET LOCAL has been executed */
|
||||
#define GUC_HAVE_STACK 0x0004 /* we have stacked prior value(s) */
|
||||
#define GUC_IS_IN_FILE 0x0008 /* found it in config file */
|
||||
/*
|
||||
* Caution: the GUC_IS_IN_FILE bit is transient state for ProcessConfigFile.
|
||||
* Do not assume that its value represents useful information elsewhere.
|
||||
*/
|
||||
|
||||
|
||||
/* GUC records for specific variable types */
|
||||
@ -151,8 +156,7 @@ struct config_generic
|
||||
struct config_bool
|
||||
{
|
||||
struct config_generic gen;
|
||||
/* these fields must be set correctly in initial value: */
|
||||
/* (all but reset_val are constants) */
|
||||
/* constant fields, must be set correctly in initial value: */
|
||||
bool *variable;
|
||||
bool boot_val;
|
||||
GucBoolAssignHook assign_hook;
|
||||
@ -165,8 +169,7 @@ struct config_bool
|
||||
struct config_int
|
||||
{
|
||||
struct config_generic gen;
|
||||
/* these fields must be set correctly in initial value: */
|
||||
/* (all but reset_val are constants) */
|
||||
/* constant fields, must be set correctly in initial value: */
|
||||
int *variable;
|
||||
int boot_val;
|
||||
int min;
|
||||
@ -181,8 +184,7 @@ struct config_int
|
||||
struct config_real
|
||||
{
|
||||
struct config_generic gen;
|
||||
/* these fields must be set correctly in initial value: */
|
||||
/* (all but reset_val are constants) */
|
||||
/* constant fields, must be set correctly in initial value: */
|
||||
double *variable;
|
||||
double boot_val;
|
||||
double min;
|
||||
@ -197,8 +199,7 @@ struct config_real
|
||||
struct config_string
|
||||
{
|
||||
struct config_generic gen;
|
||||
/* these fields must be set correctly in initial value: */
|
||||
/* (all are constants) */
|
||||
/* constant fields, must be set correctly in initial value: */
|
||||
char **variable;
|
||||
const char *boot_val;
|
||||
GucStringAssignHook assign_hook;
|
||||
|
Reference in New Issue
Block a user