Header And Logo

PostgreSQL
| The world's most advanced open source database.

Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

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

Defines

#define GUC_IS_IN_FILE   0x0001

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, STATS, STATS_MONITORING, STATS_COLLECTOR,
  AUTOVACUUM, CLIENT_CONN, CLIENT_CONN_STATEMENT, CLIENT_CONN_LOCALE,
  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 []

Define Documentation

#define GUC_IS_IN_FILE   0x0001

Definition at line 164 of file guc_tables.h.


Typedef Documentation

typedef struct guc_stack GucStack

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 
STATS 
STATS_MONITORING 
STATS_COLLECTOR 
AUTOVACUUM 
CLIENT_CONN 
CLIENT_CONN_STATEMENT 
CLIENT_CONN_LOCALE 
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.

{
    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,
    STATS,
    STATS_MONITORING,
    STATS_COLLECTOR,
    AUTOVACUUM,
    CLIENT_CONN,
    CLIENT_CONN_STATEMENT,
    CLIENT_CONN_LOCALE,
    CLIENT_CONN_OTHER,
    LOCK_MANAGEMENT,
    COMPAT_OPTIONS,
    COMPAT_OPTIONS_PREVIOUS,
    COMPAT_OPTIONS_CLIENT,
    ERROR_HANDLING_OPTIONS,
    PRESET_OPTIONS,
    CUSTOM_OPTIONS,
    DEVELOPER_OPTIONS
};

Enumerator:
PGC_BOOL 
PGC_INT 
PGC_REAL 
PGC_STRING 
PGC_ENUM 

Definition at line 22 of file guc_tables.h.

{
    PGC_BOOL,
    PGC_INT,
    PGC_REAL,
    PGC_STRING,
    PGC_ENUM
};

Enumerator:
GUC_SAVE 
GUC_SET 
GUC_LOCAL 
GUC_SET_LOCAL 

Definition at line 106 of file guc_tables.h.

{
    /* This is almost GucAction, but we need a fourth state for SET+LOCAL */
    GUC_SAVE,                   /* entry caused by function SET option */
    GUC_SET,                    /* entry caused by plain SET command */
    GUC_LOCAL,                  /* entry caused by SET LOCAL command */
    GUC_SET_LOCAL               /* entry caused by SET then SET LOCAL */
} GucStackState;


Function Documentation

void build_guc_variables ( void   ) 

Definition at line 3608 of file guc.c.

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

Referenced by GucInfoMain(), and InitializeGUCOptions().

{
    int         size_vars;
    int         num_vars = 0;
    struct config_generic **guc_vars;
    int         i;

    for (i = 0; ConfigureNamesBool[i].gen.name; i++)
    {
        struct config_bool *conf = &ConfigureNamesBool[i];

        /* Rather than requiring vartype to be filled in by hand, do this: */
        conf->gen.vartype = PGC_BOOL;
        num_vars++;
    }

    for (i = 0; ConfigureNamesInt[i].gen.name; i++)
    {
        struct config_int *conf = &ConfigureNamesInt[i];

        conf->gen.vartype = PGC_INT;
        num_vars++;
    }

    for (i = 0; ConfigureNamesReal[i].gen.name; i++)
    {
        struct config_real *conf = &ConfigureNamesReal[i];

        conf->gen.vartype = PGC_REAL;
        num_vars++;
    }

    for (i = 0; ConfigureNamesString[i].gen.name; i++)
    {
        struct config_string *conf = &ConfigureNamesString[i];

        conf->gen.vartype = PGC_STRING;
        num_vars++;
    }

    for (i = 0; ConfigureNamesEnum[i].gen.name; i++)
    {
        struct config_enum *conf = &ConfigureNamesEnum[i];

        conf->gen.vartype = PGC_ENUM;
        num_vars++;
    }

    /*
     * Create table with 20% slack
     */
    size_vars = num_vars + num_vars / 4;

    guc_vars = (struct config_generic **)
        guc_malloc(FATAL, size_vars * sizeof(struct config_generic *));

    num_vars = 0;

    for (i = 0; ConfigureNamesBool[i].gen.name; i++)
        guc_vars[num_vars++] = &ConfigureNamesBool[i].gen;

    for (i = 0; ConfigureNamesInt[i].gen.name; i++)
        guc_vars[num_vars++] = &ConfigureNamesInt[i].gen;

    for (i = 0; ConfigureNamesReal[i].gen.name; i++)
        guc_vars[num_vars++] = &ConfigureNamesReal[i].gen;

    for (i = 0; ConfigureNamesString[i].gen.name; i++)
        guc_vars[num_vars++] = &ConfigureNamesString[i].gen;

    for (i = 0; ConfigureNamesEnum[i].gen.name; i++)
        guc_vars[num_vars++] = &ConfigureNamesEnum[i].gen;

    if (guc_variables)
        free(guc_variables);
    guc_variables = guc_vars;
    num_guc_variables = num_vars;
    size_guc_variables = size_vars;
    qsort((void *) guc_variables, num_guc_variables,
          sizeof(struct config_generic *), guc_var_compare);
}

bool config_enum_lookup_by_name ( struct config_enum record,
const char *  value,
int *  retval 
)

Definition at line 5060 of file guc.c.

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

Referenced by set_config_option().

{
    const struct config_enum_entry *entry;

    for (entry = record->options; entry && entry->name; entry++)
    {
        if (pg_strcasecmp(value, entry->name) == 0)
        {
            *retval = entry->val;
            return TRUE;
        }
    }

    *retval = 0;
    return FALSE;
}

const char* config_enum_lookup_by_value ( struct config_enum record,
int  val 
)

Definition at line 5037 of file guc.c.

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

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

{
    const struct config_enum_entry *entry;

    for (entry = record->options; entry && entry->name; entry++)
    {
        if (entry->val == val)
            return entry->name;
    }

    elog(ERROR, "could not find enum option %d for %s",
         val, record->gen.name);
    return NULL;                /* silence compiler */
}

struct config_generic** get_guc_variables ( void   )  [read]

Definition at line 3596 of file guc.c.

Referenced by GucInfoMain().

{
    return guc_variables;
}


Variable Documentation

const char* const config_group_names[]

Definition at line 518 of file guc.c.

Referenced by GetConfigOptionByNum(), and printMixedStruct().

const char* const config_type_names[]

Definition at line 619 of file guc.c.

Referenced by GetConfigOptionByNum().

const char* const GucContext_Names[]

Definition at line 482 of file guc.c.

Referenced by GetConfigOptionByNum(), and printMixedStruct().

const char* const GucSource_Names[]

Definition at line 497 of file guc.c.

Referenced by GetConfigOptionByNum().