aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/guc_tables.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-09-10 00:57:22 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-09-10 00:57:22 +0000
commit40fda15dcebdd07ee75ac1f55dad145f91297b99 (patch)
tree6cd1af9a9e865d6b25c4a20e4f5ee02d7f40a0e3 /src/include/utils/guc_tables.h
parent43df609daa0dbc941338564d0d77cfd852ab8385 (diff)
downloadpostgresql-40fda15dcebdd07ee75ac1f55dad145f91297b99.tar.gz
postgresql-40fda15dcebdd07ee75ac1f55dad145f91297b99.zip
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.
Diffstat (limited to 'src/include/utils/guc_tables.h')
-rw-r--r--src/include/utils/guc_tables.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/include/utils/guc_tables.h b/src/include/utils/guc_tables.h
index f68a814f799..0bc74ccdd0b 100644
--- a/src/include/utils/guc_tables.h
+++ b/src/include/utils/guc_tables.h
@@ -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;