PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <limits.h>
#include <math.h>
#include <sys/stat.h>
#include <unistd.h>
#include "access/xact.h"
#include "access/xlog.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_parameter_acl.h"
#include "guc_internal.h"
#include "libpq/pqformat.h"
#include "libpq/protocol.h"
#include "miscadmin.h"
#include "parser/scansup.h"
#include "port/pg_bitutils.h"
#include "storage/fd.h"
#include "storage/lwlock.h"
#include "storage/shmem.h"
#include "tcop/tcopprot.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/conffiles.h"
#include "utils/guc_tables.h"
#include "utils/memutils.h"
#include "utils/timestamp.h"
Go to the source code of this file.
Data Structures | |
struct | unit_conversion |
struct | GUCHashEntry |
Macros | |
#define | CONFIG_FILENAME "postgresql.conf" |
#define | HBA_FILENAME "pg_hba.conf" |
#define | IDENT_FILENAME "pg_ident.conf" |
#define | REALTYPE_PRECISION 17 |
#define | GUC_SAFE_SEARCH_PATH "pg_catalog, pg_temp" |
#define | MAX_UNIT_LEN 3 /* length of longest recognized unit string */ |
#define | newval (newval_union.boolval) |
#define | newval (newval_union.intval) |
#define | newval (newval_union.realval) |
#define | newval (newval_union.stringval) |
#define | newval (newval_union.enumval) |
Functions | |
static int | guc_var_compare (const void *a, const void *b) |
static uint32 | guc_name_hash (const void *key, Size keysize) |
static int | guc_name_match (const void *key1, const void *key2, Size keysize) |
static void | InitializeGUCOptionsFromEnvironment (void) |
static void | InitializeOneGUCOption (struct config_generic *gconf) |
static void | RemoveGUCFromLists (struct config_generic *gconf) |
static void | set_guc_source (struct config_generic *gconf, GucSource newsource) |
static void | pg_timezone_abbrev_initialize (void) |
static void | push_old_value (struct config_generic *gconf, GucAction action) |
static void | ReportGUCOption (struct config_generic *record) |
static void | set_config_sourcefile (const char *name, char *sourcefile, int sourceline) |
static void | reapply_stacked_values (struct config_generic *variable, struct config_string *pHolder, GucStack *stack, const char *curvalue, GucContext curscontext, GucSource cursource, Oid cursrole) |
static bool | validate_option_array_item (const char *name, const char *value, bool skipIfNoPermissions) |
static void | write_auto_conf_file (int fd, const char *filename, ConfigVariable *head) |
static void | replace_auto_config_value (ConfigVariable **head_p, ConfigVariable **tail_p, const char *name, const char *value) |
static bool | valid_custom_variable_name (const char *name) |
static bool | assignable_custom_variable_name (const char *name, bool skip_errors, int elevel) |
static void | do_serialize (char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3 |
static void static bool | call_bool_check_hook (struct config_bool *conf, bool *newval, void **extra, GucSource source, int elevel) |
static bool | call_int_check_hook (struct config_int *conf, int *newval, void **extra, GucSource source, int elevel) |
static bool | call_real_check_hook (struct config_real *conf, double *newval, void **extra, GucSource source, int elevel) |
static bool | call_string_check_hook (struct config_string *conf, char **newval, void **extra, GucSource source, int elevel) |
static bool | call_enum_check_hook (struct config_enum *conf, int *newval, void **extra, GucSource source, int elevel) |
ConfigVariable * | ProcessConfigFileInternal (GucContext context, bool applySettings, int elevel) |
void * | guc_malloc (int elevel, size_t size) |
void * | guc_realloc (int elevel, void *old, size_t size) |
char * | guc_strdup (int elevel, const char *src) |
void | guc_free (void *ptr) |
static bool | string_field_used (struct config_string *conf, char *strval) |
static void | set_string_field (struct config_string *conf, char **field, char *newval) |
static bool | extra_field_used (struct config_generic *gconf, void *extra) |
static void | set_extra_field (struct config_generic *gconf, void **field, void *newval) |
static void | set_stack_value (struct config_generic *gconf, config_var_value *val) |
static void | discard_stack_value (struct config_generic *gconf, config_var_value *val) |
struct config_generic ** | get_guc_variables (int *num_vars) |
void | build_guc_variables (void) |
static bool | add_guc_variable (struct config_generic *var, int elevel) |
static struct config_generic * | add_placeholder_variable (const char *name, int elevel) |
struct config_generic * | find_option (const char *name, bool create_placeholders, bool skip_errors, int elevel) |
int | guc_name_compare (const char *namea, const char *nameb) |
char * | convert_GUC_name_for_parameter_acl (const char *name) |
void | check_GUC_name_for_parameter_acl (const char *name) |
void | InitializeGUCOptions (void) |
bool | SelectConfigFiles (const char *userDoption, const char *progname) |
void | ResetAllOptions (void) |
void | AtStart_GUC (void) |
int | NewGUCNestLevel (void) |
void | RestrictSearchPath (void) |
void | AtEOXact_GUC (bool isCommit, int nestLevel) |
void | BeginReportingGUCOptions (void) |
void | ReportChangedGUCOptions (void) |
static bool | convert_to_base_unit (double value, const char *unit, int base_unit, double *base_value) |
static void | convert_int_from_base_unit (int64 base_value, int base_unit, int64 *value, const char **unit) |
static void | convert_real_from_base_unit (double base_value, int base_unit, double *value, const char **unit) |
const char * | get_config_unit_name (int flags) |
bool | parse_int (const char *value, int *result, int flags, const char **hintmsg) |
bool | parse_real (const char *value, double *result, int flags, const char **hintmsg) |
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) |
char * | config_enum_get_options (struct config_enum *record, const char *prefix, const char *suffix, const char *separator) |
static bool | parse_and_validate_value (struct config_generic *record, const char *value, GucSource source, int elevel, union config_var_val *newval, void **newextra) |
int | set_config_option (const char *name, const char *value, GucContext context, GucSource source, GucAction action, bool changeVal, int elevel, bool is_reload) |
int | set_config_option_ext (const char *name, const char *value, GucContext context, GucSource source, Oid srole, GucAction action, bool changeVal, int elevel, bool is_reload) |
int | set_config_with_handle (const char *name, config_handle *handle, const char *value, GucContext context, GucSource source, Oid srole, GucAction action, bool changeVal, int elevel, bool is_reload) |
config_handle * | get_config_handle (const char *name) |
void | SetConfigOption (const char *name, const char *value, GucContext context, GucSource source) |
const char * | GetConfigOption (const char *name, bool missing_ok, bool restrict_privileged) |
const char * | GetConfigOptionResetString (const char *name) |
int | GetConfigOptionFlags (const char *name, bool missing_ok) |
void | AlterSystemSetConfigFile (AlterSystemStmt *altersysstmt) |
static struct config_generic * | init_custom_variable (const char *name, const char *short_desc, const char *long_desc, GucContext context, int flags, enum config_type type, size_t sz) |
static void | define_custom_variable (struct config_generic *variable) |
void | DefineCustomBoolVariable (const char *name, const char *short_desc, const char *long_desc, bool *valueAddr, bool bootValue, GucContext context, int flags, GucBoolCheckHook check_hook, GucBoolAssignHook assign_hook, GucShowHook show_hook) |
void | DefineCustomIntVariable (const char *name, const char *short_desc, const char *long_desc, int *valueAddr, int bootValue, int minValue, int maxValue, GucContext context, int flags, GucIntCheckHook check_hook, GucIntAssignHook assign_hook, GucShowHook show_hook) |
void | DefineCustomRealVariable (const char *name, const char *short_desc, const char *long_desc, double *valueAddr, double bootValue, double minValue, double maxValue, GucContext context, int flags, GucRealCheckHook check_hook, GucRealAssignHook assign_hook, GucShowHook show_hook) |
void | DefineCustomStringVariable (const char *name, const char *short_desc, const char *long_desc, char **valueAddr, const char *bootValue, GucContext context, int flags, GucStringCheckHook check_hook, GucStringAssignHook assign_hook, GucShowHook show_hook) |
void | DefineCustomEnumVariable (const char *name, const char *short_desc, const char *long_desc, int *valueAddr, int bootValue, const struct config_enum_entry *options, GucContext context, int flags, GucEnumCheckHook check_hook, GucEnumAssignHook assign_hook, GucShowHook show_hook) |
void | MarkGUCPrefixReserved (const char *className) |
struct config_generic ** | get_explain_guc_options (int *num) |
char * | GetConfigOptionByName (const char *name, const char **varname, bool missing_ok) |
char * | ShowGUCOption (struct config_generic *record, bool use_units) |
static bool | can_skip_gucvar (struct config_generic *gconf) |
static Size | estimate_variable_size (struct config_generic *gconf) |
Size | EstimateGUCStateSpace (void) |
static void | do_serialize_binary (char **destptr, Size *maxbytes, void *val, Size valsize) |
static void | serialize_variable (char **destptr, Size *maxbytes, struct config_generic *gconf) |
void | SerializeGUCState (Size maxsize, char *start_address) |
static char * | read_gucstate (char **srcptr, char *srcend) |
static void | read_gucstate_binary (char **srcptr, char *srcend, void *dest, Size size) |
static void | guc_restore_error_context_callback (void *arg) |
void | RestoreGUCState (void *gucstate) |
void | ParseLongOption (const char *string, char **name, char **value) |
void | TransformGUCArray (ArrayType *array, List **names, List **values) |
void | ProcessGUCArray (ArrayType *array, GucContext context, GucSource source, GucAction action) |
ArrayType * | GUCArrayAdd (ArrayType *array, const char *name, const char *value) |
ArrayType * | GUCArrayDelete (ArrayType *array, const char *name) |
ArrayType * | GUCArrayReset (ArrayType *array) |
void | GUC_check_errcode (int sqlerrcode) |
Variables | |
static int | GUC_check_errcode_value |
static List * | reserved_class_prefix = NIL |
char * | GUC_check_errmsg_string |
char * | GUC_check_errdetail_string |
char * | GUC_check_errhint_string |
static const char *const | memory_units_hint = gettext_noop("Valid units for this parameter are \"B\", \"kB\", \"MB\", \"GB\", and \"TB\".") |
static const unit_conversion | memory_unit_conversion_table [] |
static const char *const | time_units_hint = gettext_noop("Valid units for this parameter are \"us\", \"ms\", \"s\", \"min\", \"h\", and \"d\".") |
static const unit_conversion | time_unit_conversion_table [] |
static const char *const | map_old_guc_names [] |
static MemoryContext | GUCMemoryContext |
static HTAB * | guc_hashtab |
static dlist_head | guc_nondef_list |
static slist_head | guc_stack_list |
static slist_head | guc_report_list |
static bool | reporting_enabled |
static int | GUCNestLevel = 0 |
#define newval (newval_union.boolval) |
#define newval (newval_union.intval) |
#define newval (newval_union.realval) |
#define newval (newval_union.stringval) |
#define newval (newval_union.enumval) |
|
static |
Definition at line 1047 of file guc.c.
References Assert, ereport, errcode(), errmsg(), guc_hashtab, GUCHashEntry::gucvar, HASH_ENTER_NULL, hash_search(), config_generic::name, and unlikely.
Referenced by add_placeholder_variable(), and define_custom_variable().
|
static |
Definition at line 1177 of file guc.c.
References add_guc_variable(), config_generic::context, CUSTOM_OPTIONS, config_generic::flags, config_string::gen, config_generic::group, GUC_CUSTOM_PLACEHOLDER, guc_free(), guc_malloc(), GUC_NO_SHOW_ALL, GUC_NOT_IN_SAMPLE, guc_strdup(), name, config_generic::name, PGC_STRING, PGC_USERSET, config_generic::short_desc, unconstify, config_string::variable, and config_generic::vartype.
Referenced by find_option().
void AlterSystemSetConfigFile | ( | AlterSystemStmt * | altersysstmt | ) |
Definition at line 4607 of file guc.c.
References ACL_ALTER_SYSTEM, ACLCHECK_OK, AllocateFile(), AllowAlterSystem, assignable_custom_variable_name(), BasicOpenFile(), close, CONF_FILE_START_DEPTH, config_generic::context, DEBUG5, durable_rename(), elog, ereport, errcode(), errcode_for_file_access(), errmsg(), ERROR, ExtractSetVariableArgs(), find_option(), config_generic::flags, FreeConfigVariables(), FreeFile(), GetUserId(), GUC_DISALLOW_IN_AUTO_FILE, GUC_DISALLOW_IN_FILE, guc_free(), infile(), InvokeObjectPostAlterHookArgStr, VariableSetStmt::kind, LOG, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MAXPGPATH, name, VariableSetStmt::name, newval, parse_and_validate_value(), ParseConfigFp(), PG_AUTOCONF_FILENAME, PG_CATCH, PG_END_TRY, pg_parameter_aclcheck(), PG_RE_THROW, PG_TRY, PGC_INTERNAL, PGC_S_FILE, PGC_STRING, replace_auto_config_value(), AlterSystemStmt::setstmt, snprintf, stat, superuser(), value, VAR_RESET, VAR_RESET_ALL, VAR_SET_DEFAULT, VAR_SET_VALUE, config_generic::vartype, and write_auto_conf_file().
Referenced by standard_ProcessUtility().
|
static |
Definition at line 1121 of file guc.c.
References ereport, errcode(), errdetail(), errmsg(), GUC_QUALIFIER_SEPARATOR, lfirst, name, reserved_class_prefix, and valid_custom_variable_name().
Referenced by AlterSystemSetConfigFile(), check_GUC_name_for_parameter_acl(), and find_option().
void AtEOXact_GUC | ( | bool | isCommit, |
int | nestLevel | ||
) |
Definition at line 2262 of file guc.c.
References Assert, config_bool::assign_hook, config_int::assign_hook, config_real::assign_hook, config_string::assign_hook, config_enum::assign_hook, config_var_val::boolval, slist_mutable_iter::cur, discard_stack_value(), config_var_val::enumval, config_var_value::extra, config_generic::extra, config_generic::flags, config_bool::gen, config_int::gen, config_real::gen, config_string::gen, config_enum::gen, GUC_LOCAL, GUC_NEEDS_REPORT, GUC_REPORT, guc_report_list, GUC_SAVE, GUC_SET, GUC_SET_LOCAL, guc_stack_list, GUCNestLevel, config_var_val::intval, guc_stack::masked, guc_stack::masked_scontext, guc_stack::masked_srole, guc_stack::nest_level, newval, pfree(), PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_S_SESSION, PGC_STRING, guc_stack::prev, guc_stack::prior, config_var_val::realval, config_generic::report_link, guc_stack::scontext, config_generic::scontext, set_extra_field(), set_guc_source(), set_string_field(), slist_container, slist_delete_current(), slist_foreach_modify, slist_push_head(), guc_stack::source, guc_stack::srole, config_generic::srole, config_generic::stack, config_generic::stack_link, guc_stack::state, config_generic::status, config_var_val::stringval, config_var_value::val, config_bool::variable, config_int::variable, config_real::variable, config_string::variable, config_enum::variable, and config_generic::vartype.
Referenced by AbortSubTransaction(), AbortTransaction(), brin_summarize_range(), bt_index_check_internal(), cluster_rel(), CommitSubTransaction(), CommitTransaction(), ComputeIndexAttrs(), CreateSchemaCommand(), DefineIndex(), do_analyze_rel(), execute_extension_script(), fmgr_security_definer(), index_build(), index_concurrently_build(), PrepareTransaction(), ProcedureCreate(), RefreshMatViewByOid(), reindex_index(), ReindexRelationConcurrently(), reset_transmission_modes(), restoreLocalGucs(), RestoreUserContext(), RI_Initial_Check(), RI_PartitionRemove_Check(), vacuum_rel(), and validate_index().
void AtStart_GUC | ( | void | ) |
Definition at line 2215 of file guc.c.
References elog, GUCNestLevel, and WARNING.
Referenced by StartTransaction().
void BeginReportingGUCOptions | ( | void | ) |
Definition at line 2546 of file guc.c.
References DestRemote, config_generic::flags, guc_hashtab, GUC_REPORT, GUCHashEntry::gucvar, hash_seq_init(), hash_seq_search(), PGC_INTERNAL, PGC_S_OVERRIDE, RecoveryInProgress(), ReportGUCOption(), reporting_enabled, SetConfigOption(), and whereToSendOutput.
Referenced by PostgresMain().
void build_guc_variables | ( | void | ) |
Definition at line 903 of file guc.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, ConfigureNamesBool, ConfigureNamesEnum, ConfigureNamesInt, ConfigureNamesReal, ConfigureNamesString, HASHCTL::entrysize, config_bool::gen, config_int::gen, config_real::gen, config_string::gen, config_enum::gen, guc_hashtab, guc_name_hash(), guc_name_match(), GUCMemoryContext, GUCHashEntry::gucvar, HASHCTL::hash, HASH_COMPARE, HASH_CONTEXT, hash_create(), HASH_ELEM, HASH_ENTER, HASH_FUNCTION, hash_get_num_entries(), hash_search(), HASHCTL::hcxt, i, HASHCTL::keysize, HASHCTL::match, config_generic::name, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, TopMemoryContext, and config_generic::vartype.
Referenced by GucInfoMain(), and InitializeGUCOptions().
|
static |
Definition at line 6798 of file guc.c.
References config_bool::check_hook, ereport, errcode(), errdetail_internal(), errhint(), errmsg(), errmsg_internal(), config_generic::extra, FlushErrorState(), config_bool::gen, GUC_check_errcode_value, GUC_check_errdetail_string, GUC_check_errhint_string, GUC_check_errmsg_string, config_generic::name, newval, and source.
Referenced by InitializeOneGUCOption(), parse_and_validate_value(), and set_config_with_handle().
|
static |
Definition at line 6950 of file guc.c.
References config_enum::check_hook, config_enum_lookup_by_value(), ereport, errcode(), errdetail_internal(), errhint(), errmsg(), errmsg_internal(), config_generic::extra, FlushErrorState(), config_enum::gen, GUC_check_errcode_value, GUC_check_errdetail_string, GUC_check_errhint_string, GUC_check_errmsg_string, config_generic::name, newval, and source.
Referenced by InitializeOneGUCOption(), parse_and_validate_value(), and set_config_with_handle().
|
static |
Definition at line 6832 of file guc.c.
References config_int::check_hook, ereport, errcode(), errdetail_internal(), errhint(), errmsg(), errmsg_internal(), config_generic::extra, FlushErrorState(), config_int::gen, GUC_check_errcode_value, GUC_check_errdetail_string, GUC_check_errhint_string, GUC_check_errmsg_string, config_generic::name, newval, and source.
Referenced by InitializeOneGUCOption(), parse_and_validate_value(), and set_config_with_handle().
|
static |
Definition at line 6866 of file guc.c.
References config_real::check_hook, ereport, errcode(), errdetail_internal(), errhint(), errmsg(), errmsg_internal(), config_generic::extra, FlushErrorState(), config_real::gen, GUC_check_errcode_value, GUC_check_errdetail_string, GUC_check_errhint_string, GUC_check_errmsg_string, config_generic::name, newval, and source.
Referenced by InitializeOneGUCOption(), parse_and_validate_value(), and set_config_with_handle().
|
static |
Definition at line 6900 of file guc.c.
References config_string::check_hook, ereport, errcode(), errdetail_internal(), errhint(), errmsg(), errmsg_internal(), config_generic::extra, FlushErrorState(), config_string::gen, GUC_check_errcode_value, GUC_check_errdetail_string, GUC_check_errhint_string, GUC_check_errmsg_string, guc_free(), config_generic::name, newval, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, and source.
Referenced by InitializeOneGUCOption(), parse_and_validate_value(), and set_config_with_handle().
|
static |
Definition at line 5814 of file guc.c.
References config_generic::context, PGC_INTERNAL, PGC_POSTMASTER, PGC_S_DEFAULT, and config_generic::source.
Referenced by estimate_variable_size(), RestoreGUCState(), and serialize_variable().
void check_GUC_name_for_parameter_acl | ( | const char * | name | ) |
Definition at line 1410 of file guc.c.
References assignable_custom_variable_name(), DEBUG5, ERROR, find_option(), and name.
Referenced by ParameterAclCreate().
char* config_enum_get_options | ( | struct config_enum * | record, |
const char * | prefix, | ||
const char * | suffix, | ||
const char * | separator | ||
) |
Definition at line 3072 of file guc.c.
References appendBinaryStringInfo(), appendStringInfoString(), StringInfoData::data, config_enum_entry::hidden, initStringInfo(), StringInfoData::len, config_enum_entry::name, and config_enum::options.
Referenced by GetConfigOptionValues(), and parse_and_validate_value().
bool config_enum_lookup_by_name | ( | struct config_enum * | record, |
const char * | value, | ||
int * | retval | ||
) |
Definition at line 3046 of file guc.c.
References config_enum_entry::name, config_enum::options, pg_strcasecmp(), config_enum_entry::val, and value.
Referenced by parse_and_validate_value().
const char* config_enum_lookup_by_value | ( | struct config_enum * | record, |
int | val | ||
) |
Definition at line 3023 of file guc.c.
References elog, ERROR, config_enum::gen, config_enum_entry::name, config_generic::name, config_enum::options, config_enum_entry::val, and val.
Referenced by call_enum_check_hook(), estimate_variable_size(), GetConfigOption(), GetConfigOptionResetString(), GetConfigOptionValues(), serialize_variable(), and ShowGUCOption().
char* convert_GUC_name_for_parameter_acl | ( | const char * | name | ) |
Definition at line 1374 of file guc.c.
References guc_name_compare(), i, map_old_guc_names, name, and pstrdup().
Referenced by ParameterAclCreate(), ParameterAclLookup(), and pg_parameter_aclmask().
|
static |
Definition at line 2729 of file guc.c.
References Assert, GUC_UNIT_MEMORY, i, memory_unit_conversion_table, time_unit_conversion_table, unit_conversion::unit, and value.
Referenced by ShowGUCOption().
|
static |
Definition at line 2771 of file guc.c.
References Assert, GUC_UNIT_MEMORY, i, memory_unit_conversion_table, unit_conversion::multiplier, time_unit_conversion_table, unit_conversion::unit, and value.
Referenced by ShowGUCOption().
|
static |
Definition at line 2671 of file guc.c.
References GUC_UNIT_MEMORY, i, MAX_UNIT_LEN, memory_unit_conversion_table, unit_conversion::multiplier, time_unit_conversion_table, unit_conversion::unit, and value.
Referenced by parse_int(), and parse_real().
|
static |
Definition at line 4931 of file guc.c.
References add_guc_variable(), Assert, ereport, errcode(), errmsg(), ERROR, config_generic::flags, config_string::gen, GUC_ACTION_SET, GUC_CUSTOM_PLACEHOLDER, guc_free(), guc_hashtab, GUCHashEntry::gucname, GUCHashEntry::gucvar, HASH_FIND, hash_search(), InitializeOneGUCOption(), name, variable::name, PGC_STRING, reapply_stacked_values(), RemoveGUCFromLists(), config_generic::reset_scontext, config_generic::reset_source, config_generic::reset_srole, config_string::reset_val, config_generic::scontext, set_config_option_ext(), set_config_sourcefile(), set_string_field(), config_generic::source, config_generic::sourcefile, config_generic::sourceline, config_generic::srole, config_generic::stack, config_string::variable, config_generic::vartype, and WARNING.
Referenced by DefineCustomBoolVariable(), DefineCustomEnumVariable(), DefineCustomIntVariable(), DefineCustomRealVariable(), and DefineCustomStringVariable().
void DefineCustomBoolVariable | ( | const char * | name, |
const char * | short_desc, | ||
const char * | long_desc, | ||
bool * | valueAddr, | ||
bool | bootValue, | ||
GucContext | context, | ||
int | flags, | ||
GucBoolCheckHook | check_hook, | ||
GucBoolAssignHook | assign_hook, | ||
GucShowHook | show_hook | ||
) |
Definition at line 5132 of file guc.c.
References config_bool::assign_hook, config_bool::boot_val, config_bool::check_hook, context, define_custom_variable(), config_bool::gen, init_custom_variable(), name, PGC_BOOL, config_bool::reset_val, config_bool::show_hook, and config_bool::variable.
Referenced by _PG_init().
void DefineCustomEnumVariable | ( | const char * | name, |
const char * | short_desc, | ||
const char * | long_desc, | ||
int * | valueAddr, | ||
int | bootValue, | ||
const struct config_enum_entry * | options, | ||
GucContext | context, | ||
int | flags, | ||
GucEnumCheckHook | check_hook, | ||
GucEnumAssignHook | assign_hook, | ||
GucShowHook | show_hook | ||
) |
Definition at line 5243 of file guc.c.
References config_enum::assign_hook, config_enum::boot_val, config_enum::check_hook, context, define_custom_variable(), config_enum::gen, init_custom_variable(), name, options, config_enum::options, PGC_ENUM, config_enum::reset_val, config_enum::show_hook, and config_enum::variable.
Referenced by _PG_init().
void DefineCustomIntVariable | ( | const char * | name, |
const char * | short_desc, | ||
const char * | long_desc, | ||
int * | valueAddr, | ||
int | bootValue, | ||
int | minValue, | ||
int | maxValue, | ||
GucContext | context, | ||
int | flags, | ||
GucIntCheckHook | check_hook, | ||
GucIntAssignHook | assign_hook, | ||
GucShowHook | show_hook | ||
) |
Definition at line 5158 of file guc.c.
References config_int::assign_hook, config_int::boot_val, config_int::check_hook, context, define_custom_variable(), config_int::gen, init_custom_variable(), config_int::max, config_int::min, name, PGC_INT, config_int::reset_val, config_int::show_hook, and config_int::variable.
Referenced by _PG_init().
void DefineCustomRealVariable | ( | const char * | name, |
const char * | short_desc, | ||
const char * | long_desc, | ||
double * | valueAddr, | ||
double | bootValue, | ||
double | minValue, | ||
double | maxValue, | ||
GucContext | context, | ||
int | flags, | ||
GucRealCheckHook | check_hook, | ||
GucRealAssignHook | assign_hook, | ||
GucShowHook | show_hook | ||
) |
Definition at line 5188 of file guc.c.
References config_real::assign_hook, config_real::boot_val, config_real::check_hook, context, define_custom_variable(), config_real::gen, init_custom_variable(), config_real::max, config_real::min, name, PGC_REAL, config_real::reset_val, config_real::show_hook, and config_real::variable.
Referenced by _PG_init().
void DefineCustomStringVariable | ( | const char * | name, |
const char * | short_desc, | ||
const char * | long_desc, | ||
char ** | valueAddr, | ||
const char * | bootValue, | ||
GucContext | context, | ||
int | flags, | ||
GucStringCheckHook | check_hook, | ||
GucStringAssignHook | assign_hook, | ||
GucShowHook | show_hook | ||
) |
Definition at line 5218 of file guc.c.
References config_string::assign_hook, config_string::boot_val, config_string::check_hook, context, define_custom_variable(), config_string::gen, init_custom_variable(), name, PGC_STRING, config_string::show_hook, and config_string::variable.
Referenced by _PG_init().
|
static |
Definition at line 846 of file guc.c.
References PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, set_extra_field(), set_string_field(), val, and config_generic::vartype.
Referenced by AtEOXact_GUC(), and push_old_value().
|
static |
Definition at line 5979 of file guc.c.
References elog, ERROR, fmt, va_end(), va_start(), and vsnprintf.
Referenced by serialize_variable().
|
static |
|
static |
Definition at line 5848 of file guc.c.
References add_size(), can_skip_gucvar(), config_enum_lookup_by_value(), config_generic::name, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, REALTYPE_PRECISION, config_generic::scontext, size, config_generic::source, config_generic::sourcefile, config_generic::sourceline, config_generic::srole, config_int::variable, config_string::variable, config_enum::variable, and config_generic::vartype.
Referenced by EstimateGUCStateSpace().
Size EstimateGUCStateSpace | ( | void | ) |
Definition at line 5948 of file guc.c.
References add_size(), dlist_iter::cur, dlist_container, dlist_foreach, estimate_variable_size(), guc_nondef_list, config_generic::nondef_link, and size.
Referenced by InitializeParallelDSM().
|
static |
Definition at line 747 of file guc.c.
References config_var_value::extra, config_generic::extra, guc_stack::masked, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, guc_stack::prev, guc_stack::prior, config_generic::stack, and config_generic::vartype.
Referenced by set_config_with_handle(), and set_extra_field().
struct config_generic* find_option | ( | const char * | name, |
bool | create_placeholders, | ||
bool | skip_errors, | ||
int | elevel | ||
) |
Definition at line 1235 of file guc.c.
References add_placeholder_variable(), Assert, assignable_custom_variable_name(), ereport, errcode(), errmsg(), guc_hashtab, guc_name_compare(), GUCHashEntry::gucvar, HASH_FIND, hash_search(), i, map_old_guc_names, and name.
Referenced by AlterSystemSetConfigFile(), check_GUC_name_for_parameter_acl(), flatten_set_variable_args(), get_config_handle(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionFlags(), GetConfigOptionResetString(), GUCArrayAdd(), GUCArrayDelete(), InitializeWalConsistencyChecking(), pg_settings_get_flags(), ProcessConfigFileInternal(), SelectConfigFiles(), set_config_sourcefile(), set_config_with_handle(), and validate_option_array_item().
config_handle* get_config_handle | ( | const char * | name | ) |
Definition at line 4284 of file guc.c.
References find_option(), config_generic::flags, GUC_CUSTOM_PLACEHOLDER, and name.
Referenced by fmgr_security_definer().
const char* get_config_unit_name | ( | int | flags | ) |
Definition at line 2814 of file guc.c.
References elog, ERROR, config_generic::flags, GUC_UNIT, GUC_UNIT_BLOCKS, GUC_UNIT_BYTE, GUC_UNIT_KB, GUC_UNIT_MB, GUC_UNIT_MIN, GUC_UNIT_MS, GUC_UNIT_S, GUC_UNIT_XBLOCKS, and snprintf.
Referenced by GetConfigOptionValues(), and parse_and_validate_value().
struct config_generic** get_explain_guc_options | ( | int * | num | ) |
Definition at line 5331 of file guc.c.
References config_bool::boot_val, config_int::boot_val, config_real::boot_val, config_string::boot_val, config_enum::boot_val, ConfigOptionIsVisible(), dlist_iter::cur, dlist_container, dlist_foreach, elog, ERROR, config_generic::flags, GUC_EXPLAIN, guc_hashtab, guc_nondef_list, hash_get_num_entries(), config_generic::nondef_link, palloc(), PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, config_bool::variable, config_int::variable, config_real::variable, config_string::variable, config_enum::variable, and config_generic::vartype.
Referenced by ExplainPrintSettings().
struct config_generic** get_guc_variables | ( | int * | num_vars | ) |
Definition at line 872 of file guc.c.
References Assert, guc_hashtab, guc_var_compare(), GUCHashEntry::gucvar, hash_get_num_entries(), hash_seq_init(), hash_seq_search(), i, palloc(), qsort, and config_generic::status.
Referenced by GucInfoMain(), show_all_settings(), and ShowAllGUCConfig().
Definition at line 4355 of file guc.c.
References config_enum_lookup_by_value(), ConfigOptionIsVisible(), ereport, errcode(), errdetail(), errmsg(), ERROR, find_option(), name, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, snprintf, and config_generic::vartype.
Referenced by applyRemoteGucs(), be_tls_init(), CreateSharedMemoryAndSemaphores(), PostmasterMain(), and ProcessConfigFileInternal().
char* GetConfigOptionByName | ( | const char * | name, |
const char ** | varname, | ||
bool | missing_ok | ||
) |
Definition at line 5432 of file guc.c.
References ConfigOptionIsVisible(), ereport, errcode(), errdetail(), errmsg(), ERROR, find_option(), name, config_generic::name, and ShowGUCOption().
Referenced by ExplainPrintSettings(), ExtractSetVariableArgs(), GetPGVariableResultDesc(), set_config_by_name(), show_config_by_name(), show_config_by_name_missing_ok(), and ShowGUCConfigOption().
int GetConfigOptionFlags | ( | const char * | name, |
bool | missing_ok | ||
) |
Definition at line 4452 of file guc.c.
References ERROR, find_option(), config_generic::flags, and name.
Referenced by pg_get_functiondef(), and PostmasterMain().
const char* GetConfigOptionResetString | ( | const char * | name | ) |
Definition at line 4405 of file guc.c.
References Assert, config_enum_lookup_by_value(), ConfigOptionIsVisible(), ereport, errcode(), errdetail(), errmsg(), ERROR, find_option(), name, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, config_string::reset_val, snprintf, and config_generic::vartype.
Referenced by check_datestyle().
void GUC_check_errcode | ( | int | sqlerrcode | ) |
Definition at line 6785 of file guc.c.
References GUC_check_errcode_value.
Referenced by check_client_encoding(), check_default_with_oids(), check_role(), check_session_authorization(), check_synchronous_standby_names(), check_transaction_deferrable(), check_transaction_isolation(), and check_transaction_read_only().
void guc_free | ( | void * | ptr | ) |
Definition at line 689 of file guc.c.
References Assert, GetMemoryChunkContext(), GUCMemoryContext, and pfree().
Referenced by add_placeholder_variable(), AlterSystemSetConfigFile(), call_string_check_hook(), check_client_encoding(), check_datestyle(), check_default_text_search_config(), define_custom_variable(), parse_and_validate_value(), ReportGUCOption(), RestoreGUCState(), SelectConfigFiles(), set_config_sourcefile(), set_config_with_handle(), set_extra_field(), and set_string_field().
void* guc_malloc | ( | int | elevel, |
size_t | size | ||
) |
Definition at line 638 of file guc.c.
References data, ereport, errcode(), errmsg(), GUCMemoryContext, MCXT_ALLOC_NO_OOM, MemoryContextAllocExtended(), size, and unlikely.
Referenced by add_placeholder_variable(), check_backtrace_functions(), check_client_encoding(), check_createrole_self_grant(), check_datestyle(), check_debug_io_direct(), check_log_destination(), check_log_timezone(), check_random_seed(), check_recovery_target_lsn(), check_recovery_target_timeline(), check_recovery_target_xid(), check_restrict_nonsystem_relation_kind(), check_role(), check_session_authorization(), check_synchronized_standby_slots(), check_synchronous_standby_names(), check_temp_tablespaces(), check_timezone(), check_wal_consistency_checking(), ConvertTimeZoneAbbrevs(), guc_strdup(), init_custom_variable(), plpgsql_extra_checks_check_hook(), and SelectConfigFiles().
int guc_name_compare | ( | const char * | namea, |
const char * | nameb | ||
) |
Definition at line 1300 of file guc.c.
Referenced by convert_GUC_name_for_parameter_acl(), find_option(), GetPGVariable(), GetPGVariableResultDesc(), guc_name_match(), guc_var_compare(), and replace_auto_config_value().
Definition at line 1330 of file guc.c.
References sort-test::key, name, and pg_rotate_left32().
Referenced by build_guc_variables().
|
static |
Definition at line 1354 of file guc.c.
References guc_name_compare().
Referenced by build_guc_variables().
void* guc_realloc | ( | int | elevel, |
void * | old, | ||
size_t | size | ||
) |
Definition at line 652 of file guc.c.
References Assert, data, ereport, errcode(), errmsg(), GetMemoryChunkContext(), GUCMemoryContext, MCXT_ALLOC_NO_OOM, MemoryContextAllocExtended(), repalloc_extended(), size, and unlikely.
|
static |
Definition at line 6171 of file guc.c.
References arg, and errcontext.
Referenced by RestoreGUCState().
char* guc_strdup | ( | int | elevel, |
const char * | src | ||
) |
Definition at line 677 of file guc.c.
References data, guc_malloc(), len, and likely.
Referenced by add_placeholder_variable(), check_application_name(), check_client_encoding(), check_cluster_name(), check_datestyle(), check_default_text_search_config(), init_custom_variable(), InitializeOneGUCOption(), parse_and_validate_value(), ReportGUCOption(), set_config_sourcefile(), and set_config_with_handle().
|
static |
Definition at line 1288 of file guc.c.
References a, b, and guc_name_compare().
Referenced by get_guc_variables().
Definition at line 6488 of file guc.c.
References a, ARR_DIMS, ARR_ELEMTYPE, ARR_LBOUND, ARR_NDIM, array_ref(), array_set(), Assert, construct_array_builtin(), CStringGetTextDatum, find_option(), i, name, config_generic::name, newval, psprintf(), TextDatumGetCString, validate_option_array_item(), value, and WARNING.
Referenced by AlterSetting(), and update_proconfig_value().
Definition at line 6566 of file guc.c.
References ARR_DIMS, array_ref(), array_set(), Assert, construct_array_builtin(), find_option(), i, name, config_generic::name, TextDatumGetCString, val, validate_option_array_item(), and WARNING.
Referenced by AlterSetting(), and update_proconfig_value().
Definition at line 6636 of file guc.c.
References ARR_DIMS, array_ref(), array_set(), construct_array_builtin(), i, pfree(), superuser(), TextDatumGetCString, val, and validate_option_array_item().
Referenced by AlterSetting().
|
static |
Definition at line 4871 of file guc.c.
References context, config_generic::context, CUSTOM_OPTIONS, elog, ERROR, FATAL, config_generic::flags, config_generic::group, GUC_LIST_QUOTE, guc_malloc(), guc_strdup(), config_generic::long_desc, name, config_generic::name, PGC_POSTMASTER, PGC_SUSET, PGC_USERSET, process_shared_preload_libraries_in_progress, config_generic::short_desc, type, and config_generic::vartype.
Referenced by DefineCustomBoolVariable(), DefineCustomEnumVariable(), DefineCustomIntVariable(), DefineCustomRealVariable(), and DefineCustomStringVariable().
void InitializeGUCOptions | ( | void | ) |
Definition at line 1530 of file guc.c.
References Assert, build_guc_variables(), guc_hashtab, GUCHashEntry::gucvar, hash_seq_init(), hash_seq_search(), InitializeGUCOptionsFromEnvironment(), InitializeOneGUCOption(), pg_timezone_initialize(), PGC_POSTMASTER, PGC_S_OVERRIDE, reporting_enabled, and SetConfigOption().
Referenced by BootstrapModeMain(), PostgresSingleUserMain(), and PostmasterMain().
|
static |
Definition at line 1589 of file guc.c.
References get_stack_depth_rlimit(), PGC_POSTMASTER, PGC_S_DYNAMIC_DEFAULT, PGC_S_ENV_VAR, SetConfigOption(), snprintf, source, and STACK_DEPTH_SLOP.
Referenced by InitializeGUCOptions(), and ProcessConfigFileInternal().
|
static |
Definition at line 1644 of file guc.c.
References Assert, config_bool::assign_hook, config_int::assign_hook, config_real::assign_hook, config_string::assign_hook, config_enum::assign_hook, config_bool::boot_val, config_int::boot_val, config_real::boot_val, config_string::boot_val, config_enum::boot_val, call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), elog, config_generic::extra, FATAL, config_bool::gen, config_int::gen, config_real::gen, config_string::gen, config_enum::gen, guc_strdup(), config_generic::last_reported, LOG, config_int::max, config_real::max, config_int::min, config_real::min, config_generic::name, newval, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_INTERNAL, PGC_REAL, PGC_S_DEFAULT, PGC_STRING, config_bool::reset_extra, config_int::reset_extra, config_real::reset_extra, config_string::reset_extra, config_enum::reset_extra, config_generic::reset_scontext, config_generic::reset_source, config_generic::reset_srole, config_bool::reset_val, config_int::reset_val, config_real::reset_val, config_string::reset_val, config_enum::reset_val, config_generic::scontext, config_generic::source, config_generic::sourcefile, config_generic::sourceline, config_generic::srole, config_generic::stack, config_generic::status, config_bool::variable, config_int::variable, config_real::variable, config_string::variable, config_enum::variable, and config_generic::vartype.
Referenced by define_custom_variable(), InitializeGUCOptions(), and RestoreGUCState().
void MarkGUCPrefixReserved | ( | const char * | className | ) |
Definition at line 5279 of file guc.c.
References ereport, errcode(), errdetail(), errmsg(), config_generic::flags, GUC_CUSTOM_PLACEHOLDER, guc_hashtab, GUC_QUALIFIER_SEPARATOR, GUCMemoryContext, GUCHashEntry::gucvar, HASH_REMOVE, hash_search(), hash_seq_init(), hash_seq_search(), lappend(), MemoryContextSwitchTo(), config_generic::name, pstrdup(), RemoveGUCFromLists(), reserved_class_prefix, and WARNING.
Referenced by _PG_init().
int NewGUCNestLevel | ( | void | ) |
Definition at line 2235 of file guc.c.
References GUCNestLevel.
Referenced by applyRemoteGucs(), brin_summarize_range(), bt_index_check_internal(), cluster_rel(), ComputeIndexAttrs(), CreateSchemaCommand(), DefineIndex(), do_analyze_rel(), execute_extension_script(), fmgr_security_definer(), index_build(), index_concurrently_build(), ProcedureCreate(), PushTransaction(), RefreshMatViewByOid(), reindex_index(), ReindexRelationConcurrently(), RI_Initial_Check(), RI_PartitionRemove_Check(), set_transmission_modes(), SwitchToUntrustedUser(), vacuum_rel(), and validate_index().
|
static |
Definition at line 3129 of file guc.c.
References _, call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), config_enum_get_options(), config_enum_lookup_by_name(), ereport, errcode(), errhint(), errmsg(), config_generic::flags, config_bool::gen, config_int::gen, config_real::gen, config_string::gen, config_enum::gen, get_config_unit_name(), guc_free(), GUC_IS_NAME, guc_strdup(), config_int::max, config_real::max, config_int::min, config_real::min, config_generic::name, newval, parse_bool(), parse_int(), parse_real(), pfree(), PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, source, truncate_identifier(), value, and config_generic::vartype.
Referenced by AlterSystemSetConfigFile(), and set_config_with_handle().
bool parse_int | ( | const char * | value, |
int * | result, | ||
int | flags, | ||
const char ** | hintmsg | ||
) |
Definition at line 2871 of file guc.c.
References convert_to_base_unit(), config_generic::flags, gettext_noop, GUC_UNIT, GUC_UNIT_MEMORY, memory_units_hint, time_units_hint, val, and value.
Referenced by apply_server_options(), apply_table_options(), ExecVacuum(), get_batch_size_option(), parse_and_validate_value(), parse_one_reloption(), postgres_fdw_validator(), and postgresAcquireSampleRowsFunc().
bool parse_real | ( | const char * | value, |
double * | result, | ||
int | flags, | ||
const char ** | hintmsg | ||
) |
Definition at line 2961 of file guc.c.
References convert_to_base_unit(), config_generic::flags, GUC_UNIT, GUC_UNIT_MEMORY, memory_units_hint, time_units_hint, val, and value.
Referenced by apply_server_options(), parse_and_validate_value(), parse_one_reloption(), and postgres_fdw_validator().
void ParseLongOption | ( | const char * | string, |
char ** | name, | ||
char ** | value | ||
) |
Definition at line 6362 of file guc.c.
References Assert, name, palloc(), pstrdup(), strlcpy(), and value.
Referenced by BootstrapModeMain(), PostmasterMain(), process_postgres_switches(), and TransformGUCArray().
|
static |
Definition at line 1992 of file guc.c.
References PGC_POSTMASTER, PGC_S_DYNAMIC_DEFAULT, and SetConfigOption().
Referenced by ProcessConfigFileInternal(), and SelectConfigFiles().
ConfigVariable* ProcessConfigFileInternal | ( | GucContext | context, |
bool | applySettings, | ||
int | elevel | ||
) |
Definition at line 282 of file guc.c.
References ConfigVariable::applied, bail_out(), CONF_FILE_START_DEPTH, ConfigFileName, context, config_generic::context, DataDir, ereport, errcode(), errmsg(), ConfigVariable::errmsg, ERROR, error(), ConfigVariable::filename, find_option(), GetConfigOption(), GetCurrentTimestamp(), GetDatabaseEncodingName(), GUC_ACTION_SET, guc_hashtab, GUC_IS_IN_FILE, GUC_PENDING_RESTART, GUCHashEntry::gucvar, hash_seq_init(), hash_seq_search(), ConfigVariable::ignore, InitializeGUCOptionsFromEnvironment(), IsUnderPostmaster, ConfigVariable::name, config_generic::name, ConfigVariable::next, ParseConfigFile(), pfree(), PG_AUTOCONF_FILENAME, pg_timezone_abbrev_initialize(), PGC_BACKEND, PGC_POSTMASTER, PGC_S_DEFAULT, PGC_S_DYNAMIC_DEFAULT, PGC_S_FILE, PGC_SIGHUP, PgReloadTime, guc_stack::prev, psprintf(), pstrdup(), record_config_file_error(), config_generic::reset_source, set_config_option(), set_config_sourcefile(), set_guc_source(), SetConfigOption(), guc_stack::source, config_generic::source, ConfigVariable::sourceline, config_generic::stack, config_generic::status, valid_custom_variable_name(), and ConfigVariable::value.
Referenced by show_all_file_settings().
void ProcessGUCArray | ( | ArrayType * | array, |
GucContext | context, | ||
GucSource | source, | ||
GucAction | action | ||
) |
Definition at line 6456 of file guc.c.
References generate_unaccent_rules::action, context, forboth, lfirst, list_free(), name, pfree(), set_config_option(), source, TransformGUCArray(), and value.
Referenced by ApplySetting(), and ProcedureCreate().
|
static |
Definition at line 2134 of file guc.c.
References generate_unaccent_rules::action, Assert, discard_stack_value(), GUC_ACTION_LOCAL, GUC_ACTION_SAVE, GUC_ACTION_SET, GUC_LOCAL, GUC_SAVE, GUC_SET, GUC_SET_LOCAL, guc_stack_list, GUCNestLevel, guc_stack::masked, guc_stack::masked_scontext, guc_stack::masked_srole, MemoryContextAllocZero(), guc_stack::nest_level, guc_stack::prev, guc_stack::prior, guc_stack::scontext, config_generic::scontext, set_stack_value(), slist_push_head(), guc_stack::source, config_generic::source, guc_stack::srole, config_generic::srole, config_generic::stack, config_generic::stack_link, guc_stack::state, and TopTransactionContext.
Referenced by ResetAllOptions(), and set_config_with_handle().
|
static |
|
static |
Definition at line 6157 of file guc.c.
References generate_unaccent_rules::dest, elog, ERROR, and size.
Referenced by RestoreGUCState().
|
static |
Definition at line 5040 of file guc.c.
References config_string::gen, GUC_ACTION_LOCAL, GUC_ACTION_SAVE, GUC_ACTION_SET, GUC_LOCAL, GUC_SAVE, GUC_SET, GUC_SET_LOCAL, guc_stack_list, guc_stack::masked, guc_stack::masked_scontext, guc_stack::masked_srole, name, variable::name, guc_stack::nest_level, PGC_S_SESSION, guc_stack::prev, guc_stack::prior, config_generic::reset_scontext, config_generic::reset_source, config_generic::reset_srole, config_string::reset_val, guc_stack::scontext, set_config_option_ext(), slist_delete(), guc_stack::source, guc_stack::srole, guc_stack::state, config_var_val::stringval, config_var_value::val, and WARNING.
Referenced by define_custom_variable().
|
static |
Definition at line 1761 of file guc.c.
References dlist_delete(), GUC_NEEDS_REPORT, guc_report_list, guc_stack_list, config_generic::nondef_link, PGC_S_DEFAULT, config_generic::report_link, slist_delete(), config_generic::source, config_generic::stack, config_generic::stack_link, and config_generic::status.
Referenced by define_custom_variable(), MarkGUCPrefixReserved(), and RestoreGUCState().
|
static |
Definition at line 4537 of file guc.c.
References ConfigVariable::applied, ConfigVariable::errmsg, ConfigVariable::filename, guc_name_compare(), ConfigVariable::ignore, name, ConfigVariable::name, next, ConfigVariable::next, palloc(), pfree(), pstrdup(), ConfigVariable::sourceline, ConfigVariable::value, and value.
Referenced by AlterSystemSetConfigFile().
void ReportChangedGUCOptions | ( | void | ) |
Definition at line 2596 of file guc.c.
References Assert, slist_mutable_iter::cur, config_generic::flags, GUC_NEEDS_REPORT, GUC_REPORT, guc_report_list, in_hot_standby_guc, PGC_INTERNAL, PGC_S_OVERRIDE, RecoveryInProgress(), config_generic::report_link, ReportGUCOption(), reporting_enabled, SetConfigOption(), slist_container, slist_delete_current(), slist_foreach_modify, and config_generic::status.
Referenced by PostgresMain().
|
static |
Definition at line 2634 of file guc.c.
References guc_free(), guc_strdup(), config_generic::last_reported, LOG, config_generic::name, pfree(), pq_beginmessage(), pq_endmessage(), pq_sendstring(), PqMsg_ParameterStatus, ShowGUCOption(), and val.
Referenced by BeginReportingGUCOptions(), and ReportChangedGUCOptions().
void ResetAllOptions | ( | void | ) |
Definition at line 2003 of file guc.c.
References config_bool::assign_hook, config_int::assign_hook, config_real::assign_hook, config_string::assign_hook, config_enum::assign_hook, config_generic::context, dlist_mutable_iter::cur, dlist_container, dlist_foreach_modify, config_generic::extra, config_generic::flags, config_bool::gen, config_int::gen, config_real::gen, config_string::gen, config_enum::gen, GUC_ACTION_SET, GUC_NEEDS_REPORT, GUC_NO_RESET_ALL, guc_nondef_list, GUC_REPORT, guc_report_list, config_generic::nondef_link, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_S_OVERRIDE, PGC_STRING, PGC_SUSET, PGC_USERSET, push_old_value(), config_generic::report_link, config_bool::reset_extra, config_int::reset_extra, config_real::reset_extra, config_string::reset_extra, config_enum::reset_extra, config_generic::reset_scontext, config_generic::reset_source, config_generic::reset_srole, config_bool::reset_val, config_int::reset_val, config_real::reset_val, config_string::reset_val, config_enum::reset_val, config_generic::scontext, set_extra_field(), set_guc_source(), set_string_field(), slist_push_head(), config_generic::source, config_generic::srole, config_generic::status, config_bool::variable, config_int::variable, config_real::variable, config_string::variable, config_enum::variable, and config_generic::vartype.
Referenced by DiscardAll(), and ExecSetVariableStmt().
void RestoreGUCState | ( | void * | gucstate | ) |
Definition at line 6193 of file guc.c.
References ErrorContextCallback::arg, Assert, ErrorContextCallback::callback, can_skip_gucvar(), dlist_mutable_iter::cur, dlist_container, dlist_foreach_modify, ereport, errcode(), errmsg(), ERROR, error_context_stack, config_generic::extra, GUC_ACTION_SET, guc_free(), guc_nondef_list, guc_restore_error_context_callback(), InitializeOneGUCOption(), config_generic::last_reported, len, config_generic::nondef_link, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, ErrorContextCallback::previous, read_gucstate(), read_gucstate_binary(), RemoveGUCFromLists(), config_bool::reset_extra, config_int::reset_extra, config_real::reset_extra, config_string::reset_extra, config_enum::reset_extra, config_string::reset_val, set_config_option_ext(), set_config_sourcefile(), config_generic::sourcefile, config_generic::stack, config_string::variable, and config_generic::vartype.
Referenced by ParallelWorkerMain().
void RestrictSearchPath | ( | void | ) |
Definition at line 2246 of file guc.c.
References GUC_ACTION_SAVE, GUC_SAFE_SEARCH_PATH, IsBootstrapProcessingMode, PGC_S_SESSION, PGC_USERSET, and set_config_option().
Referenced by brin_summarize_range(), bt_index_check_internal(), cluster_rel(), ComputeIndexAttrs(), DefineIndex(), do_analyze_rel(), index_build(), index_concurrently_build(), RefreshMatViewByOid(), reindex_index(), ReindexRelationConcurrently(), vacuum_rel(), and validate_index().
bool SelectConfigFiles | ( | const char * | userDoption, |
const char * | progname | ||
) |
Definition at line 1784 of file guc.c.
References CONFIG_FILENAME, ConfigFileName, DataDir, FATAL, find_option(), free, guc_free(), guc_malloc(), HBA_FILENAME, HbaFileName, IDENT_FILENAME, IdentFileName, make_absolute_path(), PANIC, pg_timezone_abbrev_initialize(), PGC_POSTMASTER, PGC_S_OVERRIDE, ProcessConfigFile(), progname, SetConfigOption(), SetDataDir(), sprintf, stat, userDoption, config_string::variable, and write_stderr.
Referenced by BootstrapModeMain(), PostgresSingleUserMain(), and PostmasterMain().
|
static |
Definition at line 6024 of file guc.c.
References can_skip_gucvar(), config_enum_lookup_by_value(), do_serialize(), do_serialize_binary(), config_generic::name, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, REALTYPE_PRECISION, config_generic::scontext, config_generic::source, config_generic::sourcefile, config_generic::sourceline, config_generic::srole, config_bool::variable, config_int::variable, config_real::variable, config_string::variable, config_enum::variable, and config_generic::vartype.
Referenced by SerializeGUCState().
void SerializeGUCState | ( | Size | maxsize, |
char * | start_address | ||
) |
Definition at line 6101 of file guc.c.
References Assert, dlist_iter::cur, dlist_container, dlist_foreach, guc_nondef_list, config_generic::nondef_link, and serialize_variable().
Referenced by InitializeParallelDSM().
int set_config_option | ( | const char * | name, |
const char * | value, | ||
GucContext | context, | ||
GucSource | source, | ||
GucAction | action, | ||
bool | changeVal, | ||
int | elevel, | ||
bool | is_reload | ||
) |
Definition at line 3342 of file guc.c.
References generate_unaccent_rules::action, context, GetUserId(), name, PGC_S_CLIENT, PGC_S_INTERACTIVE, set_config_with_handle(), source, and value.
Referenced by applyRemoteGucs(), CreateSchemaCommand(), DefineIndex(), ExecSetVariableStmt(), execute_extension_script(), parse_subscription_options(), ProcessConfigFileInternal(), ProcessGUCArray(), RestrictSearchPath(), RI_Initial_Check(), RI_PartitionRemove_Check(), set_config_by_name(), set_transmission_modes(), SetConfigOption(), SetPGVariable(), and validate_option_array_item().
int set_config_option_ext | ( | const char * | name, |
const char * | value, | ||
GucContext | context, | ||
GucSource | source, | ||
Oid | srole, | ||
GucAction | action, | ||
bool | changeVal, | ||
int | elevel, | ||
bool | is_reload | ||
) |
Definition at line 3382 of file guc.c.
References generate_unaccent_rules::action, context, name, set_config_with_handle(), source, and value.
Referenced by define_custom_variable(), execute_extension_script(), InitializeWalConsistencyChecking(), reapply_stacked_values(), and RestoreGUCState().
|
static |
Definition at line 4299 of file guc.c.
References DEBUG3, find_option(), guc_free(), guc_strdup(), IsUnderPostmaster, LOG, name, config_generic::sourcefile, and config_generic::sourceline.
Referenced by define_custom_variable(), ProcessConfigFileInternal(), and RestoreGUCState().
int set_config_with_handle | ( | const char * | name, |
config_handle * | handle, | ||
const char * | value, | ||
GucContext | context, | ||
GucSource | source, | ||
Oid | srole, | ||
GucAction | action, | ||
bool | changeVal, | ||
int | elevel, | ||
bool | is_reload | ||
) |
Definition at line 3405 of file guc.c.
References ACL_SET, ACLCHECK_OK, generate_unaccent_rules::action, config_bool::assign_hook, config_int::assign_hook, config_real::assign_hook, config_string::assign_hook, config_enum::assign_hook, config_var_val::boolval, config_bool::boot_val, config_int::boot_val, config_real::boot_val, config_string::boot_val, config_enum::boot_val, call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), context, config_generic::context, DEBUG3, elog, config_var_val::enumval, ereport, errcode(), errmsg(), ERROR, config_var_value::extra, config_generic::extra, extra_field_used(), find_option(), config_generic::flags, config_bool::gen, config_int::gen, config_real::gen, config_string::gen, config_enum::gen, GUC_ACTION_SAVE, GUC_ALLOW_IN_PARALLEL, guc_free(), GUC_NEEDS_REPORT, GUC_NO_RESET, GUC_NOT_WHILE_SEC_REST, GUC_PENDING_RESTART, GUC_REPORT, guc_report_list, guc_strdup(), InLocalUserIdChange(), InSecurityRestrictedOperation(), config_var_val::intval, IsInParallelMode(), IsUnderPostmaster, LOG, name, config_generic::name, newval, parse_and_validate_value(), pg_parameter_aclcheck(), PGC_BACKEND, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_INTERNAL, PGC_POSTMASTER, PGC_REAL, PGC_S_CLIENT, PGC_S_DATABASE, PGC_S_DATABASE_USER, PGC_S_DEFAULT, PGC_S_DYNAMIC_DEFAULT, PGC_S_FILE, PGC_S_GLOBAL, PGC_S_OVERRIDE, PGC_S_USER, PGC_SIGHUP, PGC_STRING, PGC_SU_BACKEND, PGC_SUSET, PGC_USERSET, guc_stack::prev, guc_stack::prior, push_old_value(), config_var_val::realval, config_generic::report_link, config_bool::reset_extra, config_int::reset_extra, config_real::reset_extra, config_string::reset_extra, config_enum::reset_extra, config_generic::reset_scontext, config_generic::reset_source, config_generic::reset_srole, config_bool::reset_val, config_int::reset_val, config_real::reset_val, config_string::reset_val, config_enum::reset_val, guc_stack::scontext, config_generic::scontext, set_extra_field(), set_guc_source(), set_string_field(), slist_push_head(), source, guc_stack::source, config_generic::source, guc_stack::srole, config_generic::srole, config_generic::stack, config_generic::status, string_field_used(), config_var_val::stringval, config_var_value::val, value, config_bool::variable, config_int::variable, config_real::variable, config_string::variable, config_enum::variable, config_generic::vartype, and WARNING.
Referenced by fmgr_security_definer(), set_config_option(), and set_config_option_ext().
|
static |
Definition at line 792 of file guc.c.
References extra_field_used(), guc_free(), and newval.
Referenced by AtEOXact_GUC(), discard_stack_value(), ResetAllOptions(), set_config_with_handle(), and set_stack_value().
|
static |
Definition at line 2111 of file guc.c.
References dlist_delete(), dlist_push_tail(), guc_nondef_list, config_generic::nondef_link, PGC_S_DEFAULT, and config_generic::source.
Referenced by AtEOXact_GUC(), ProcessConfigFileInternal(), ResetAllOptions(), and set_config_with_handle().
|
static |
Definition at line 812 of file guc.c.
References config_generic::extra, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, set_extra_field(), set_string_field(), val, and config_generic::vartype.
Referenced by push_old_value().
|
static |
Definition at line 731 of file guc.c.
References guc_free(), newval, and string_field_used().
Referenced by AtEOXact_GUC(), define_custom_variable(), discard_stack_value(), ResetAllOptions(), set_config_with_handle(), and set_stack_value().
void SetConfigOption | ( | const char * | name, |
const char * | value, | ||
GucContext | context, | ||
GucSource | source | ||
) |
Definition at line 4332 of file guc.c.
References context, GUC_ACTION_SET, name, set_config_option(), source, and value.
Referenced by AutoVacWorkerMain(), BeginReportingGUCOptions(), BootstrapModeMain(), CheckMyDatabase(), CLOGShmemInit(), CommitTsShmemInit(), CreateAnonymousSegment(), InitializeGUCOptions(), InitializeGUCOptionsFromEnvironment(), InitializeLogRepWorker(), InitializeSessionUserId(), InitializeShmemGUCs(), maybe_reread_subscription(), pg_timezone_abbrev_initialize(), PGSharedMemoryCreate(), PostmasterMain(), process_postgres_switches(), process_startup_options(), ProcessConfigFileInternal(), ReadControlFile(), ReplSlotSyncWorkerMain(), ReportChangedGUCOptions(), SelectConfigFiles(), set_debug_options(), set_limit(), set_plan_disabling_options(), SetOuterUserId(), SUBTRANSShmemInit(), worker_spi_main(), and XLOGShmemSize().
char* ShowGUCOption | ( | struct config_generic * | record, |
bool | use_units | ||
) |
Definition at line 5465 of file guc.c.
References config_enum_lookup_by_value(), convert_int_from_base_unit(), convert_real_from_base_unit(), config_generic::flags, GUC_UNIT, INT64_FORMAT, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_STRING, pstrdup(), config_bool::show_hook, config_int::show_hook, config_real::show_hook, config_string::show_hook, config_enum::show_hook, snprintf, val, config_bool::variable, config_int::variable, config_real::variable, config_string::variable, config_enum::variable, and config_generic::vartype.
Referenced by GetConfigOptionByName(), GetConfigOptionValues(), ReportGUCOption(), and ShowAllGUCConfig().
|
static |
Definition at line 708 of file guc.c.
References config_string::boot_val, config_string::gen, guc_stack::masked, guc_stack::prev, guc_stack::prior, config_string::reset_val, config_generic::stack, config_var_val::stringval, config_var_value::val, and config_string::variable.
Referenced by set_config_with_handle(), and set_string_field().
Definition at line 6399 of file guc.c.
References ARR_DIMS, ARR_ELEMTYPE, ARR_LBOUND, ARR_NDIM, array_ref(), Assert, ereport, errcode(), errmsg(), i, lappend(), name, NIL, ParseLongOption(), pfree(), TextDatumGetCString, value, values, and WARNING.
Referenced by fmgr_security_definer(), and ProcessGUCArray().
|
static |
Definition at line 1076 of file guc.c.
References GUC_QUALIFIER_SEPARATOR, IS_HIGHBIT_SET, and name.
Referenced by assignable_custom_variable_name(), and ProcessConfigFileInternal().
|
static |
Definition at line 6708 of file guc.c.
References ACL_SET, ACLCHECK_OK, config_generic::context, ereport, errcode(), errmsg(), ERROR, find_option(), config_generic::flags, GetUserId(), GUC_ACTION_SET, GUC_CUSTOM_PLACEHOLDER, name, pg_parameter_aclcheck(), PGC_S_TEST, PGC_SUSET, PGC_USERSET, set_config_option(), superuser(), and value.
Referenced by GUCArrayAdd(), GUCArrayDelete(), and GUCArrayReset().
|
static |
Definition at line 4469 of file guc.c.
References appendStringInfoString(), buf, ereport, errcode(), errcode_for_file_access(), errmsg(), ERROR, escape_single_quotes_ascii(), fd(), filename, free, initStringInfo(), ConfigVariable::name, ConfigVariable::next, pfree(), pg_fsync(), resetStringInfo(), ConfigVariable::value, and write.
Referenced by AlterSystemSetConfigFile().
|
static |
Definition at line 76 of file guc.c.
Referenced by call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), and GUC_check_errcode().
char* GUC_check_errdetail_string |
Definition at line 82 of file guc.c.
Referenced by call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), and call_string_check_hook().
char* GUC_check_errhint_string |
Definition at line 83 of file guc.c.
Referenced by call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), and call_string_check_hook().
char* GUC_check_errmsg_string |
Definition at line 81 of file guc.c.
Referenced by call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), and call_string_check_hook().
|
static |
Definition at line 212 of file guc.c.
Referenced by add_guc_variable(), BeginReportingGUCOptions(), build_guc_variables(), define_custom_variable(), find_option(), get_explain_guc_options(), get_guc_variables(), InitializeGUCOptions(), MarkGUCPrefixReserved(), and ProcessConfigFileInternal().
|
static |
Definition at line 222 of file guc.c.
Referenced by EstimateGUCStateSpace(), get_explain_guc_options(), ResetAllOptions(), RestoreGUCState(), SerializeGUCState(), and set_guc_source().
|
static |
Definition at line 226 of file guc.c.
Referenced by AtEOXact_GUC(), RemoveGUCFromLists(), ReportChangedGUCOptions(), ResetAllOptions(), and set_config_with_handle().
|
static |
Definition at line 224 of file guc.c.
Referenced by AtEOXact_GUC(), push_old_value(), reapply_stacked_values(), and RemoveGUCFromLists().
|
static |
Definition at line 199 of file guc.c.
Referenced by build_guc_variables(), guc_free(), guc_malloc(), guc_realloc(), and MarkGUCPrefixReserved().
|
static |
Definition at line 231 of file guc.c.
Referenced by AtEOXact_GUC(), AtStart_GUC(), NewGUCNestLevel(), and push_old_value().
|
static |
Definition at line 190 of file guc.c.
Referenced by convert_GUC_name_for_parameter_acl(), and find_option().
|
static |
Definition at line 121 of file guc.c.
Referenced by convert_int_from_base_unit(), convert_real_from_base_unit(), and convert_to_base_unit().
|
static |
Definition at line 119 of file guc.c.
Referenced by parse_int(), and parse_real().
|
static |
Definition at line 229 of file guc.c.
Referenced by BeginReportingGUCOptions(), InitializeGUCOptions(), and ReportChangedGUCOptions().
Definition at line 78 of file guc.c.
Referenced by assignable_custom_variable_name(), and MarkGUCPrefixReserved().
|
static |
Definition at line 158 of file guc.c.
Referenced by convert_int_from_base_unit(), convert_real_from_base_unit(), and convert_to_base_unit().
|
static |
Definition at line 156 of file guc.c.
Referenced by parse_int(), and parse_real().