PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <sys/stat.h>
#include <unistd.h>
#include "access/xact.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_parameter_acl.h"
#include "funcapi.h"
#include "guc_internal.h"
#include "miscadmin.h"
#include "parser/parse_type.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/guc_tables.h"
#include "utils/snapmgr.h"
Go to the source code of this file.
Macros | |
#define | MAX_GUC_FLAGS 6 |
#define | NUM_PG_SETTINGS_ATTS 17 |
#define | NUM_PG_FILE_SETTINGS_ATTS 7 |
Functions | |
static char * | flatten_set_variable_args (const char *name, List *args) |
static void | ShowGUCConfigOption (const char *name, DestReceiver *dest) |
static void | ShowAllGUCConfig (DestReceiver *dest) |
void | ExecSetVariableStmt (VariableSetStmt *stmt, bool isTopLevel) |
char * | ExtractSetVariableArgs (VariableSetStmt *stmt) |
void | SetPGVariable (const char *name, List *args, bool is_local) |
Datum | set_config_by_name (PG_FUNCTION_ARGS) |
void | GetPGVariable (const char *name, DestReceiver *dest) |
TupleDesc | GetPGVariableResultDesc (const char *name) |
Datum | pg_settings_get_flags (PG_FUNCTION_ARGS) |
bool | ConfigOptionIsVisible (struct config_generic *conf) |
static void | GetConfigOptionValues (struct config_generic *conf, const char **values) |
Datum | show_config_by_name (PG_FUNCTION_ARGS) |
Datum | show_config_by_name_missing_ok (PG_FUNCTION_ARGS) |
Datum | show_all_settings (PG_FUNCTION_ARGS) |
Datum | show_all_file_settings (PG_FUNCTION_ARGS) |
#define MAX_GUC_FLAGS 6 |
#define NUM_PG_FILE_SETTINGS_ATTS 7 |
#define NUM_PG_SETTINGS_ATTS 17 |
Definition at line 846 of file guc_funcs.c.
bool ConfigOptionIsVisible | ( | struct config_generic * | conf | ) |
Definition at line 581 of file guc_funcs.c.
References config_generic::flags, GetUserId(), GUC_SUPERUSER_ONLY, and has_privs_of_role().
Referenced by get_explain_guc_options(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionResetString(), show_all_settings(), and ShowAllGUCConfig().
void ExecSetVariableStmt | ( | VariableSetStmt * | stmt, |
bool | isTopLevel | ||
) |
Definition at line 43 of file guc_funcs.c.
References ACL_SET, generate_unaccent_rules::action, DefElem::arg, DefElem::defname, elog, ereport, errcode(), errmsg(), ERROR, ExtractSetVariableArgs(), GUC_ACTION_LOCAL, GUC_ACTION_SET, ImportSnapshot(), InvokeObjectPostAlterHookArgStr, IsInParallelMode(), lfirst, linitial_node, list_make1, PGC_S_SESSION, PGC_SUSET, PGC_USERSET, ResetAllOptions(), set_config_option(), SetPGVariable(), stmt, strVal, superuser(), A_Const::val, VAR_RESET, VAR_RESET_ALL, VAR_SET_CURRENT, VAR_SET_DEFAULT, VAR_SET_MULTI, VAR_SET_VALUE, and WarnNoTransactionBlock().
Referenced by standard_ProcessUtility().
char* ExtractSetVariableArgs | ( | VariableSetStmt * | stmt | ) |
Definition at line 167 of file guc_funcs.c.
References flatten_set_variable_args(), GetConfigOptionByName(), stmt, VAR_SET_CURRENT, and VAR_SET_VALUE.
Referenced by AlterSetting(), AlterSystemSetConfigFile(), ExecSetVariableStmt(), and update_proconfig_value().
|
static |
Definition at line 192 of file guc_funcs.c.
References appendStringInfo(), appendStringInfoString(), arg, TypeCast::arg, generate_unaccent_rules::args, Assert, buf, castNode, CStringGetDatum(), DatumGetCString(), DirectFunctionCall1, DirectFunctionCall3, elog, ereport, errcode(), errmsg(), ERROR, find_option(), config_generic::flags, GUC_LIST_INPUT, GUC_LIST_QUOTE, initStringInfo(), Int32GetDatum(), interval_in(), interval_out(), intVal, InvalidOid, IsA, lfirst, list_head(), list_length(), name, NIL, nodeTag, ObjectIdGetDatum(), quote_identifier(), strVal, TypeCast::typeName, typenameTypeIdAndMod(), A_Const::val, val, and WARNING.
Referenced by ExtractSetVariableArgs(), and SetPGVariable().
|
static |
Definition at line 594 of file guc_funcs.c.
References _, config_bool::boot_val, config_int::boot_val, config_real::boot_val, config_string::boot_val, config_enum::boot_val, config_enum_get_options(), config_enum_lookup_by_value(), config_group_names, config_type_names, config_generic::context, config_generic::flags, get_config_unit_name(), GetUserId(), config_generic::group, GUC_PENDING_RESTART, GucContext_Names, GucSource_Names, has_privs_of_role(), config_generic::long_desc, config_int::max, config_real::max, config_int::min, config_real::min, config_generic::name, PGC_BOOL, PGC_ENUM, PGC_INT, PGC_REAL, PGC_S_FILE, PGC_STRING, pstrdup(), config_bool::reset_val, config_int::reset_val, config_real::reset_val, config_string::reset_val, config_enum::reset_val, config_generic::short_desc, ShowGUCOption(), snprintf, config_generic::source, config_generic::sourcefile, config_generic::sourceline, config_generic::status, values, and config_generic::vartype.
Referenced by show_all_settings().
void GetPGVariable | ( | const char * | name, |
DestReceiver * | dest | ||
) |
Definition at line 382 of file guc_funcs.c.
References generate_unaccent_rules::dest, guc_name_compare(), name, ShowAllGUCConfig(), and ShowGUCConfigOption().
Referenced by exec_replication_command(), and standard_ProcessUtility().
TupleDesc GetPGVariableResultDesc | ( | const char * | name | ) |
Definition at line 394 of file guc_funcs.c.
References CreateTemplateTupleDesc(), GetConfigOptionByName(), guc_name_compare(), name, and TupleDescInitEntry().
Referenced by UtilityTupleDescriptor().
Datum pg_settings_get_flags | ( | PG_FUNCTION_ARGS | ) |
Definition at line 542 of file guc_funcs.c.
References a, Assert, construct_array_builtin(), CStringGetTextDatum, ERROR, find_option(), config_generic::flags, GUC_EXPLAIN, GUC_NO_RESET, GUC_NO_RESET_ALL, GUC_NO_SHOW_ALL, GUC_NOT_IN_SAMPLE, GUC_RUNTIME_COMPUTED, MAX_GUC_FLAGS, PG_GETARG_DATUM, PG_RETURN_ARRAYTYPE_P, PG_RETURN_NULL, and TextDatumGetCString.
Datum set_config_by_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 332 of file guc_funcs.c.
References cstring_to_text(), ereport, errcode(), errmsg(), ERROR, GetConfigOptionByName(), GUC_ACTION_LOCAL, GUC_ACTION_SET, name, PG_ARGISNULL, PG_GETARG_BOOL, PG_GETARG_DATUM, PG_RETURN_TEXT_P, PGC_S_SESSION, PGC_SUSET, PGC_USERSET, set_config_option(), superuser(), TextDatumGetCString, and value.
Definition at line 315 of file guc_funcs.c.
References generate_unaccent_rules::args, flatten_set_variable_args(), GUC_ACTION_LOCAL, GUC_ACTION_SET, name, PGC_S_SESSION, PGC_SUSET, PGC_USERSET, set_config_option(), and superuser().
Referenced by DiscardAll(), ExecSetVariableStmt(), and standard_ProcessUtility().
Datum show_all_file_settings | ( | PG_FUNCTION_ARGS | ) |
Definition at line 984 of file guc_funcs.c.
References BoolGetDatum(), cstring_to_text(), DEBUG3, InitMaterializedSRF(), Int32GetDatum(), NUM_PG_FILE_SETTINGS_ATTS, PGC_SIGHUP, PointerGetDatum(), ProcessConfigFileInternal(), ReturnSetInfo::setDesc, ReturnSetInfo::setResult, tuplestore_putvalues(), and values.
Datum show_all_settings | ( | PG_FUNCTION_ARGS | ) |
Definition at line 849 of file guc_funcs.c.
References FuncCallContext::attinmeta, BuildTupleFromCStrings(), FuncCallContext::call_cntr, ConfigOptionIsVisible(), CreateTemplateTupleDesc(), config_generic::flags, get_guc_variables(), GetConfigOptionValues(), GUC_NO_SHOW_ALL, HeapTupleGetDatum(), FuncCallContext::max_calls, MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, NUM_PG_SETTINGS_ATTS, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, TupleDescGetAttInMetadata(), TupleDescInitEntry(), FuncCallContext::user_fctx, values, and while().
Datum show_config_by_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 807 of file guc_funcs.c.
References cstring_to_text(), GetConfigOptionByName(), PG_GETARG_DATUM, PG_RETURN_TEXT_P, and TextDatumGetCString.
Datum show_config_by_name_missing_ok | ( | PG_FUNCTION_ARGS | ) |
Definition at line 825 of file guc_funcs.c.
References cstring_to_text(), GetConfigOptionByName(), PG_GETARG_BOOL, PG_GETARG_DATUM, PG_RETURN_NULL, PG_RETURN_TEXT_P, and TextDatumGetCString.
|
static |
Definition at line 456 of file guc_funcs.c.
References begin_tup_output_tupdesc(), ConfigOptionIsVisible(), CreateTemplateTupleDesc(), cstring_to_text(), DatumGetPointer(), generate_unaccent_rules::dest, do_tup_output(), end_tup_output(), config_generic::flags, get_guc_variables(), GUC_NO_SHOW_ALL, i, config_generic::name, pfree(), PointerGetDatum(), config_generic::short_desc, ShowGUCOption(), TTSOpsVirtual, TupleDescInitBuiltinEntry(), and values.
Referenced by GetPGVariable().
|
static |
Definition at line 428 of file guc_funcs.c.
References begin_tup_output_tupdesc(), CreateTemplateTupleDesc(), generate_unaccent_rules::dest, do_text_output_oneline, end_tup_output(), GetConfigOptionByName(), name, TTSOpsVirtual, TupleDescInitBuiltinEntry(), and value.
Referenced by GetPGVariable().