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 4178 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().

4179 {
4180  int size_vars;
4181  int num_vars = 0;
4182  struct config_generic **guc_vars;
4183  int i;
4184 
4185  for (i = 0; ConfigureNamesBool[i].gen.name; i++)
4186  {
4187  struct config_bool *conf = &ConfigureNamesBool[i];
4188 
4189  /* Rather than requiring vartype to be filled in by hand, do this: */
4190  conf->gen.vartype = PGC_BOOL;
4191  num_vars++;
4192  }
4193 
4194  for (i = 0; ConfigureNamesInt[i].gen.name; i++)
4195  {
4196  struct config_int *conf = &ConfigureNamesInt[i];
4197 
4198  conf->gen.vartype = PGC_INT;
4199  num_vars++;
4200  }
4201 
4202  for (i = 0; ConfigureNamesReal[i].gen.name; i++)
4203  {
4204  struct config_real *conf = &ConfigureNamesReal[i];
4205 
4206  conf->gen.vartype = PGC_REAL;
4207  num_vars++;
4208  }
4209 
4210  for (i = 0; ConfigureNamesString[i].gen.name; i++)
4211  {
4212  struct config_string *conf = &ConfigureNamesString[i];
4213 
4214  conf->gen.vartype = PGC_STRING;
4215  num_vars++;
4216  }
4217 
4218  for (i = 0; ConfigureNamesEnum[i].gen.name; i++)
4219  {
4220  struct config_enum *conf = &ConfigureNamesEnum[i];
4221 
4222  conf->gen.vartype = PGC_ENUM;
4223  num_vars++;
4224  }
4225 
4226  /*
4227  * Create table with 20% slack
4228  */
4229  size_vars = num_vars + num_vars / 4;
4230 
4231  guc_vars = (struct config_generic **)
4232  guc_malloc(FATAL, size_vars * sizeof(struct config_generic *));
4233 
4234  num_vars = 0;
4235 
4236  for (i = 0; ConfigureNamesBool[i].gen.name; i++)
4237  guc_vars[num_vars++] = &ConfigureNamesBool[i].gen;
4238 
4239  for (i = 0; ConfigureNamesInt[i].gen.name; i++)
4240  guc_vars[num_vars++] = &ConfigureNamesInt[i].gen;
4241 
4242  for (i = 0; ConfigureNamesReal[i].gen.name; i++)
4243  guc_vars[num_vars++] = &ConfigureNamesReal[i].gen;
4244 
4245  for (i = 0; ConfigureNamesString[i].gen.name; i++)
4246  guc_vars[num_vars++] = &ConfigureNamesString[i].gen;
4247 
4248  for (i = 0; ConfigureNamesEnum[i].gen.name; i++)
4249  guc_vars[num_vars++] = &ConfigureNamesEnum[i].gen;
4250 
4251  if (guc_variables)
4253  guc_variables = guc_vars;
4254  num_guc_variables = num_vars;
4255  size_guc_variables = size_vars;
4257  sizeof(struct config_generic *), guc_var_compare);
4258 }
static struct config_int ConfigureNamesInt[]
Definition: guc.c:1677
const char * name
Definition: guc_tables.h:145
static struct config_enum ConfigureNamesEnum[]
Definition: guc.c:3628
static struct config_bool ConfigureNamesBool[]
Definition: guc.c:804
static int guc_var_compare(const void *a, const void *b)
Definition: guc.c:4400
static int num_guc_variables
Definition: guc.c:3917
#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:3914
enum config_type vartype
Definition: guc_tables.h:152
static int size_guc_variables
Definition: guc.c:3920
static struct config_real ConfigureNamesReal[]
Definition: guc.c:2874
struct config_generic gen
Definition: guc_tables.h:238
struct config_generic gen
Definition: guc_tables.h:224
#define free(a)
Definition: header.h:65
static struct config_string ConfigureNamesString[]
Definition: guc.c:3035
int i
#define qsort(a, b, c, d)
Definition: port.h:440
static void * guc_malloc(int elevel, size_t size)
Definition: guc.c:3955
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 5619 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().

5621 {
5622  const struct config_enum_entry *entry;
5623 
5624  for (entry = record->options; entry && entry->name; entry++)
5625  {
5626  if (pg_strcasecmp(value, entry->name) == 0)
5627  {
5628  *retval = entry->val;
5629  return TRUE;
5630  }
5631  }
5632 
5633  *retval = 0;
5634  return FALSE;
5635 }
static struct @78 value
Definition: guc.h:164
int pg_strcasecmp(const char *s1, const char *s2)
Definition: pgstrcasecmp.c:36
#define FALSE
Definition: c.h:221
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:217
const char* config_enum_lookup_by_value ( struct config_enum record,
int  val 
)

Definition at line 5596 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().

5597 {
5598  const struct config_enum_entry *entry;
5599 
5600  for (entry = record->options; entry && entry->name; entry++)
5601  {
5602  if (entry->val == val)
5603  return entry->name;
5604  }
5605 
5606  elog(ERROR, "could not find enum option %d for %s",
5607  val, record->gen.name);
5608  return NULL; /* silence compiler */
5609 }
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:229
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 4166 of file guc.c.

References guc_variables.

Referenced by GucInfoMain().

4167 {
4168  return guc_variables;
4169 }
static struct config_generic ** guc_variables
Definition: guc.c:3914

Variable Documentation

const char* const config_group_names[]

Definition at line 570 of file guc.c.

Referenced by printMixedStruct().

const char* const config_type_names[]

Definition at line 675 of file guc.c.

const char* const GucContext_Names[]

Definition at line 533 of file guc.c.

Referenced by printMixedStruct().

const char* const GucSource_Names[]

Definition at line 549 of file guc.c.