summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBruce Momjian2003-07-27 04:35:54 +0000
committerBruce Momjian2003-07-27 04:35:54 +0000
commit38fb906f93b40edc9ef367b5619f431851fc3867 (patch)
treefa28c96c833cb5acabff3f6e7f18b4ab872ef726 /src/include
parenta265b7f70aa01a34ae30554186ee8c2089e035d8 (diff)
> Joe Conway <mail@joeconway.com> writes:
>>ISTM that "source" is worth knowing. > > Hm, possibly. Any other opinions? This version has the seven fields I proposed, including "source". Here's an example that shows why I think it's valuable: regression=# \x Expanded display is on. regression=# select * from pg_settings where name = 'enable_seqscan'; -[ RECORD 1 ]----------- name | enable_seqscan setting | on context | user vartype | bool source | default min_val | max_val | regression=# update pg_settings set setting = 'off' where name = 'enable_seqscan'; -[ RECORD 1 ]--- set_config | off regression=# select * from pg_settings where name = 'enable_seqscan'; -[ RECORD 1 ]----------- name | enable_seqscan setting | off context | user vartype | bool source | session min_val | max_val | regression=# alter user postgres set enable_seqscan to 'off'; ALTER USER (log out and then back in again) regression=# \x Expanded display is on. regression=# select * from pg_settings where name = 'enable_seqscan'; -[ RECORD 1 ]----------- name | enable_seqscan setting | off context | user vartype | bool source | user min_val | max_val | In the first case, enable_seqscan is set to its default value. After setting it to off, it is obvious that the value has been changed for the session only. In the third case, you can see that the value has been set specifically for the user. Joe Conway
Diffstat (limited to 'src/include')
-rw-r--r--src/include/utils/guc.h21
-rw-r--r--src/include/utils/guc_tables.h10
2 files changed, 16 insertions, 15 deletions
diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
index 7199a6e2ea2..02d2a01d8bf 100644
--- a/src/include/utils/guc.h
+++ b/src/include/utils/guc.h
@@ -7,7 +7,7 @@
* Copyright 2000-2003 by PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
- * $Id: guc.h,v 1.35 2003/07/21 21:02:12 momjian Exp $
+ * $Id: guc.h,v 1.36 2003/07/27 04:35:54 momjian Exp $
*--------------------------------------------------------------------
*/
#ifndef GUC_H
@@ -55,13 +55,13 @@
*/
typedef enum
{
- PGC_INTERNAL,
- PGC_POSTMASTER,
- PGC_SIGHUP,
- PGC_BACKEND,
- PGC_SUSET,
- PGC_USERLIMIT,
- PGC_USERSET
+ PGC_INTERNAL = 0,
+ PGC_POSTMASTER = 1,
+ PGC_SIGHUP = 2,
+ PGC_BACKEND = 3,
+ PGC_SUSET = 4,
+ PGC_USERLIMIT = 5,
+ PGC_USERSET = 6
} GucContext;
/*
@@ -73,6 +73,8 @@ typedef enum
* Sources <= PGC_S_OVERRIDE will set the default used by RESET, as well
* as the current value. Note that source == PGC_S_OVERRIDE should be
* used when setting a PGC_INTERNAL option.
+ *
+ * Keep in sync with GucSourceName in guc.c
*/
typedef enum
{
@@ -92,7 +94,6 @@ typedef enum
PGC_S_SESSION = 9 /* SET command */
} GucSource;
-
/* GUC vars that are actually declared in guc.c, rather than elsewhere */
extern bool log_statement;
extern bool log_duration;
@@ -132,7 +133,7 @@ extern bool set_config_option(const char *name, const char *value,
extern void ShowGUCConfigOption(const char *name, DestReceiver *dest);
extern void ShowAllGUCConfig(DestReceiver *dest);
extern char *GetConfigOptionByName(const char *name, const char **varname);
-extern char *GetConfigOptionByNum(int varnum, const char **varname, bool *noshow);
+extern void GetConfigOptionByNum(int varnum, const char **values, bool *noshow);
extern int GetNumConfigOptions(void);
extern void SetPGVariable(const char *name, List *args, bool is_local);
diff --git a/src/include/utils/guc_tables.h b/src/include/utils/guc_tables.h
index e8ccfeefd00..0eb9376dd57 100644
--- a/src/include/utils/guc_tables.h
+++ b/src/include/utils/guc_tables.h
@@ -7,7 +7,7 @@
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
*
- * $Id: guc_tables.h,v 1.1 2003/07/04 16:41:22 tgl Exp $
+ * $Id: guc_tables.h,v 1.2 2003/07/27 04:35:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -61,10 +61,10 @@ enum config_group
*/
enum config_type
{
- PGC_BOOL,
- PGC_INT,
- PGC_REAL,
- PGC_STRING
+ PGC_BOOL = 0,
+ PGC_INT = 1,
+ PGC_REAL = 2,
+ PGC_STRING = 3
};
/*