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,
  REPLICATION_SUBSCRIBERS, 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 167 of file guc_tables.h.

#define GUC_PENDING_RESTART   0x0002

Definition at line 172 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 
REPLICATION_SUBSCRIBERS 
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,
81  LOGGING,
86  STATS,
89  AUTOVACUUM,
103 };
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 109 of file guc_tables.h.

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

Function Documentation

void build_guc_variables ( void  )

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

4200 {
4201  int size_vars;
4202  int num_vars = 0;
4203  struct config_generic **guc_vars;
4204  int i;
4205 
4206  for (i = 0; ConfigureNamesBool[i].gen.name; i++)
4207  {
4208  struct config_bool *conf = &ConfigureNamesBool[i];
4209 
4210  /* Rather than requiring vartype to be filled in by hand, do this: */
4211  conf->gen.vartype = PGC_BOOL;
4212  num_vars++;
4213  }
4214 
4215  for (i = 0; ConfigureNamesInt[i].gen.name; i++)
4216  {
4217  struct config_int *conf = &ConfigureNamesInt[i];
4218 
4219  conf->gen.vartype = PGC_INT;
4220  num_vars++;
4221  }
4222 
4223  for (i = 0; ConfigureNamesReal[i].gen.name; i++)
4224  {
4225  struct config_real *conf = &ConfigureNamesReal[i];
4226 
4227  conf->gen.vartype = PGC_REAL;
4228  num_vars++;
4229  }
4230 
4231  for (i = 0; ConfigureNamesString[i].gen.name; i++)
4232  {
4233  struct config_string *conf = &ConfigureNamesString[i];
4234 
4235  conf->gen.vartype = PGC_STRING;
4236  num_vars++;
4237  }
4238 
4239  for (i = 0; ConfigureNamesEnum[i].gen.name; i++)
4240  {
4241  struct config_enum *conf = &ConfigureNamesEnum[i];
4242 
4243  conf->gen.vartype = PGC_ENUM;
4244  num_vars++;
4245  }
4246 
4247  /*
4248  * Create table with 20% slack
4249  */
4250  size_vars = num_vars + num_vars / 4;
4251 
4252  guc_vars = (struct config_generic **)
4253  guc_malloc(FATAL, size_vars * sizeof(struct config_generic *));
4254 
4255  num_vars = 0;
4256 
4257  for (i = 0; ConfigureNamesBool[i].gen.name; i++)
4258  guc_vars[num_vars++] = &ConfigureNamesBool[i].gen;
4259 
4260  for (i = 0; ConfigureNamesInt[i].gen.name; i++)
4261  guc_vars[num_vars++] = &ConfigureNamesInt[i].gen;
4262 
4263  for (i = 0; ConfigureNamesReal[i].gen.name; i++)
4264  guc_vars[num_vars++] = &ConfigureNamesReal[i].gen;
4265 
4266  for (i = 0; ConfigureNamesString[i].gen.name; i++)
4267  guc_vars[num_vars++] = &ConfigureNamesString[i].gen;
4268 
4269  for (i = 0; ConfigureNamesEnum[i].gen.name; i++)
4270  guc_vars[num_vars++] = &ConfigureNamesEnum[i].gen;
4271 
4272  if (guc_variables)
4274  guc_variables = guc_vars;
4275  num_guc_variables = num_vars;
4276  size_guc_variables = size_vars;
4278  sizeof(struct config_generic *), guc_var_compare);
4279 }
static struct config_int ConfigureNamesInt[]
Definition: guc.c:1676
const char * name
Definition: guc_tables.h:146
static struct config_enum ConfigureNamesEnum[]
Definition: guc.c:3649
static struct config_bool ConfigureNamesBool[]
Definition: guc.c:803
static int guc_var_compare(const void *a, const void *b)
Definition: guc.c:4421
static int num_guc_variables
Definition: guc.c:3938
#define FATAL
Definition: elog.h:52
struct config_generic gen
Definition: guc_tables.h:179
struct config_generic gen
Definition: guc_tables.h:193
static struct config_generic ** guc_variables
Definition: guc.c:3935
enum config_type vartype
Definition: guc_tables.h:153
static int size_guc_variables
Definition: guc.c:3941
static struct config_real ConfigureNamesReal[]
Definition: guc.c:2895
struct config_generic gen
Definition: guc_tables.h:239
struct config_generic gen
Definition: guc_tables.h:225
#define free(a)
Definition: header.h:65
static struct config_string ConfigureNamesString[]
Definition: guc.c:3056
int i
#define qsort(a, b, c, d)
Definition: port.h:440
static void * guc_malloc(int elevel, size_t size)
Definition: guc.c:3976
struct config_generic gen
Definition: guc_tables.h:209
bool config_enum_lookup_by_name ( struct config_enum record,
const char *  value,
int *  retval 
)

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

5642 {
5643  const struct config_enum_entry *entry;
5644 
5645  for (entry = record->options; entry && entry->name; entry++)
5646  {
5647  if (pg_strcasecmp(value, entry->name) == 0)
5648  {
5649  *retval = entry->val;
5650  return TRUE;
5651  }
5652  }
5653 
5654  *retval = 0;
5655  return FALSE;
5656 }
Definition: guc.h:164
int pg_strcasecmp(const char *s1, const char *s2)
Definition: pgstrcasecmp.c:36
#define FALSE
Definition: c.h:221
static struct @121 value
const struct config_enum_entry * options
Definition: guc_tables.h:243
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 5617 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().

5618 {
5619  const struct config_enum_entry *entry;
5620 
5621  for (entry = record->options; entry && entry->name; entry++)
5622  {
5623  if (entry->val == val)
5624  return entry->name;
5625  }
5626 
5627  elog(ERROR, "could not find enum option %d for %s",
5628  val, record->gen.name);
5629  return NULL; /* silence compiler */
5630 }
Definition: guc.h:164
const char * name
Definition: guc_tables.h:146
#define ERROR
Definition: elog.h:43
const struct config_enum_entry * options
Definition: guc_tables.h:243
int val
Definition: guc.h:167
struct config_generic gen
Definition: guc_tables.h:239
#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 4187 of file guc.c.

References guc_variables.

Referenced by GucInfoMain().

4188 {
4189  return guc_variables;
4190 }
static struct config_generic ** guc_variables
Definition: guc.c:3935

Variable Documentation

const char* const config_group_names[]

Definition at line 567 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 530 of file guc.c.

Referenced by printMixedStruct().

const char* const GucSource_Names[]

Definition at line 546 of file guc.c.