| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | #ifndef GUC_H |
| | #define GUC_H |
| |
|
| | #include "nodes/parsenodes.h" |
| | #include "tcop/dest.h" |
| | #include "utils/array.h" |
| |
|
| |
|
| | |
| | |
| | #if SIZEOF_SIZE_T > 4 && SIZEOF_LONG > 4 |
| | #define MAX_KILOBYTES INT_MAX |
| | #else |
| | #define MAX_KILOBYTES (INT_MAX / 1024) |
| | #endif |
| |
|
| | |
| | |
| | |
| | |
| | |
| | #define PG_AUTOCONF_FILENAME "postgresql.auto.conf" |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | typedef enum |
| | { |
| | PGC_INTERNAL, |
| | PGC_POSTMASTER, |
| | PGC_SIGHUP, |
| | PGC_SU_BACKEND, |
| | PGC_BACKEND, |
| | PGC_SUSET, |
| | PGC_USERSET, |
| | } GucContext; |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | typedef enum |
| | { |
| | PGC_S_DEFAULT, |
| | PGC_S_DYNAMIC_DEFAULT, |
| | PGC_S_ENV_VAR, |
| | PGC_S_FILE, |
| | PGC_S_ARGV, |
| | PGC_S_GLOBAL, |
| | PGC_S_DATABASE, |
| | PGC_S_USER, |
| | PGC_S_DATABASE_USER, |
| | PGC_S_CLIENT, |
| | PGC_S_OVERRIDE, |
| | PGC_S_INTERACTIVE, |
| | PGC_S_TEST, |
| | PGC_S_SESSION, |
| | } GucSource; |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | typedef struct ConfigVariable |
| | { |
| | char *name; |
| | char *value; |
| | char *errmsg; |
| | char *filename; |
| | int sourceline; |
| | bool ignore; |
| | bool applied; |
| | struct ConfigVariable *next; |
| | } ConfigVariable; |
| |
|
| | typedef struct config_generic config_handle; |
| |
|
| | extern 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); |
| | extern bool ParseConfigFp(FILE *fp, const char *config_file, |
| | int depth, int elevel, |
| | ConfigVariable **head_p, ConfigVariable **tail_p); |
| | extern bool ParseConfigDirectory(const char *includedir, |
| | const char *calling_file, int calling_lineno, |
| | int depth, int elevel, |
| | ConfigVariable **head_p, |
| | ConfigVariable **tail_p); |
| | extern void FreeConfigVariables(ConfigVariable *list); |
| | extern char *DeescapeQuotedString(const char *s); |
| |
|
| | |
| | |
| | |
| | |
| | |
| | struct config_enum_entry |
| | { |
| | const char *name; |
| | int val; |
| | bool hidden; |
| | }; |
| |
|
| | |
| | |
| | |
| | typedef bool (*GucBoolCheckHook) (bool *newval, void **extra, GucSource source); |
| | typedef bool (*GucIntCheckHook) (int *newval, void **extra, GucSource source); |
| | typedef bool (*GucRealCheckHook) (double *newval, void **extra, GucSource source); |
| | typedef bool (*GucStringCheckHook) (char **newval, void **extra, GucSource source); |
| | typedef bool (*GucEnumCheckHook) (int *newval, void **extra, GucSource source); |
| |
|
| | typedef void (*GucBoolAssignHook) (bool newval, void *extra); |
| | typedef void (*GucIntAssignHook) (int newval, void *extra); |
| | typedef void (*GucRealAssignHook) (double newval, void *extra); |
| | typedef void (*GucStringAssignHook) (const char *newval, void *extra); |
| | typedef void (*GucEnumAssignHook) (int newval, void *extra); |
| |
|
| | typedef const char *(*GucShowHook) (void); |
| |
|
| | |
| | |
| | |
| | typedef enum |
| | { |
| | |
| | GUC_ACTION_SET, |
| | GUC_ACTION_LOCAL, |
| | GUC_ACTION_SAVE, |
| | } GucAction; |
| |
|
| | #define GUC_QUALIFIER_SEPARATOR '.' |
| |
|
| | |
| | |
| | |
| | |
| | #define GUC_LIST_INPUT 0x000001 |
| | #define GUC_LIST_QUOTE 0x000002 |
| | #define GUC_NO_SHOW_ALL 0x000004 |
| | #define GUC_NO_RESET 0x000008 |
| | #define GUC_NO_RESET_ALL 0x000010 |
| | #define GUC_EXPLAIN 0x000020 |
| | #define GUC_REPORT 0x000040 |
| | #define GUC_NOT_IN_SAMPLE 0x000080 |
| | #define GUC_DISALLOW_IN_FILE 0x000100 |
| | #define GUC_CUSTOM_PLACEHOLDER 0x000200 |
| | #define GUC_SUPERUSER_ONLY 0x000400 |
| | #define GUC_IS_NAME 0x000800 |
| | #define GUC_NOT_WHILE_SEC_REST 0x001000 |
| | #define GUC_DISALLOW_IN_AUTO_FILE \ |
| | 0x002000 |
| | #define GUC_RUNTIME_COMPUTED 0x004000 |
| | #define GUC_ALLOW_IN_PARALLEL 0x008000 |
| |
|
| | #define GUC_UNIT_KB 0x01000000 |
| | #define GUC_UNIT_BLOCKS 0x02000000 |
| | #define GUC_UNIT_XBLOCKS 0x03000000 |
| | #define GUC_UNIT_MB 0x04000000 |
| | #define GUC_UNIT_BYTE 0x05000000 |
| | #define GUC_UNIT_MEMORY 0x0F000000 |
| |
|
| | #define GUC_UNIT_MS 0x10000000 |
| | #define GUC_UNIT_S 0x20000000 |
| | #define GUC_UNIT_MIN 0x30000000 |
| | #define GUC_UNIT_TIME 0x70000000 |
| |
|
| | #define GUC_UNIT (GUC_UNIT_MEMORY | GUC_UNIT_TIME) |
| |
|
| |
|
| | |
| | extern PGDLLIMPORT bool Debug_print_plan; |
| | extern PGDLLIMPORT bool Debug_print_parse; |
| | extern PGDLLIMPORT bool Debug_print_rewritten; |
| | extern PGDLLIMPORT bool Debug_pretty_print; |
| |
|
| | extern PGDLLIMPORT bool log_parser_stats; |
| | extern PGDLLIMPORT bool log_planner_stats; |
| | extern PGDLLIMPORT bool log_executor_stats; |
| | extern PGDLLIMPORT bool log_statement_stats; |
| | extern PGDLLIMPORT bool log_btree_build_stats; |
| |
|
| | extern PGDLLIMPORT bool check_function_bodies; |
| | extern PGDLLIMPORT bool current_role_is_superuser; |
| |
|
| | extern PGDLLIMPORT bool AllowAlterSystem; |
| | extern PGDLLIMPORT bool log_duration; |
| | extern PGDLLIMPORT int log_parameter_max_length; |
| | extern PGDLLIMPORT int log_parameter_max_length_on_error; |
| | extern PGDLLIMPORT int log_min_error_statement; |
| | extern PGDLLIMPORT int log_min_messages; |
| | extern PGDLLIMPORT int client_min_messages; |
| | extern PGDLLIMPORT int log_min_duration_sample; |
| | extern PGDLLIMPORT int log_min_duration_statement; |
| | extern PGDLLIMPORT int log_temp_files; |
| | extern PGDLLIMPORT double log_statement_sample_rate; |
| | extern PGDLLIMPORT double log_xact_sample_rate; |
| | extern PGDLLIMPORT char *backtrace_functions; |
| |
|
| | extern PGDLLIMPORT int temp_file_limit; |
| |
|
| | extern PGDLLIMPORT int num_temp_buffers; |
| |
|
| | extern PGDLLIMPORT char *cluster_name; |
| | extern PGDLLIMPORT char *ConfigFileName; |
| | extern PGDLLIMPORT char *HbaFileName; |
| | extern PGDLLIMPORT char *IdentFileName; |
| | extern PGDLLIMPORT char *external_pid_file; |
| |
|
| | extern PGDLLIMPORT char *application_name; |
| |
|
| | extern PGDLLIMPORT int tcp_keepalives_idle; |
| | extern PGDLLIMPORT int tcp_keepalives_interval; |
| | extern PGDLLIMPORT int tcp_keepalives_count; |
| | extern PGDLLIMPORT int tcp_user_timeout; |
| |
|
| | #ifdef TRACE_SORT |
| | extern PGDLLIMPORT bool trace_sort; |
| | #endif |
| |
|
| | |
| | |
| | |
| | extern void SetConfigOption(const char *name, const char *value, |
| | GucContext context, GucSource source); |
| |
|
| | extern 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) pg_attribute_nonnull(1, 4); |
| |
|
| | extern 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) pg_attribute_nonnull(1, 4); |
| |
|
| | extern 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) pg_attribute_nonnull(1, 4); |
| |
|
| | extern 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) pg_attribute_nonnull(1, 4); |
| |
|
| | extern 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) pg_attribute_nonnull(1, 4); |
| |
|
| | extern void MarkGUCPrefixReserved(const char *className); |
| |
|
| | |
| | #define EmitWarningsOnPlaceholders(className) MarkGUCPrefixReserved(className) |
| |
|
| | extern const char *GetConfigOption(const char *name, bool missing_ok, |
| | bool restrict_privileged); |
| | extern const char *GetConfigOptionResetString(const char *name); |
| | extern int GetConfigOptionFlags(const char *name, bool missing_ok); |
| | extern void ProcessConfigFile(GucContext context); |
| | extern char *convert_GUC_name_for_parameter_acl(const char *name); |
| | extern void check_GUC_name_for_parameter_acl(const char *name); |
| | extern void InitializeGUCOptions(void); |
| | extern bool SelectConfigFiles(const char *userDoption, const char *progname); |
| | extern void ResetAllOptions(void); |
| | extern void AtStart_GUC(void); |
| | extern int NewGUCNestLevel(void); |
| | extern void RestrictSearchPath(void); |
| | extern void AtEOXact_GUC(bool isCommit, int nestLevel); |
| | extern void BeginReportingGUCOptions(void); |
| | extern void ReportChangedGUCOptions(void); |
| | extern void ParseLongOption(const char *string, char **name, char **value); |
| | extern const char *get_config_unit_name(int flags); |
| | extern bool parse_int(const char *value, int *result, int flags, |
| | const char **hintmsg); |
| | extern bool parse_real(const char *value, double *result, int flags, |
| | const char **hintmsg); |
| | extern int set_config_option(const char *name, const char *value, |
| | GucContext context, GucSource source, |
| | GucAction action, bool changeVal, int elevel, |
| | bool is_reload); |
| | extern 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); |
| | extern 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); |
| | extern config_handle *get_config_handle(const char *name); |
| | extern void AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt); |
| | extern char *GetConfigOptionByName(const char *name, const char **varname, |
| | bool missing_ok); |
| |
|
| | extern void TransformGUCArray(ArrayType *array, List **names, |
| | List **values); |
| | extern void ProcessGUCArray(ArrayType *array, |
| | GucContext context, GucSource source, GucAction action); |
| | extern ArrayType *GUCArrayAdd(ArrayType *array, const char *name, const char *value); |
| | extern ArrayType *GUCArrayDelete(ArrayType *array, const char *name); |
| | extern ArrayType *GUCArrayReset(ArrayType *array); |
| |
|
| | extern void *guc_malloc(int elevel, size_t size); |
| | extern pg_nodiscard void *guc_realloc(int elevel, void *old, size_t size); |
| | extern char *guc_strdup(int elevel, const char *src); |
| | extern void guc_free(void *ptr); |
| |
|
| | #ifdef EXEC_BACKEND |
| | extern void write_nondefault_variables(GucContext context); |
| | extern void read_nondefault_variables(void); |
| | #endif |
| |
|
| | |
| | extern Size EstimateGUCStateSpace(void); |
| | extern void SerializeGUCState(Size maxsize, char *start_address); |
| | extern void RestoreGUCState(void *gucstate); |
| |
|
| | |
| | extern void ExecSetVariableStmt(VariableSetStmt *stmt, bool isTopLevel); |
| | extern char *ExtractSetVariableArgs(VariableSetStmt *stmt); |
| | extern void SetPGVariable(const char *name, List *args, bool is_local); |
| | extern void GetPGVariable(const char *name, DestReceiver *dest); |
| | extern TupleDesc GetPGVariableResultDesc(const char *name); |
| |
|
| | |
| |
|
| | extern PGDLLIMPORT char *GUC_check_errmsg_string; |
| | extern PGDLLIMPORT char *GUC_check_errdetail_string; |
| | extern PGDLLIMPORT char *GUC_check_errhint_string; |
| |
|
| | extern void GUC_check_errcode(int sqlerrcode); |
| |
|
| | #define GUC_check_errmsg \ |
| | pre_format_elog_string(errno, TEXTDOMAIN), \ |
| | GUC_check_errmsg_string = format_elog_string |
| |
|
| | #define GUC_check_errdetail \ |
| | pre_format_elog_string(errno, TEXTDOMAIN), \ |
| | GUC_check_errdetail_string = format_elog_string |
| |
|
| | #define GUC_check_errhint \ |
| | pre_format_elog_string(errno, TEXTDOMAIN), \ |
| | GUC_check_errhint_string = format_elog_string |
| |
|
| | #endif |
| |
|