56#define CONFIG_FILENAME "postgresql.conf"
57#define HBA_FILENAME "pg_hba.conf"
58#define IDENT_FILENAME "pg_ident.conf"
61#define CONFIG_EXEC_PARAMS "global/config_exec_params"
62#define CONFIG_EXEC_PARAMS_NEW "global/config_exec_params.new"
69#define REALTYPE_PRECISION 17
75#define GUC_SAFE_SEARCH_PATH "pg_catalog, pg_temp"
102#define MAX_UNIT_LEN 3
113#if BLCKSZ < 1024 || BLCKSZ > (1024*1024)
114#error BLCKSZ must be between 1KB and 1MB
116#if XLOG_BLCKSZ < 1024 || XLOG_BLCKSZ > (1024*1024)
117#error XLOG_BLCKSZ must be between 1KB and 1MB
192 "sort_mem",
"work_mem",
193 "vacuum_mem",
"maintenance_work_mem",
194 "ssl_ecdh_curve",
"ssl_groups",
343 strcmp(item->name,
"data_directory") == 0)
400 record =
find_option(item->name,
false,
true, elevel);
414 if (!
pitem->ignore &&
416 pitem->ignore =
true;
427 errmsg(
"unrecognized configuration parameter \"%s\" in file \"%s\" line %d",
429 item->filename, item->sourceline)));
430 item->errmsg =
pstrdup(
"unrecognized configuration parameter");
466 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
502 (
errmsg(
"parameter \"%s\" removed from configuration file, reset to default",
567 (
errmsg(
"parameter \"%s\" changed to \"%s\"",
568 item->name, item->value)));
570 item->applied =
true;
575 item->errmsg =
pstrdup(
"setting could not be applied");
581 item->applied =
true;
609 errmsg(
"configuration file \"%s\" contains errors",
614 errmsg(
"configuration file \"%s\" contains errors; unaffected changes were applied",
619 errmsg(
"configuration file \"%s\" contains errors; no changes were applied",
645 errmsg(
"out of memory")));
670 errmsg(
"out of memory")));
708 if (strval == *(
conf->_string.variable) ||
709 strval ==
conf->_string.reset_val ||
710 strval ==
conf->_string.boot_val)
787 switch (
gconf->vartype)
790 val->val.boolval = *
gconf->_bool.variable;
793 val->val.intval = *
gconf->_int.variable;
796 val->val.realval = *
gconf->_real.variable;
802 val->val.enumval = *
gconf->_enum.variable;
815 switch (
gconf->vartype)
825 &(
val->val.stringval),
857 qsort(result, *num_vars,
940 errmsg(
"out of memory")));
961 for (
const char *p =
name; *p; p++)
970 else if (
strchr(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
971 "abcdefghijklmnopqrstuvwxyz_", *p) !=
NULL ||
1017 errmsg(
"invalid configuration parameter name \"%s\"",
1019 errdetail(
"Custom parameter names must be two or more simple identifiers separated by dots.")));
1033 errmsg(
"invalid configuration parameter name \"%s\"",
1035 errdetail(
"\"%s\" is a reserved prefix.",
1048 errmsg(
"unrecognized configuration parameter \"%s\"",
1076 var->
short_desc =
"GUC placeholder variable";
1155 errmsg(
"unrecognized configuration parameter \"%s\"",
1189 if (
cha >=
'A' &&
cha <=
'Z')
1191 if (
chb >=
'A' &&
chb <=
'Z')
1210 const char *
name = *(
const char *
const *) key;
1217 if (
ch >=
'A' &&
ch <=
'Z')
1233 const char *
name1 = *(
const char *
const *)
key1;
1234 const char *
name2 = *(
const char *
const *)
key2;
1267 for (
char *ptr = result; *ptr !=
'\0'; ptr++)
1271 if (
ch >=
'A' &&
ch <=
'Z')
1311#ifdef USE_ASSERT_CHECKING
1316 switch (
gconf->vartype)
1322 if (*
conf->variable && !
conf->boot_val)
1324 elog(
LOG,
"GUC (PGC_BOOL) %s, boot_val=%d, C-var=%d",
1334 if (*
conf->variable != 0 && *
conf->variable !=
conf->boot_val)
1336 elog(
LOG,
"GUC (PGC_INT) %s, boot_val=%d, C-var=%d",
1346 if (*
conf->variable != 0.0 && *
conf->variable !=
conf->boot_val)
1348 elog(
LOG,
"GUC (PGC_REAL) %s, boot_val=%g, C-var=%g",
1362 elog(
LOG,
"GUC (PGC_STRING) %s, boot_val=%s, C-var=%s",
1372 if (*
conf->variable !=
conf->boot_val)
1374 elog(
LOG,
"GUC (PGC_ENUM) %s, boot_val=%d, C-var=%d",
1391 elog(
LOG,
"GUC %s flags: NO_SHOW_ALL and !NOT_IN_SAMPLE",
1536 gconf->sourceline = 0;
1538 switch (
gconf->vartype)
1547 elog(
FATAL,
"failed to initialize %s to %d",
1549 if (
conf->assign_hook)
1563 elog(
FATAL,
"failed to initialize %s to %d",
1565 if (
conf->assign_hook)
1579 elog(
FATAL,
"failed to initialize %s to %g",
1581 if (
conf->assign_hook)
1599 elog(
FATAL,
"failed to initialize %s to \"%s\"",
1601 if (
conf->assign_hook)
1613 elog(
FATAL,
"failed to initialize %s to %d",
1615 if (
conf->assign_hook)
1671 write_stderr(
"%s: could not access directory \"%s\": %m\n",
1675 write_stderr(
"Run initdb or pg_basebackup to initialize a PostgreSQL data directory.\n");
1699 write_stderr(
"%s does not know where to find the server configuration file.\n"
1700 "You must specify the --config-file or -D invocation "
1701 "option or set the PGDATA environment variable.\n",
1722 write_stderr(
"%s: could not access the server configuration file \"%s\": %m\n",
1749 write_stderr(
"%s does not know where to find the database system data.\n"
1750 "This can be specified as \"data_directory\" in \"%s\", "
1751 "or by the -D invocation option, or by the "
1752 "PGDATA environment variable.\n",
1801 write_stderr(
"%s does not know where to find the \"hba\" configuration file.\n"
1802 "This can be specified as \"hba_file\" in \"%s\", "
1803 "or by the -D invocation option, or by the "
1804 "PGDATA environment variable.\n",
1832 write_stderr(
"%s does not know where to find the \"ident\" configuration file.\n"
1833 "This can be specified as \"ident_file\" in \"%s\", "
1834 "or by the -D invocation option, or by the "
1835 "PGDATA environment variable.\n",
1902 switch (
gconf->vartype)
1908 if (
conf->assign_hook)
1910 gconf->reset_extra);
1913 gconf->reset_extra);
1920 if (
conf->assign_hook)
1922 gconf->reset_extra);
1925 gconf->reset_extra);
1932 if (
conf->assign_hook)
1934 gconf->reset_extra);
1937 gconf->reset_extra);
1944 if (
conf->assign_hook)
1946 gconf->reset_extra);
1949 gconf->reset_extra);
1956 if (
conf->assign_hook)
1958 gconf->reset_extra);
1961 gconf->reset_extra);
2018 stack =
gconf->stack;
2082 gconf->stack = stack;
2098 elog(
WARNING,
"GUC nest level = %d at transaction start",
2195 else if (prev ==
NULL ||
2277 switch (
gconf->vartype)
2288 if (
conf->assign_hook)
2306 if (
conf->assign_hook)
2324 if (
conf->assign_hook)
2342 if (
conf->assign_hook)
2369 if (
conf->assign_hook)
2396 gconf->stack = prev;
2555 while (*unit !=
'\0' && !
isspace((
unsigned char) *unit) &&
2560 while (
isspace((
unsigned char) *unit))
2571 for (
int i = 0; *
table[
i].unit;
i++)
2573 if (base_unit ==
table[
i].base_unit &&
2583 if (*
table[
i + 1].unit &&
2584 base_unit ==
table[
i + 1].base_unit)
2615 for (
int i = 0; *
table[
i].unit;
i++)
2617 if (base_unit ==
table[
i].base_unit)
2624 if (
table[
i].multiplier <= 1.0 ||
2645 double *
value,
const char **unit)
2656 for (
int i = 0; *
table[
i].unit;
i++)
2658 if (base_unit ==
table[
i].base_unit)
2700 static char bbuf[8];
2703 if (
bbuf[0] ==
'\0')
2709 static char xbuf[8];
2712 if (
xbuf[0] ==
'\0')
2723 elog(
ERROR,
"unrecognized GUC units value: %d",
2767 if (*endptr ==
'.' || *endptr ==
'e' || *endptr ==
'E' ||
2782 while (
isspace((
unsigned char) *endptr))
2786 if (*endptr !=
'\0')
2855 while (
isspace((
unsigned char) *endptr))
2859 if (*endptr !=
'\0')
2899 if (entry->val ==
val)
2903 elog(
ERROR,
"could not find enum option %d for %s",
2923 *retval = entry->val;
2941 const char *suffix,
const char *
separator)
3009 errmsg(
"parameter \"%s\" requires a Boolean value",
3029 errmsg(
"invalid value for parameter \"%s\": \"%s\"",
3047 errmsg(
"%d%s%s is outside the valid range for parameter \"%s\" (%d%s%s .. %d%s%s)",
3070 errmsg(
"invalid value for parameter \"%s\": \"%s\"",
3088 errmsg(
"%g%s%s is outside the valid range for parameter \"%s\" (%g%s%s .. %g%s%s)",
3138 _(
"Available values: "),
3154 errmsg(
"invalid value for parameter \"%s\": \"%s\"",
3336 errmsg(
"parameter \"%s\" cannot be set during a parallel operation",
3352 errmsg(
"parameter \"%s\" cannot be changed",
3375 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
3385 errmsg(
"parameter \"%s\" cannot be changed now",
3412 errmsg(
"permission denied to set parameter \"%s\"",
3454 errmsg(
"parameter \"%s\" cannot be set after connection start",
3474 errmsg(
"permission denied to set parameter \"%s\"",
3513 errmsg(
"cannot set parameter \"%s\" within security-definer function",
3521 errmsg(
"cannot set parameter \"%s\" within security-restricted operation",
3534 errmsg(
"parameter \"%s\" cannot be reset", record->
name)));
3541 errmsg(
"parameter \"%s\" cannot be set locally in functions",
3567 elog(
DEBUG3,
"\"%s\": setting ignored because previous source is higher priority",
3583#define newval (newval_union.boolval)
3619 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
3633 if (
conf->assign_hook)
3640 record->
srole = srole;
3653 for (
GucStack *stack = record->
stack; stack; stack = stack->prev)
3655 if (stack->source <=
source)
3657 stack->prior.val.boolval =
newval;
3661 stack->scontext = context;
3662 stack->srole = srole;
3679#define newval (newval_union.intval)
3715 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
3729 if (
conf->assign_hook)
3736 record->
srole = srole;
3749 for (
GucStack *stack = record->
stack; stack; stack = stack->prev)
3751 if (stack->source <=
source)
3753 stack->prior.val.intval =
newval;
3757 stack->scontext = context;
3758 stack->srole = srole;
3775#define newval (newval_union.realval)
3811 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
3825 if (
conf->assign_hook)
3832 record->
srole = srole;
3845 for (
GucStack *stack = record->
stack; stack; stack = stack->prev)
3847 if (stack->source <=
source)
3849 stack->prior.val.realval =
newval;
3853 stack->scontext = context;
3854 stack->srole = srole;
3874#define newval (newval_union.stringval)
3936 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
3950 if (
conf->assign_hook)
3957 record->
srole = srole;
3984 strcmp(record->
name,
"session_authorization") == 0)
4009 for (
GucStack *stack = record->
stack; stack; stack = stack->prev)
4011 if (stack->source <=
source)
4018 stack->scontext = context;
4019 stack->srole = srole;
4039#define newval (newval_union.enumval)
4075 errmsg(
"parameter \"%s\" cannot be changed without restarting the server",
4089 if (
conf->assign_hook)
4096 record->
srole = srole;
4109 for (
GucStack *stack = record->
stack; stack; stack = stack->prev)
4111 if (stack->source <=
source)
4113 stack->prior.val.enumval =
newval;
4117 stack->scontext = context;
4118 stack->srole = srole;
4222 static char buffer[256];
4231 errmsg(
"permission denied to examine \"%s\"",
name),
4232 errdetail(
"Only roles with privileges of the \"%s\" role may examine this parameter.",
4233 "pg_read_all_settings")));
4241 snprintf(buffer,
sizeof(buffer),
"%d",
4246 snprintf(buffer,
sizeof(buffer),
"%g",
4272 static char buffer[256];
4279 errmsg(
"permission denied to examine \"%s\"",
name),
4280 errdetail(
"Only roles with privileges of the \"%s\" role may examine this parameter.",
4281 "pg_read_all_settings")));
4289 snprintf(buffer,
sizeof(buffer),
"%d",
4294 snprintf(buffer,
sizeof(buffer),
"%g",
4323 return record->
flags;
4368 errmsg(
"out of memory")));
4427 pfree(item->filename);
4452 (*tail_p)->
next = newitem;
4489 errmsg(
"ALTER SYSTEM is not allowed in this environment")));
4508 elog(
ERROR,
"unrecognized alter system stmt type: %d",
4521 errmsg(
"permission denied to perform ALTER SYSTEM RESET ALL")));
4531 errmsg(
"permission denied to set parameter \"%s\"",
4556 errmsg(
"parameter \"%s\" cannot be changed",
4572 errmsg(
"invalid value for parameter \"%s\": \"%s\"",
4605 errmsg(
"parameter value for ALTER SYSTEM must not contain a newline")));
4642 errmsg(
"could not open file \"%s\": %m",
4650 errmsg(
"could not parse contents of file \"%s\"",
4692 errmsg(
"could not open file \"%s\": %m",
4757 elog(
FATAL,
"cannot create PGC_POSTMASTER variables after startup");
4766 elog(
FATAL,
"extensions cannot define GUC_LIST_QUOTE variables");
4832 errmsg(
"attempt to redefine parameter \"%s\"",
name)));
4868 if (
pHolder->_string.reset_val)
5170 errmsg(
"invalid configuration parameter name \"%s\", removing it",
5172 errdetail(
"\"%s\" is now a reserved prefix.",
5231 switch (
conf->vartype)
5288 result[*num] =
conf;
5316 errmsg(
"permission denied to examine \"%s\"",
name),
5317 errdetail(
"Only roles with privileges of the \"%s\" role may examine this parameter.",
5318 "pg_read_all_settings")));
5321 *varname = record->
name;
5345 if (
conf->show_hook)
5348 val = *
conf->variable ?
"on" :
"off";
5356 if (
conf->show_hook)
5385 if (
conf->show_hook)
5389 double result = *
conf->variable;
5399 snprintf(buffer,
sizeof(buffer),
"%g%s",
5410 if (
conf->show_hook)
5412 else if (*
conf->variable && **
conf->variable)
5423 if (
conf->show_hook)
5462 switch (
gconf->vartype)
5468 if (*
conf->variable)
5495 if (*
conf->variable)
5512 if (
gconf->sourcefile)
5541 errmsg(
"could not write to file \"%s\": %m",
5559 errmsg(
"could not write to file \"%s\": %m",
5592 elog(
FATAL,
"invalid format of exec config params file");
5596 else if (
i == maxlen)
5631 errmsg(
"could not read from file \"%s\": %m",
5642 elog(
FATAL,
"failed to locate variable \"%s\" in exec config params file", varname);
5645 elog(
FATAL,
"invalid format of exec config params file");
5647 elog(
FATAL,
"invalid format of exec config params file");
5649 elog(
FATAL,
"invalid format of exec config params file");
5651 elog(
FATAL,
"invalid format of exec config params file");
5653 elog(
FATAL,
"invalid format of exec config params file");
5655 elog(
FATAL,
"invalid format of exec config params file");
5730 switch (
gconf->vartype)
5748 if (
abs(*
conf->variable) < 1000)
5776 if (*
conf->variable)
5795 if (
gconf->sourcefile)
5802 if (
gconf->sourcefile &&
gconf->sourcefile[0])
5823 size =
sizeof(
Size);
5854 elog(
ERROR,
"not enough space to serialize GUC state");
5863 elog(
ERROR,
"vsnprintf failed: %m with format string \"%s\"",
fmt);
5868 elog(
ERROR,
"not enough space to serialize GUC state");
5881 elog(
ERROR,
"not enough space to serialize GUC state");
5902 switch (
gconf->vartype)
5909 (*
conf->variable ?
"true" :
"false"));
5936 *
conf->variable ? *
conf->variable :
"");
5951 (
gconf->sourcefile ?
gconf->sourcefile :
""));
5953 if (
gconf->sourcefile &&
gconf->sourcefile[0])
5955 sizeof(
gconf->sourceline));
5958 sizeof(
gconf->source));
5960 sizeof(
gconf->scontext));
5962 sizeof(
gconf->srole));
6012 for (ptr = *
srcptr; ptr <
srcend && *ptr !=
'\0'; ptr++)
6016 elog(
ERROR,
"could not find null terminator in GUC state");
6045 errcontext(
"while setting parameter \"%s\" to \"%s\"",
6120 switch (
gconf->vartype)
6133 if (
conf->reset_val &&
conf->reset_val != *
conf->variable)
6188 errmsg(
"parameter \"%s\" could not be set", varname)));
6275 errmsg(
"could not parse setting for parameter \"%s\"",
6312 action,
true, 0,
false);
6596 errmsg(
"permission denied to set parameter \"%s\"",
name)));
6645 if (!
conf->_bool.check_hook)
6660 errmsg(
"invalid value for parameter \"%s\": %d",
6679 if (!
conf->_int.check_hook)
6694 errmsg(
"invalid value for parameter \"%s\": %d",
6713 if (!
conf->_real.check_hook)
6728 errmsg(
"invalid value for parameter \"%s\": %g",
6746 volatile bool result =
true;
6749 if (!
conf->_string.check_hook)
6771 errmsg(
"invalid value for parameter \"%s\": \"%s\"",
6797 if (!
conf->_enum.check_hook)
6812 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 errmsg_internal(const char *fmt,...)
int errdetail_internal(const char *fmt,...)
int errcode_for_file_access(void)
int errdetail(const char *fmt,...)
ErrorContextCallback * error_context_stack
void FlushErrorState(void)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#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)