PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
guc_tables.h File Reference
#include "utils/guc.h"
Include dependency graph for guc_tables.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  config_var_val
 
struct  config_var_value
 
struct  guc_stack
 
struct  config_generic
 
struct  config_bool
 
struct  config_int
 
struct  config_real
 
struct  config_string
 
struct  config_enum
 

Macros

#define GUC_IS_IN_FILE   0x0001 /* found it in config file */
 
#define GUC_PENDING_RESTART   0x0002
 

Typedefs

typedef struct config_var_value config_var_value
 
typedef struct guc_stack GucStack
 

Enumerations

enum  config_type {
  PGC_BOOL, PGC_INT, PGC_REAL, PGC_STRING,
  PGC_ENUM
}
 
enum  config_group {
  UNGROUPED, FILE_LOCATIONS, CONN_AUTH, CONN_AUTH_SETTINGS,
  CONN_AUTH_SECURITY, RESOURCES, RESOURCES_MEM, RESOURCES_DISK,
  RESOURCES_KERNEL, RESOURCES_VACUUM_DELAY, RESOURCES_BGWRITER, RESOURCES_ASYNCHRONOUS,
  WAL, WAL_SETTINGS, WAL_CHECKPOINTS, WAL_ARCHIVING,
  REPLICATION, REPLICATION_SENDING, REPLICATION_MASTER, REPLICATION_STANDBY,
  QUERY_TUNING, QUERY_TUNING_METHOD, QUERY_TUNING_COST, QUERY_TUNING_GEQO,
  QUERY_TUNING_OTHER, LOGGING, LOGGING_WHERE, LOGGING_WHEN,
  LOGGING_WHAT, PROCESS_TITLE, STATS, STATS_MONITORING,
  STATS_COLLECTOR, AUTOVACUUM, CLIENT_CONN, CLIENT_CONN_STATEMENT,
  CLIENT_CONN_LOCALE, CLIENT_CONN_PRELOAD, CLIENT_CONN_OTHER, LOCK_MANAGEMENT,
  COMPAT_OPTIONS, COMPAT_OPTIONS_PREVIOUS, COMPAT_OPTIONS_CLIENT, ERROR_HANDLING_OPTIONS,
  PRESET_OPTIONS, CUSTOM_OPTIONS, DEVELOPER_OPTIONS
}
 
enum  GucStackState { GUC_SAVE, GUC_SET, GUC_LOCAL, GUC_SET_LOCAL }
 

Functions

struct config_generic ** get_guc_variables (void)
 
void build_guc_variables (void)
 
const char * config_enum_lookup_by_value (struct config_enum *record, int val)
 
bool config_enum_lookup_by_name (struct config_enum *record, const char *value, int *retval)
 

Variables

const char *const config_group_names []
 
const char *const config_type_names []
 
const char *const GucContext_Names []
 
const char *const GucSource_Names []
 

Macro Definition Documentation

#define GUC_IS_IN_FILE   0x0001 /* found it in config file */

Definition at line 166 of file guc_tables.h.

#define GUC_PENDING_RESTART   0x0002

Definition at line 171 of file guc_tables.h.

Referenced by GetConfigOptionByNum(), and set_config_option().

Typedef Documentation

Enumeration Type Documentation

Enumerator
UNGROUPED 
FILE_LOCATIONS 
CONN_AUTH 
CONN_AUTH_SETTINGS 
CONN_AUTH_SECURITY 
RESOURCES 
RESOURCES_MEM 
RESOURCES_DISK 
RESOURCES_KERNEL 
RESOURCES_VACUUM_DELAY 
RESOURCES_BGWRITER 
RESOURCES_ASYNCHRONOUS 
WAL 
WAL_SETTINGS 
WAL_CHECKPOINTS 
WAL_ARCHIVING 
REPLICATION 
REPLICATION_SENDING 
REPLICATION_MASTER 
REPLICATION_STANDBY 
QUERY_TUNING 
QUERY_TUNING_METHOD 
QUERY_TUNING_COST 
QUERY_TUNING_GEQO 
QUERY_TUNING_OTHER 
LOGGING 
LOGGING_WHERE 
LOGGING_WHEN 
LOGGING_WHAT 
PROCESS_TITLE 
STATS 
STATS_MONITORING 
STATS_COLLECTOR 
AUTOVACUUM 
CLIENT_CONN 
CLIENT_CONN_STATEMENT 
CLIENT_CONN_LOCALE 
CLIENT_CONN_PRELOAD 
CLIENT_CONN_OTHER 
LOCK_MANAGEMENT 
COMPAT_OPTIONS 
COMPAT_OPTIONS_PREVIOUS 
COMPAT_OPTIONS_CLIENT 
ERROR_HANDLING_OPTIONS 
PRESET_OPTIONS 
CUSTOM_OPTIONS 
DEVELOPER_OPTIONS 

Definition at line 53 of file guc_tables.h.

54 {
55  UNGROUPED,
57  CONN_AUTH,
60  RESOURCES,
67  WAL,
80  LOGGING,
85  STATS,
88  AUTOVACUUM,
102 };
Definition: guc_tables.h:67
Enumerator
PGC_BOOL 
PGC_INT 
PGC_REAL 
PGC_STRING 
PGC_ENUM 

Definition at line 22 of file guc_tables.h.

23 {
24  PGC_BOOL,
25  PGC_INT,
26  PGC_REAL,
27  PGC_STRING,
28  PGC_ENUM
29 };
Enumerator
GUC_SAVE 
GUC_SET 
GUC_LOCAL 
GUC_SET_LOCAL 

Definition at line 108 of file guc_tables.h.

109 {
110  /* This is almost GucAction, but we need a fourth state for SET+LOCAL */
111  GUC_SAVE, /* entry caused by function SET option */
112  GUC_SET, /* entry caused by plain SET command */
113  GUC_LOCAL, /* entry caused by SET LOCAL command */
114  GUC_SET_LOCAL /* entry caused by SET then SET LOCAL */
115 } GucStackState;
GucStackState
Definition: guc_tables.h:108

Function Documentation

void build_guc_variables ( void  )

Definition at line 4160 of file guc.c.

References FATAL, free, config_bool::gen, config_int::gen, config_real::gen, config_string::gen, config_enum::gen, guc_malloc(), guc_var_compare(), i, config_generic::name, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, qsort, and config_generic::vartype.

Referenced by GucInfoMain(), and InitializeGUCOptions().

4161 {
4162  int size_vars;
4163  int num_vars = 0;
4164  struct config_generic **guc_vars;
4165  int i;
4166 
4167  for (i = 0; ConfigureNamesBool[i].gen.name; i++)
4168  {
4169  struct config_bool *conf = &ConfigureNamesBool[i];
4170 
4171  /* Rather than requiring vartype to be filled in by hand, do this: */
4172  conf->gen.vartype = PGC_BOOL;
4173  num_vars++;
4174  }
4175 
4176  for (i = 0; ConfigureNamesInt[i].gen.name; i++)
4177  {
4178  struct config_int *conf = &ConfigureNamesInt[i];
4179 
4180  conf->gen.vartype = PGC_INT;
4181  num_vars++;
4182  }
4183 
4184  for (i = 0; ConfigureNamesReal[i].gen.name; i++)
4185  {
4186  struct config_real *conf = &ConfigureNamesReal[i];
4187 
4188  conf->gen.vartype = PGC_REAL;
4189  num_vars++;
4190  }
4191 
4192  for (i = 0; ConfigureNamesString[i].gen.name; i++)
4193  {
4194  struct config_string *conf = &ConfigureNamesString[i];
4195 
4196  conf->gen.vartype = PGC_STRING;
4197  num_vars++;
4198  }
4199 
4200  for (i = 0; ConfigureNamesEnum[i].gen.name; i++)
4201  {
4202  struct config_enum *conf = &ConfigureNamesEnum[i];
4203 
4204  conf->gen.vartype = PGC_ENUM;
4205  num_vars++;
4206  }
4207 
4208  /*
4209  * Create table with 20% slack
4210  */
4211  size_vars = num_vars + num_vars / 4;
4212 
4213  guc_vars = (struct config_generic **)
4214  guc_malloc(FATAL, size_vars * sizeof(struct config_generic *));
4215 
4216  num_vars = 0;
4217 
4218  for (i = 0; ConfigureNamesBool[i].gen.name; i++)
4219  guc_vars[num_vars++] = &ConfigureNamesBool[i].gen;
4220 
4221  for (i = 0; ConfigureNamesInt[i].gen.name; i++)
4222  guc_vars[num_vars++] = &ConfigureNamesInt[i].gen;
4223 
4224  for (i = 0; ConfigureNamesReal[i].gen.name; i++)
4225  guc_vars[num_vars++] = &ConfigureNamesReal[i].gen;
4226 
4227  for (i = 0; ConfigureNamesString[i].gen.name; i++)
4228  guc_vars[num_vars++] = &ConfigureNamesString[i].gen;
4229 
4230  for (i = 0; ConfigureNamesEnum[i].gen.name; i++)
4231  guc_vars[num_vars++] = &ConfigureNamesEnum[i].gen;
4232 
4233  if (guc_variables)
4235  guc_variables = guc_vars;
4236  num_guc_variables = num_vars;
4237  size_guc_variables = size_vars;
4239  sizeof(struct config_generic *), guc_var_compare);
4240 }
static struct config_int ConfigureNamesInt[]
Definition: guc.c:1671
const char * name
Definition: guc_tables.h:145
static struct config_enum ConfigureNamesEnum[]
Definition: guc.c:3610
static struct config_bool ConfigureNamesBool[]
Definition: guc.c:803
static int guc_var_compare(const void *a, const void *b)
Definition: guc.c:4382
static int num_guc_variables
Definition: guc.c:3899
#define FATAL
Definition: elog.h:52
struct config_generic gen
Definition: guc_tables.h:178
struct config_generic gen
Definition: guc_tables.h:192
static struct config_generic ** guc_variables
Definition: guc.c:3896
enum config_type vartype
Definition: guc_tables.h:152
static int size_guc_variables
Definition: guc.c:3902
static struct config_real ConfigureNamesReal[]
Definition: guc.c:2856
struct config_generic gen
Definition: guc_tables.h:238
struct config_generic gen
Definition: guc_tables.h:224
#define free(a)
Definition: header.h:60
static struct config_string ConfigureNamesString[]
Definition: guc.c:3017
int i
#define qsort(a, b, c, d)
Definition: port.h:440
static void * guc_malloc(int elevel, size_t size)
Definition: guc.c:3937
struct config_generic gen
Definition: guc_tables.h:208
bool config_enum_lookup_by_name ( struct config_enum record,
const char *  value,
int *  retval 
)

Definition at line 5601 of file guc.c.

References FALSE, config_enum_entry::name, config_enum::options, pg_strcasecmp(), TRUE, and config_enum_entry::val.

Referenced by parse_and_validate_value().

5603 {
5604  const struct config_enum_entry *entry;
5605 
5606  for (entry = record->options; entry && entry->name; entry++)
5607  {
5608  if (pg_strcasecmp(value, entry->name) == 0)
5609  {
5610  *retval = entry->val;
5611  return TRUE;
5612  }
5613  }
5614 
5615  *retval = 0;
5616  return FALSE;
5617 }
static struct @76 value
Definition: guc.h:164
int pg_strcasecmp(const char *s1, const char *s2)
Definition: pgstrcasecmp.c:36
#define FALSE
Definition: c.h:218
const struct config_enum_entry * options
Definition: guc_tables.h:242
int val
Definition: guc.h:167
const char * name
Definition: guc.h:166
#define TRUE
Definition: c.h:214
const char* config_enum_lookup_by_value ( struct config_enum record,
int  val 
)

Definition at line 5578 of file guc.c.

References elog, ERROR, config_enum::gen, config_generic::name, config_enum_entry::name, NULL, config_enum::options, and config_enum_entry::val.

Referenced by _ShowOption(), call_enum_check_hook(), estimate_variable_size(), GetConfigOption(), GetConfigOptionByNum(), GetConfigOptionResetString(), printMixedStruct(), and serialize_variable().

5579 {
5580  const struct config_enum_entry *entry;
5581 
5582  for (entry = record->options; entry && entry->name; entry++)
5583  {
5584  if (entry->val == val)
5585  return entry->name;
5586  }
5587 
5588  elog(ERROR, "could not find enum option %d for %s",
5589  val, record->gen.name);
5590  return NULL; /* silence compiler */
5591 }
Definition: guc.h:164
const char * name
Definition: guc_tables.h:145
#define ERROR
Definition: elog.h:43
const struct config_enum_entry * options
Definition: guc_tables.h:242
int val
Definition: guc.h:167
struct config_generic gen
Definition: guc_tables.h:238
#define NULL
Definition: c.h:226
const char * name
Definition: guc.h:166
#define elog
Definition: elog.h:219
long val
Definition: informix.c:689
struct config_generic** get_guc_variables ( void  )

Definition at line 4148 of file guc.c.

References guc_variables.

Referenced by GucInfoMain().

4149 {
4150  return guc_variables;
4151 }
static struct config_generic ** guc_variables
Definition: guc.c:3896

Variable Documentation

const char* const config_group_names[]

Definition at line 569 of file guc.c.

Referenced by printMixedStruct().

const char* const config_type_names[]

Definition at line 674 of file guc.c.

const char* const GucContext_Names[]

Definition at line 532 of file guc.c.

Referenced by printMixedStruct().

const char* const GucSource_Names[]

Definition at line 548 of file guc.c.