56#define CONFIG_FILENAME "postgresql.conf"
57#define HBA_FILENAME "pg_hba.conf"
58#define IDENT_FILENAME "pg_ident.conf"
59#define HOSTS_FILENAME "pg_hosts.conf"
62#define CONFIG_EXEC_PARAMS "global/config_exec_params"
63#define CONFIG_EXEC_PARAMS_NEW "global/config_exec_params.new"
70#define REALTYPE_PRECISION 17
76#define GUC_SAFE_SEARCH_PATH "pg_catalog, pg_temp"
103#define MAX_UNIT_LEN 3
114#if BLCKSZ < 1024 || BLCKSZ > (1024*1024)
115#error BLCKSZ must be between 1KB and 1MB
117#if XLOG_BLCKSZ < 1024 || XLOG_BLCKSZ > (1024*1024)
118#error XLOG_BLCKSZ must be between 1KB and 1MB
193 "sort_mem",
"work_mem",
194 "vacuum_mem",
"maintenance_work_mem",
195 "ssl_ecdh_curve",
"ssl_groups",
344 strcmp(item->name,
"data_directory") == 0)
401 record =
find_option(item->name,
false,
true, elevel);
415 if (!
pitem->ignore &&
417 pitem->ignore =
true;
428 errmsg(
"unrecognized configuration parameter \"%s\" in file \"%s\" line %d",
430 item->filename, item->sourceline)));
431 item->errmsg =
pstrdup(
"unrecognized configuration parameter");
467 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
503 (
errmsg(
"parameter \"%s\" removed from configuration file, reset to default",
568 (
errmsg(
"parameter \"%s\" changed to \"%s\"",
569 item->name, item->value)));
571 item->applied =
true;
576 item->errmsg =
pstrdup(
"setting could not be applied");
582 item->applied =
true;
610 errmsg(
"configuration file \"%s\" contains errors",
615 errmsg(
"configuration file \"%s\" contains errors; unaffected changes were applied",
620 errmsg(
"configuration file \"%s\" contains errors; no changes were applied",
646 errmsg(
"out of memory")));
671 errmsg(
"out of memory")));
709 if (strval == *(
conf->_string.variable) ||
710 strval ==
conf->_string.reset_val ||
711 strval ==
conf->_string.boot_val)
788 switch (
gconf->vartype)
791 val->val.boolval = *
gconf->_bool.variable;
794 val->val.intval = *
gconf->_int.variable;
797 val->val.realval = *
gconf->_real.variable;
803 val->val.enumval = *
gconf->_enum.variable;
816 switch (
gconf->vartype)
826 &(
val->val.stringval),
858 qsort(result, *num_vars,
941 errmsg(
"out of memory")));
962 for (
const char *p =
name; *p; p++)
971 else if (
strchr(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
972 "abcdefghijklmnopqrstuvwxyz_", *p) !=
NULL ||
1018 errmsg(
"invalid configuration parameter name \"%s\"",
1020 errdetail(
"Custom parameter names must be two or more simple identifiers separated by dots.")));
1034 errmsg(
"invalid configuration parameter name \"%s\"",
1036 errdetail(
"\"%s\" is a reserved prefix.",
1049 errmsg(
"unrecognized configuration parameter \"%s\"",
1077 var->
short_desc =
"GUC placeholder variable";
1156 errmsg(
"unrecognized configuration parameter \"%s\"",
1190 if (
cha >=
'A' &&
cha <=
'Z')
1192 if (
chb >=
'A' &&
chb <=
'Z')
1211 const char *
name = *(
const char *
const *) key;
1218 if (
ch >=
'A' &&
ch <=
'Z')
1234 const char *
name1 = *(
const char *
const *)
key1;
1235 const char *
name2 = *(
const char *
const *)
key2;
1268 for (
char *ptr = result; *ptr !=
'\0'; ptr++)
1272 if (
ch >=
'A' &&
ch <=
'Z')
1312#ifdef USE_ASSERT_CHECKING
1317 switch (
gconf->vartype)
1323 if (*
conf->variable && !
conf->boot_val)
1325 elog(
LOG,
"GUC (PGC_BOOL) %s, boot_val=%d, C-var=%d",
1335 if (*
conf->variable != 0 && *
conf->variable !=
conf->boot_val)
1337 elog(
LOG,
"GUC (PGC_INT) %s, boot_val=%d, C-var=%d",
1347 if (*
conf->variable != 0.0 && *
conf->variable !=
conf->boot_val)
1349 elog(
LOG,
"GUC (PGC_REAL) %s, boot_val=%g, C-var=%g",
1363 elog(
LOG,
"GUC (PGC_STRING) %s, boot_val=%s, C-var=%s",
1373 if (*
conf->variable !=
conf->boot_val)
1375 elog(
LOG,
"GUC (PGC_ENUM) %s, boot_val=%d, C-var=%d",
1392 elog(
LOG,
"GUC %s flags: NO_SHOW_ALL and !NOT_IN_SAMPLE",
1537 gconf->sourceline = 0;
1539 switch (
gconf->vartype)
1548 elog(
FATAL,
"failed to initialize %s to %d",
1550 if (
conf->assign_hook)
1564 elog(
FATAL,
"failed to initialize %s to %d",
1566 if (
conf->assign_hook)
1580 elog(
FATAL,
"failed to initialize %s to %g",
1582 if (
conf->assign_hook)
1600 elog(
FATAL,
"failed to initialize %s to \"%s\"",
1602 if (
conf->assign_hook)
1614 elog(
FATAL,
"failed to initialize %s to %d",
1616 if (
conf->assign_hook)
1672 write_stderr(
"%s: could not access directory \"%s\": %m\n",
1676 write_stderr(
"Run initdb or pg_basebackup to initialize a PostgreSQL data directory.\n");
1700 write_stderr(
"%s does not know where to find the server configuration file.\n"
1701 "You must specify the --config-file or -D invocation "
1702 "option or set the PGDATA environment variable.\n",
1723 write_stderr(
"%s: could not access the server configuration file \"%s\": %m\n",
1750 write_stderr(
"%s does not know where to find the database system data.\n"
1751 "This can be specified as \"data_directory\" in \"%s\", "
1752 "or by the -D invocation option, or by the "
1753 "PGDATA environment variable.\n",
1802 write_stderr(
"%s does not know where to find the \"hba\" configuration file.\n"
1803 "This can be specified as \"hba_file\" in \"%s\", "
1804 "or by the -D invocation option, or by the "
1805 "PGDATA environment variable.\n",
1833 write_stderr(
"%s does not know where to find the \"ident\" configuration file.\n"
1834 "This can be specified as \"ident_file\" in \"%s\", "
1835 "or by the -D invocation option, or by the "
1836 "PGDATA environment variable.\n",
1864 write_stderr(
"%s does not know where to find the \"hosts\" configuration file.\n"
1865 "This can be specified as \"hosts_file\" in \"%s\", "
1866 "or by the -D invocation option, or by the "
1867 "PGDATA environment variable.\n",
1934 switch (
gconf->vartype)
1940 if (
conf->assign_hook)
1942 gconf->reset_extra);
1945 gconf->reset_extra);
1952 if (
conf->assign_hook)
1954 gconf->reset_extra);
1957 gconf->reset_extra);
1964 if (
conf->assign_hook)
1966 gconf->reset_extra);
1969 gconf->reset_extra);
1976 if (
conf->assign_hook)
1978 gconf->reset_extra);
1981 gconf->reset_extra);
1988 if (
conf->assign_hook)
1990 gconf->reset_extra);
1993 gconf->reset_extra);
2050 stack =
gconf->stack;
2114 gconf->stack = stack;
2130 elog(
WARNING,
"GUC nest level = %d at transaction start",
2227 else if (prev ==
NULL ||
2309 switch (
gconf->vartype)
2320 if (
conf->assign_hook)
2338 if (
conf->assign_hook)
2356 if (
conf->assign_hook)
2374 if (
conf->assign_hook)
2401 if (
conf->assign_hook)
2428 gconf->stack = prev;
2587 while (*unit !=
'\0' && !
isspace((
unsigned char) *unit) &&
2592 while (
isspace((
unsigned char) *unit))
2603 for (
int i = 0; *
table[
i].unit;
i++)
2605 if (base_unit ==
table[
i].base_unit &&
2615 if (*
table[
i + 1].unit &&
2616 base_unit ==
table[
i + 1].base_unit)
2647 for (
int i = 0; *
table[
i].unit;
i++)
2649 if (base_unit ==
table[
i].base_unit)
2656 if (
table[
i].multiplier <= 1.0 ||
2677 double *
value,
const char **unit)
2688 for (
int i = 0; *
table[
i].unit;
i++)
2690 if (base_unit ==
table[
i].base_unit)
2732 static char bbuf[8];
2735 if (
bbuf[0] ==
'\0')
2741 static char xbuf[8];
2744 if (
xbuf[0] ==
'\0')
2755 elog(
ERROR,
"unrecognized GUC units value: %d",
2799 if (*endptr ==
'.' || *endptr ==
'e' || *endptr ==
'E' ||
2814 while (
isspace((
unsigned char) *endptr))
2818 if (*endptr !=
'\0')
2887 while (
isspace((
unsigned char) *endptr))
2891 if (*endptr !=
'\0')
2931 if (entry->val ==
val)
2935 elog(
ERROR,
"could not find enum option %d for %s",
2955 *retval = entry->val;
2973 const char *suffix,
const char *
separator)
3041 errmsg(
"parameter \"%s\" requires a Boolean value",
3061 errmsg(
"invalid value for parameter \"%s\": \"%s\"",
3079 errmsg(
"%d%s%s is outside the valid range for parameter \"%s\" (%d%s%s .. %d%s%s)",
3102 errmsg(
"invalid value for parameter \"%s\": \"%s\"",
3120 errmsg(
"%g%s%s is outside the valid range for parameter \"%s\" (%g%s%s .. %g%s%s)",
3170 _(
"Available values: "),
3186 errmsg(
"invalid value for parameter \"%s\": \"%s\"",
3368 errmsg(
"parameter \"%s\" cannot be set during a parallel operation",
3384 errmsg(
"parameter \"%s\" cannot be changed",
3407 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
3417 errmsg(
"parameter \"%s\" cannot be changed now",
3444 errmsg(
"permission denied to set parameter \"%s\"",
3486 errmsg(
"parameter \"%s\" cannot be set after connection start",
3506 errmsg(
"permission denied to set parameter \"%s\"",
3545 errmsg(
"cannot set parameter \"%s\" within security-definer function",
3553 errmsg(
"cannot set parameter \"%s\" within security-restricted operation",
3566 errmsg(
"parameter \"%s\" cannot be reset", record->
name)));
3573 errmsg(
"parameter \"%s\" cannot be set locally in functions",
3599 elog(
DEBUG3,
"\"%s\": setting ignored because previous source is higher priority",
3615#define newval (newval_union.boolval)
3651 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
3665 if (
conf->assign_hook)
3672 record->
srole = srole;
3685 for (
GucStack *stack = record->
stack; stack; stack = stack->prev)
3687 if (stack->source <=
source)
3689 stack->prior.val.boolval =
newval;
3693 stack->scontext = context;
3694 stack->srole = srole;
3711#define newval (newval_union.intval)
3747 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
3761 if (
conf->assign_hook)
3768 record->
srole = srole;
3781 for (
GucStack *stack = record->
stack; stack; stack = stack->prev)
3783 if (stack->source <=
source)
3785 stack->prior.val.intval =
newval;
3789 stack->scontext = context;
3790 stack->srole = srole;
3807#define newval (newval_union.realval)
3843 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
3857 if (
conf->assign_hook)
3864 record->
srole = srole;
3877 for (
GucStack *stack = record->
stack; stack; stack = stack->prev)
3879 if (stack->source <=
source)
3881 stack->prior.val.realval =
newval;
3885 stack->scontext = context;
3886 stack->srole = srole;
3906#define newval (newval_union.stringval)
3968 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
3982 if (
conf->assign_hook)
3989 record->
srole = srole;
4016 strcmp(record->
name,
"session_authorization") == 0)
4041 for (
GucStack *stack = record->
stack; stack; stack = stack->prev)
4043 if (stack->source <=
source)
4050 stack->scontext = context;
4051 stack->srole = srole;
4071#define newval (newval_union.enumval)
4107 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
4121 if (
conf->assign_hook)
4128 record->
srole = srole;
4141 for (
GucStack *stack = record->
stack; stack; stack = stack->prev)
4143 if (stack->source <=
source)
4145 stack->prior.val.enumval =
newval;
4149 stack->scontext = context;
4150 stack->srole = srole;
4254 static char buffer[256];
4263 errmsg(
"permission denied to examine \"%s\"",
name),
4264 errdetail(
"Only roles with privileges of the \"%s\" role may examine this parameter.",
4265 "pg_read_all_settings")));
4273 snprintf(buffer,
sizeof(buffer),
"%d",
4278 snprintf(buffer,
sizeof(buffer),
"%g",
4304 static char buffer[256];
4311 errmsg(
"permission denied to examine \"%s\"",
name),
4312 errdetail(
"Only roles with privileges of the \"%s\" role may examine this parameter.",
4313 "pg_read_all_settings")));
4321 snprintf(buffer,
sizeof(buffer),
"%d",
4326 snprintf(buffer,
sizeof(buffer),
"%g",
4355 return record->
flags;
4400 errmsg(
"out of memory")));
4459 pfree(item->filename);
4484 (*tail_p)->
next = newitem;
4521 errmsg(
"ALTER SYSTEM is not allowed in this environment")));
4540 elog(
ERROR,
"unrecognized alter system stmt type: %d",
4553 errmsg(
"permission denied to perform ALTER SYSTEM RESET ALL")));
4563 errmsg(
"permission denied to set parameter \"%s\"",
4588 errmsg(
"parameter \"%s\" cannot be changed",
4604 errmsg(
"invalid value for parameter \"%s\": \"%s\"",
4637 errmsg(
"parameter value for ALTER SYSTEM must not contain a newline")));
4674 errmsg(
"could not open file \"%s\": %m",
4682 errmsg(
"could not parse contents of file \"%s\"",
4724 errmsg(
"could not open file \"%s\": %m",
4789 elog(
FATAL,
"cannot create PGC_POSTMASTER variables after startup");
4798 elog(
FATAL,
"extensions cannot define GUC_LIST_QUOTE variables");
4864 errmsg(
"attempt to redefine parameter \"%s\"",
name)));
4900 if (
pHolder->_string.reset_val)
5202 errmsg(
"invalid configuration parameter name \"%s\", removing it",
5204 errdetail(
"\"%s\" is now a reserved prefix.",
5263 switch (
conf->vartype)
5320 result[*num] =
conf;
5348 errmsg(
"permission denied to examine \"%s\"",
name),
5349 errdetail(
"Only roles with privileges of the \"%s\" role may examine this parameter.",
5350 "pg_read_all_settings")));
5353 *varname = record->
name;
5377 if (
conf->show_hook)
5380 val = *
conf->variable ?
"on" :
"off";
5388 if (
conf->show_hook)
5417 if (
conf->show_hook)
5421 double result = *
conf->variable;
5431 snprintf(buffer,
sizeof(buffer),
"%g%s",
5442 if (
conf->show_hook)
5444 else if (*
conf->variable && **
conf->variable)
5455 if (
conf->show_hook)
5494 switch (
gconf->vartype)
5500 if (*
conf->variable)
5527 if (*
conf->variable)
5544 if (
gconf->sourcefile)
5573 errmsg(
"could not write to file \"%s\": %m",
5591 errmsg(
"could not write to file \"%s\": %m",
5624 elog(
FATAL,
"invalid format of exec config params file");
5628 else if (
i == maxlen)
5663 errmsg(
"could not read from file \"%s\": %m",
5674 elog(
FATAL,
"failed to locate variable \"%s\" in exec config params file", varname);
5677 elog(
FATAL,
"invalid format of exec config params file");
5679 elog(
FATAL,
"invalid format of exec config params file");
5681 elog(
FATAL,
"invalid format of exec config params file");
5683 elog(
FATAL,
"invalid format of exec config params file");
5685 elog(
FATAL,
"invalid format of exec config params file");
5687 elog(
FATAL,
"invalid format of exec config params file");
5762 switch (
gconf->vartype)
5780 if (
abs(*
conf->variable) < 1000)
5808 if (*
conf->variable)
5827 if (
gconf->sourcefile)
5834 if (
gconf->sourcefile &&
gconf->sourcefile[0])
5855 size =
sizeof(
Size);
5886 elog(
ERROR,
"not enough space to serialize GUC state");
5895 elog(
ERROR,
"vsnprintf failed: %m with format string \"%s\"",
fmt);
5900 elog(
ERROR,
"not enough space to serialize GUC state");
5913 elog(
ERROR,
"not enough space to serialize GUC state");
5934 switch (
gconf->vartype)
5941 (*
conf->variable ?
"true" :
"false"));
5968 *
conf->variable ? *
conf->variable :
"");
5983 (
gconf->sourcefile ?
gconf->sourcefile :
""));
5985 if (
gconf->sourcefile &&
gconf->sourcefile[0])
5987 sizeof(
gconf->sourceline));
5990 sizeof(
gconf->source));
5992 sizeof(
gconf->scontext));
5994 sizeof(
gconf->srole));
6044 for (ptr = *
srcptr; ptr <
srcend && *ptr !=
'\0'; ptr++)
6048 elog(
ERROR,
"could not find null terminator in GUC state");
6077 errcontext(
"while setting parameter \"%s\" to \"%s\"",
6152 switch (
gconf->vartype)
6165 if (
conf->reset_val &&
conf->reset_val != *
conf->variable)
6220 errmsg(
"parameter \"%s\" could not be set", varname)));
6307 errmsg(
"could not parse setting for parameter \"%s\"",
6344 action,
true, 0,
false);
6628 errmsg(
"permission denied to set parameter \"%s\"",
name)));
6677 if (!
conf->_bool.check_hook)
6692 errmsg(
"invalid value for parameter \"%s\": %d",
6711 if (!
conf->_int.check_hook)
6726 errmsg(
"invalid value for parameter \"%s\": %d",
6745 if (!
conf->_real.check_hook)
6760 errmsg(
"invalid value for parameter \"%s\": %g",
6778 volatile bool result =
true;
6781 if (!
conf->_string.check_hook)
6803 errmsg(
"invalid value for parameter \"%s\": \"%s\"",
6829 if (!
conf->_enum.check_hook)
6844 errmsg(
"invalid value for parameter \"%s\": \"%s\"",
AclResult pg_parameter_aclcheck(const char *name, Oid roleid, AclMode mode)
ArrayType * array_set(ArrayType *array, int nSubscripts, int *indx, Datum dataValue, bool isNull, int arraytyplen, int elmlen, bool elmbyval, char elmalign)
Datum array_ref(ArrayType *array, int nSubscripts, int *indx, int arraytyplen, int elmlen, bool elmbyval, char elmalign, bool *isNull)
ArrayType * construct_array_builtin(Datum *elems, int nelems, Oid elmtype)
TimestampTz GetCurrentTimestamp(void)
#define write_stderr(str)
bool parse_bool(const char *value, bool *result)
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
#define TextDatumGetCString(d)
#define unconstify(underlying_type, expr)
#define IS_HIGHBIT_SET(ch)
#define Assert(condition)
#define pg_attribute_printf(f, a)
#define CONF_FILE_START_DEPTH
#define fprintf(file, fmt, msg)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, int64 nelem, const HASHCTL *info, int flags)
void * hash_seq_search(HASH_SEQ_STATUS *status)
int64 hash_get_num_entries(HTAB *hashp)
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
int errcode_for_file_access(void)
ErrorContextCallback * error_context_stack
void FlushErrorState(void)
int errcode(int sqlerrcode)
int int errdetail_internal(const char *fmt,...) pg_attribute_printf(1
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
int int errmsg_internal(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
int durable_rename(const char *oldfile, const char *newfile, int elevel)
int BasicOpenFile(const char *fileName, int fileFlags)
FILE * AllocateFile(const char *name, const char *mode)
#define palloc_object(type)
#define palloc_array(type, count)
#define MCXT_ALLOC_NO_OOM
void FreeConfigVariables(ConfigVariable *list)
void record_config_file_error(const char *errmsg, const char *config_file, int lineno, ConfigVariable **head_p, ConfigVariable **tail_p)
bool ParseConfigFp(FILE *fp, const char *config_file, int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p)
bool ParseConfigFile(const char *config_file, bool strict, const char *calling_file, int calling_lineno, int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p)
void ProcessConfigFile(GucContext context)
void BeginReportingGUCOptions(void)
static bool validate_option_array_item(const char *name, const char *value, bool skipIfNoPermissions)
void GUC_check_errcode(int sqlerrcode)
static const char *const map_old_guc_names[]
static void guc_restore_error_context_callback(void *arg)
static void ReportGUCOption(struct config_generic *record)
void RestoreGUCState(void *gucstate)
static bool assignable_custom_variable_name(const char *name, bool skip_errors, int elevel)
static dlist_head guc_nondef_list
const char * config_enum_lookup_by_value(const struct config_generic *record, int val)
static int guc_name_match(const void *key1, const void *key2, Size keysize)
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)
static bool call_real_check_hook(const struct config_generic *conf, double *newval, void **extra, GucSource source, int elevel)
static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3
bool parse_int(const char *value, int *result, int flags, const char **hintmsg)
char * config_enum_get_options(const struct config_enum *record, const char *prefix, const char *suffix, const char *separator)
#define GUC_SAFE_SEARCH_PATH
static slist_head guc_report_list
static void set_config_sourcefile(const char *name, char *sourcefile, int sourceline)
const char * get_config_unit_name(int flags)
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 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)
char * GetConfigOptionByName(const char *name, const char **varname, bool missing_ok)
static bool convert_to_base_unit(double value, const char *unit, int base_unit, double *base_value)
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)
static void define_custom_variable(struct config_generic *variable)
static void free_placeholder(struct config_generic *pHolder)
int NewGUCNestLevel(void)
ArrayType * GUCArrayAdd(ArrayType *array, const char *name, const char *value)
void ProcessGUCArray(ArrayType *array, GucContext context, GucSource source, GucAction action)
static bool valid_custom_variable_name(const char *name)
struct config_generic ** get_guc_variables(int *num_vars)
char * GUC_check_errhint_string
void SetConfigOption(const char *name, const char *value, GucContext context, GucSource source)
static bool call_enum_check_hook(const struct config_generic *conf, int *newval, void **extra, GucSource source, int elevel)
static int guc_var_compare(const void *a, const void *b)
static void set_string_field(struct config_generic *conf, char **field, char *newval)
void * guc_realloc(int elevel, void *old, size_t size)
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 * guc_malloc(int elevel, size_t size)
bool parse_real(const char *value, double *result, int flags, const char **hintmsg)
static void push_old_value(struct config_generic *gconf, GucAction action)
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)
static void write_auto_conf_file(int fd, const char *filename, ConfigVariable *head)
static void InitializeOneGUCOption(struct config_generic *gconf)
const char * GetConfigOption(const char *name, bool missing_ok, bool restrict_privileged)
static bool can_skip_gucvar(struct config_generic *gconf)
void SerializeGUCState(Size maxsize, char *start_address)
static void pg_timezone_abbrev_initialize(void)
struct config_generic * find_option(const char *name, bool create_placeholders, bool skip_errors, int elevel)
static const unit_conversion memory_unit_conversion_table[]
static bool call_int_check_hook(const struct config_generic *conf, int *newval, void **extra, GucSource source, int elevel)
bool SelectConfigFiles(const char *userDoption, const char *progname)
static void reapply_stacked_values(struct config_generic *variable, struct config_generic *pHolder, GucStack *stack, const char *curvalue, GucContext curscontext, GucSource cursource, Oid cursrole)
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)
static bool parse_and_validate_value(const struct config_generic *record, const char *value, GucSource source, int elevel, union config_var_val *newval, void **newextra)
#define REALTYPE_PRECISION
config_handle * get_config_handle(const char *name)
char * GUC_check_errmsg_string
void AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt)
Size EstimateGUCStateSpace(void)
static const char *const memory_units_hint
static void discard_stack_value(struct config_generic *gconf, config_var_value *val)
static int GUC_check_errcode_value
void ParseLongOption(const char *string, char **name, char **value)
void ResetAllOptions(void)
static void convert_int_from_base_unit(int64 base_value, int base_unit, int64 *value, const char **unit)
static void RemoveGUCFromLists(struct config_generic *gconf)
const char * GetConfigOptionResetString(const char *name)
bool config_enum_lookup_by_name(const struct config_enum *record, const char *value, int *retval)
void build_guc_variables(void)
static struct config_generic * add_placeholder_variable(const char *name, int elevel)
static void set_stack_value(struct config_generic *gconf, config_var_value *val)
void InitializeGUCOptions(void)
static void read_gucstate_binary(char **srcptr, char *srcend, void *dest, Size size)
void MarkGUCPrefixReserved(const char *className)
ArrayType * GUCArrayReset(ArrayType *array)
struct config_generic ** get_explain_guc_options(int *num)
ArrayType * GUCArrayDelete(ArrayType *array, const char *name)
static bool add_guc_variable(struct config_generic *var, int elevel)
static bool extra_field_used(struct config_generic *gconf, void *extra)
static char * read_gucstate(char **srcptr, char *srcend)
static List * reserved_class_prefix
void RestrictSearchPath(void)
int GetConfigOptionFlags(const char *name, bool missing_ok)
char * GUC_check_errdetail_string
static uint32 guc_name_hash(const void *key, Size keysize)
void check_GUC_name_for_parameter_acl(const char *name)
static void InitializeGUCOptionsFromEnvironment(void)
char * convert_GUC_name_for_parameter_acl(const char *name)
static slist_head guc_stack_list
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)
static const char *const time_units_hint
ConfigVariable * ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel)
static void replace_auto_config_value(ConfigVariable **head_p, ConfigVariable **tail_p, const char *name, const char *value)
static Size estimate_variable_size(struct config_generic *gconf)
static void convert_real_from_base_unit(double base_value, int base_unit, double *value, const char **unit)
int guc_name_compare(const char *namea, const char *nameb)
static void set_guc_source(struct config_generic *gconf, GucSource newsource)
static void static bool call_bool_check_hook(const struct config_generic *conf, bool *newval, void **extra, GucSource source, int elevel)
void TransformGUCArray(ArrayType *array, List **names, List **values)
char * guc_strdup(int elevel, const char *src)
static void set_extra_field(struct config_generic *gconf, void **field, void *newval)
static const unit_conversion time_unit_conversion_table[]
static HTAB * guc_hashtab
static MemoryContext GUCMemoryContext
void ReportChangedGUCOptions(void)
static bool string_field_used(struct config_generic *conf, char *strval)
void AtEOXact_GUC(bool isCommit, int nestLevel)
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)
char * ShowGUCOption(const struct config_generic *record, bool use_units)
static bool reporting_enabled
static bool call_string_check_hook(const struct config_generic *conf, char **newval, void **extra, GucSource source, int elevel)
int set_config_option(const char *name, const char *value, GucContext context, GucSource source, GucAction action, bool changeVal, int elevel, bool is_reload)
bool(* GucBoolCheckHook)(bool *newval, void **extra, GucSource source)
bool(* GucRealCheckHook)(double *newval, void **extra, GucSource source)
void(* GucStringAssignHook)(const char *newval, void *extra)
bool(* GucEnumCheckHook)(int *newval, void **extra, GucSource source)
void(* GucBoolAssignHook)(bool newval, void *extra)
#define GUC_CUSTOM_PLACEHOLDER
void(* GucEnumAssignHook)(int newval, void *extra)
#define GUC_NOT_WHILE_SEC_REST
#define GUC_DISALLOW_IN_FILE
bool(* GucStringCheckHook)(char **newval, void **extra, GucSource source)
#define GUC_DISALLOW_IN_AUTO_FILE
void(* GucIntAssignHook)(int newval, void *extra)
void(* GucRealAssignHook)(double newval, void *extra)
#define GUC_ALLOW_IN_PARALLEL
bool(* GucIntCheckHook)(int *newval, void **extra, GucSource source)
#define GUC_NOT_IN_SAMPLE
#define GUC_QUALIFIER_SEPARATOR
const char *(* GucShowHook)(void)
bool ConfigOptionIsVisible(const struct config_generic *conf)
char * ExtractSetVariableArgs(VariableSetStmt *stmt)
PGDLLIMPORT struct config_generic ConfigureNames[]
#define GUC_PENDING_RESTART
void slist_delete(slist_head *head, const slist_node *node)
static void slist_delete_current(slist_mutable_iter *iter)
#define dlist_foreach(iter, lhead)
static void dlist_delete(dlist_node *node)
#define slist_foreach_modify(iter, lhead)
#define dlist_foreach_modify(iter, lhead)
static void slist_push_head(slist_head *head, slist_node *node)
static void dlist_push_tail(dlist_head *head, dlist_node *node)
#define slist_container(type, membername, ptr)
#define dlist_container(type, membername, ptr)
List * lappend(List *list, void *datum)
void list_free(List *list)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
const char * GetDatabaseEncodingName(void)
void * MemoryContextAllocZero(MemoryContext context, Size size)
MemoryContext TopTransactionContext
char * pstrdup(const char *in)
void pfree(void *pointer)
MemoryContext TopMemoryContext
MemoryContext GetMemoryChunkContext(void *pointer)
void * MemoryContextAllocExtended(MemoryContext context, Size size, int flags)
void * repalloc_extended(void *pointer, Size size, int flags)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define IsBootstrapProcessingMode()
bool InSecurityRestrictedOperation(void)
bool InLocalUserIdChange(void)
void SetDataDir(const char *dir)
bool process_shared_preload_libraries_in_progress
#define InvokeObjectPostAlterHookArgStr(classId, objectName, subId, auxiliaryId, is_internal)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static uint32 pg_rotate_left32(uint32 word, int n)
#define PG_AUTOCONF_FILENAME
#define forboth(cell1, list1, cell2, list2)
static const struct lconv_member_info table[]
static void bail_out(bool noatexit, const char *fmt,...) pg_attribute_printf(2
static rewind_source * source
static char buf[DEFAULT_XLOG_SEG_SIZE]
void pg_timezone_initialize(void)
int pg_strcasecmp(const char *s1, const char *s2)
char * escape_single_quotes_ascii(const char *src)
char * make_absolute_path(const char *path)
#define qsort(a, b, c, d)
size_t strlcpy(char *dst, const char *src, size_t siz)
CommandDest whereToSendOutput
static const char * userDoption
static int fd(const char *x, int i)
#define PqMsg_ParameterStatus
char * psprintf(const char *fmt,...)
void truncate_identifier(char *ident, int len, bool warn)
Size add_size(Size s1, Size s2)
ssize_t get_stack_depth_rlimit(void)
void resetStringInfo(StringInfo str)
void appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
void appendStringInfoString(StringInfo str, const char *s)
void initStringInfo(StringInfo str)
struct ConfigVariable * next
struct ErrorContextCallback * previous
struct config_generic * gucvar
GucBoolCheckHook check_hook
GucBoolAssignHook assign_hook
const struct config_enum_entry * options
GucEnumAssignHook assign_hook
GucEnumCheckHook check_hook
struct config_string _string
GucContext reset_scontext
GucIntAssignHook assign_hook
GucIntCheckHook check_hook
GucRealAssignHook assign_hook
GucRealCheckHook check_hook
GucStringCheckHook check_hook
GucStringAssignHook assign_hook
GucContext masked_scontext
bool IsInParallelMode(void)
bool RecoveryInProgress(void)
static void infile(const char *name)