|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <float.h>#include "access/gist_private.h"#include "access/hash.h"#include "access/heaptoast.h"#include "access/htup_details.h"#include "access/nbtree.h"#include "access/reloptions.h"#include "access/spgist_private.h"#include "catalog/pg_type.h"#include "commands/defrem.h"#include "commands/tablespace.h"#include "nodes/makefuncs.h"#include "utils/array.h"#include "utils/attoptcache.h"#include "utils/builtins.h"#include "utils/guc.h"#include "utils/memutils.h"#include "utils/rel.h"
Go to the source code of this file.
Macros | |
| #define | GET_STRING_RELOPTION_LEN(option) |
Definition at line 602 of file reloptions.c.
| void add_bool_reloption | ( | bits32 | kinds, |
| const char * | name, | ||
| const char * | desc, | ||
| bool | default_val, | ||
| LOCKMODE | lockmode | ||
| ) |
Definition at line 900 of file reloptions.c.
References add_reloption(), fb(), init_bool_reloption(), and name.
Referenced by create_reloptions_table().
| void add_enum_reloption | ( | bits32 | kinds, |
| const char * | name, | ||
| const char * | desc, | ||
| relopt_enum_elt_def * | members, | ||
| int | default_val, | ||
| const char * | detailmsg, | ||
| LOCKMODE | lockmode | ||
| ) |
Definition at line 1118 of file reloptions.c.
References add_reloption(), fb(), init_enum_reloption(), and name.
Referenced by create_reloptions_table().
| void add_int_reloption | ( | bits32 | kinds, |
| const char * | name, | ||
| const char * | desc, | ||
| int | default_val, | ||
| int | min_val, | ||
| int | max_val, | ||
| LOCKMODE | lockmode | ||
| ) |
Definition at line 1001 of file reloptions.c.
References add_reloption(), fb(), init_int_reloption(), max_val, and name.
Referenced by _PG_init(), and create_reloptions_table().
| void add_local_bool_reloption | ( | local_relopts * | relopts, |
| const char * | name, | ||
| const char * | desc, | ||
| bool | default_val, | ||
| int | offset | ||
| ) |
Definition at line 916 of file reloptions.c.
References add_local_reloption(), fb(), init_bool_reloption(), name, and RELOPT_KIND_LOCAL.
| void add_local_enum_reloption | ( | local_relopts * | relopts, |
| const char * | name, | ||
| const char * | desc, | ||
| relopt_enum_elt_def * | members, | ||
| int | default_val, | ||
| const char * | detailmsg, | ||
| int | offset | ||
| ) |
Definition at line 1136 of file reloptions.c.
References add_local_reloption(), fb(), init_enum_reloption(), name, and RELOPT_KIND_LOCAL.
| void add_local_int_reloption | ( | local_relopts * | relopts, |
| const char * | name, | ||
| const char * | desc, | ||
| int | default_val, | ||
| int | min_val, | ||
| int | max_val, | ||
| int | offset | ||
| ) |
Definition at line 1018 of file reloptions.c.
References add_local_reloption(), fb(), init_int_reloption(), max_val, name, and RELOPT_KIND_LOCAL.
Referenced by _ltree_gist_options(), brin_minmax_multi_options(), g_int_options(), g_intbig_options(), ghstore_options(), gtrgm_options(), gtsvector_options(), and ltree_gist_options().
| void add_local_real_reloption | ( | local_relopts * | relopts, |
| const char * | name, | ||
| const char * | desc, | ||
| double | default_val, | ||
| double | min_val, | ||
| double | max_val, | ||
| int | offset | ||
| ) |
Definition at line 1072 of file reloptions.c.
References add_local_reloption(), fb(), init_real_reloption(), max_val, name, and RELOPT_KIND_LOCAL.
Referenced by brin_bloom_options().
|
static |
Definition at line 805 of file reloptions.c.
References Assert, fb(), lappend(), local_relopt::offset, local_relopt::option, and palloc_object.
Referenced by add_local_bool_reloption(), add_local_enum_reloption(), add_local_int_reloption(), add_local_real_reloption(), add_local_string_reloption(), and add_local_ternary_reloption().
| void add_local_string_reloption | ( | local_relopts * | relopts, |
| const char * | name, | ||
| const char * | desc, | ||
| const char * | default_val, | ||
| validate_string_relopt | validator, | ||
| fill_string_relopt | filler, | ||
| int | offset | ||
| ) |
Definition at line 1218 of file reloptions.c.
References add_local_reloption(), fb(), init_string_reloption(), name, and RELOPT_KIND_LOCAL.
| void add_local_ternary_reloption | ( | local_relopts * | relopts, |
| const char * | name, | ||
| const char * | desc, | ||
| int | offset | ||
| ) |
Definition at line 965 of file reloptions.c.
References add_local_reloption(), fb(), init_ternary_reloption(), name, and RELOPT_KIND_LOCAL.
| void add_real_reloption | ( | bits32 | kinds, |
| const char * | name, | ||
| const char * | desc, | ||
| double | default_val, | ||
| double | min_val, | ||
| double | max_val, | ||
| LOCKMODE | lockmode | ||
| ) |
Definition at line 1054 of file reloptions.c.
References add_reloption(), fb(), init_real_reloption(), max_val, and name.
Referenced by create_reloptions_table().
|
static |
Definition at line 748 of file reloptions.c.
References custom_options, fb(), MemoryContextSwitchTo(), need_initialization, num_custom_options, palloc(), repalloc(), and TopMemoryContext.
Referenced by add_bool_reloption(), add_enum_reloption(), add_int_reloption(), add_real_reloption(), add_string_reloption(), and add_ternary_reloption().
| relopt_kind add_reloption_kind | ( | void | ) |
Definition at line 731 of file reloptions.c.
References ereport, errcode(), errmsg(), ERROR, fb(), last_assigned_kind, and RELOPT_KIND_MAX.
Referenced by _PG_init(), and create_reloptions_table().
| void add_string_reloption | ( | bits32 | kinds, |
| const char * | name, | ||
| const char * | desc, | ||
| const char * | default_val, | ||
| validate_string_relopt | validator, | ||
| LOCKMODE | lockmode | ||
| ) |
Definition at line 1198 of file reloptions.c.
References add_reloption(), fb(), init_string_reloption(), and name.
Referenced by create_reloptions_table().
| void add_ternary_reloption | ( | bits32 | kinds, |
| const char * | name, | ||
| const char * | desc, | ||
| LOCKMODE | lockmode | ||
| ) |
Definition at line 947 of file reloptions.c.
References add_reloption(), fb(), init_ternary_reloption(), and name.
Referenced by create_reloptions_table().
|
static |
Definition at line 823 of file reloptions.c.
References elog, ERROR, fb(), MemoryContextSwitchTo(), name, palloc(), pstrdup(), RELOPT_KIND_LOCAL, RELOPT_TYPE_BOOL, RELOPT_TYPE_ENUM, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, RELOPT_TYPE_STRING, RELOPT_TYPE_TERNARY, TopMemoryContext, and type.
Referenced by init_bool_reloption(), init_enum_reloption(), init_int_reloption(), init_real_reloption(), init_string_reloption(), and init_ternary_reloption().
|
static |
Definition at line 1825 of file reloptions.c.
References fb(), relopt_string::gen, GET_STRING_RELOPTION_LEN, i, palloc0(), RELOPT_TYPE_STRING, and val.
Referenced by build_local_reloptions(), and build_reloptions().
Definition at line 2241 of file reloptions.c.
References AccessExclusiveLock, DefElem::defname, fb(), i, initialize_reloptions(), lfirst, relopt_gen::lockmode, name, relopt_gen::namelen, need_initialization, NIL, NoLock, and relOpts.
Referenced by AlterTableGetLockLevel().
Definition at line 2202 of file reloptions.c.
References build_reloptions(), fb(), lengthof, RELOPT_KIND_ATTRIBUTE, RELOPT_TYPE_REAL, and validate().
Referenced by ATExecSetOptions(), and get_attribute_options().
| void * build_local_reloptions | ( | local_relopts * | relopts, |
| Datum | options, | ||
| bool | validate | ||
| ) |
Definition at line 2078 of file reloptions.c.
References allocateReloptStruct(), fb(), fillRelOptions(), i, lfirst, list_length(), relopt_gen::name, noptions, relopt_parse_elt::offset, local_relopt::offset, local_relopt::option, relopt_parse_elt::optname, opts, relopt_parse_elt::opttype, palloc_array, parseLocalRelOptions(), pfree(), relopt_gen::type, and validate().
Referenced by index_opclass_options().
| void * build_reloptions | ( | Datum | reloptions, |
| bool | validate, | ||
| relopt_kind | kind, | ||
| Size | relopt_struct_size, | ||
| const relopt_parse_elt * | relopt_elems, | ||
| int | num_relopt_elems | ||
| ) |
Definition at line 2041 of file reloptions.c.
References allocateReloptStruct(), Assert, fb(), fillRelOptions(), parseRelOptions(), pfree(), and validate().
Referenced by attribute_reloptions(), bloptions(), brinoptions(), btoptions(), default_reloptions(), dioptions(), ginoptions(), gistoptions(), hashoptions(), spgoptions(), tablespace_reloptions(), and view_reloptions().
| bytea * default_reloptions | ( | Datum | reloptions, |
| bool | validate, | ||
| relopt_kind | kind | ||
| ) |
Definition at line 1965 of file reloptions.c.
References build_reloptions(), fb(), fillfactor, lengthof, RELOPT_TYPE_BOOL, RELOPT_TYPE_ENUM, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, RELOPT_TYPE_TERNARY, vacuum_cost_delay, vacuum_cost_limit, vacuum_max_eager_freeze_failure_rate, vacuum_truncate, and validate().
Referenced by heap_reloptions().
| bytea * extractRelOptions | ( | HeapTuple | tuple, |
| TupleDesc | tupdesc, | ||
| amoptions_function | amoptions | ||
| ) |
Definition at line 1488 of file reloptions.c.
References Assert, fastgetattr(), fb(), GETSTRUCT(), heap_reloptions(), index_reloptions(), partitioned_table_reloptions(), and view_reloptions().
Referenced by extract_autovac_opts(), and RelationParseRelOptions().
|
static |
Definition at line 1865 of file reloptions.c.
References elog, ERROR, fb(), i, j, relopt_parse_elt::offset, relopt_parse_elt::optname, PG_TERNARY_UNSET, RELOPT_TYPE_BOOL, RELOPT_TYPE_ENUM, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, RELOPT_TYPE_STRING, RELOPT_TYPE_TERNARY, SET_VARSIZE(), and validate().
Referenced by build_local_reloptions(), and build_reloptions().
Definition at line 2152 of file reloptions.c.
References default_reloptions(), fb(), RELOPT_KIND_HEAP, RELOPT_KIND_TOAST, and validate().
Referenced by ATExecSetRelOptions(), create_ctas_internal(), DefineRelation(), extractRelOptions(), and ProcessUtilitySlow().
| bytea * index_reloptions | ( | amoptions_function | amoptions, |
| Datum | reloptions, | ||
| bool | validate | ||
| ) |
Definition at line 2187 of file reloptions.c.
References Assert, DatumGetPointer(), fb(), and validate().
Referenced by ATExecSetRelOptions(), DefineIndex(), and extractRelOptions().
|
static |
Definition at line 883 of file reloptions.c.
References allocate_reloption(), fb(), name, and RELOPT_TYPE_BOOL.
Referenced by add_bool_reloption(), and add_local_bool_reloption().
|
static |
Definition at line 1089 of file reloptions.c.
References allocate_reloption(), fb(), name, and RELOPT_TYPE_ENUM.
Referenced by add_enum_reloption(), and add_local_enum_reloption().
|
static |
Definition at line 981 of file reloptions.c.
References allocate_reloption(), fb(), max_val, name, and RELOPT_TYPE_INT.
Referenced by add_int_reloption(), and add_local_int_reloption().
| void init_local_reloptions | ( | local_relopts * | relopts, |
| Size | relopt_struct_size | ||
| ) |
Definition at line 782 of file reloptions.c.
Referenced by _ltree_gist_options(), brin_bloom_options(), brin_minmax_multi_options(), g_int_options(), g_intbig_options(), ghstore_options(), gtrgm_options(), gtsvector_options(), index_opclass_options(), and ltree_gist_options().
|
static |
Definition at line 1034 of file reloptions.c.
References allocate_reloption(), fb(), max_val, name, and RELOPT_TYPE_REAL.
Referenced by add_local_real_reloption(), and add_real_reloption().
|
static |
Definition at line 1153 of file reloptions.c.
References allocate_reloption(), fb(), MemoryContextStrdup(), name, RELOPT_KIND_LOCAL, RELOPT_TYPE_STRING, and TopMemoryContext.
Referenced by add_local_string_reloption(), and add_string_reloption().
|
static |
Definition at line 931 of file reloptions.c.
References allocate_reloption(), fb(), name, and RELOPT_TYPE_TERNARY.
Referenced by add_local_ternary_reloption(), and add_ternary_reloption().
Definition at line 613 of file reloptions.c.
References Assert, boolRelOpts, custom_options, DoLockModesConflict(), enumRelOpts, fb(), relopt_bool::gen, relopt_ternary::gen, relopt_int::gen, relopt_real::gen, relopt_enum::gen, relopt_string::gen, i, intRelOpts, j, relopt_gen::lockmode, MemoryContextAlloc(), name, relopt_gen::name, relopt_gen::namelen, need_initialization, num_custom_options, pfree(), realRelOpts, RELOPT_TYPE_BOOL, RELOPT_TYPE_ENUM, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, RELOPT_TYPE_STRING, RELOPT_TYPE_TERNARY, relOpts, stringRelOpts, ternaryRelOpts, TopMemoryContext, and relopt_gen::type.
Referenced by AlterTableGetRelOptionsLockLevel(), and parseRelOptions().
|
static |
Definition at line 1678 of file reloptions.c.
References _, b, elog, ereport, errcode(), errdetail(), errdetail_internal(), errmsg(), ERROR, fb(), option::name, palloc(), parse_bool(), parse_int(), parse_real(), pfree(), pg_strcasecmp(), PG_TERNARY_FALSE, PG_TERNARY_TRUE, RELOPT_TYPE_BOOL, RELOPT_TYPE_ENUM, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, RELOPT_TYPE_STRING, RELOPT_TYPE_TERNARY, validate(), and value.
Referenced by parseRelOptionsInternal().
|
static |
Definition at line 1650 of file reloptions.c.
References fb(), i, lfirst, list_length(), local_relopt::option, palloc_array, parseRelOptionsInternal(), validate(), and values.
Referenced by build_local_reloptions().
|
static |
Definition at line 1608 of file reloptions.c.
References DatumGetPointer(), fb(), relopt_value::gen, i, initialize_reloptions(), relopt_value::isset, j, need_initialization, palloc(), parseRelOptionsInternal(), relOpts, and validate().
Referenced by build_reloptions().
|
static |
Definition at line 1536 of file reloptions.c.
References DatumGetArrayTypeP, DatumGetPointer(), deconstruct_array_builtin(), ereport, errcode(), errmsg(), ERROR, fb(), relopt_value::gen, i, j, relopt_gen::namelen, noptions, parse_one_reloption(), pfree(), TextDatumGetCString, validate(), VARDATA(), VARHDRSZ, and VARSIZE().
Referenced by parseLocalRelOptions(), and parseRelOptions().
Definition at line 2117 of file reloptions.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, fb(), and validate().
Referenced by ATExecSetRelOptions(), DefineRelation(), and extractRelOptions().
| void register_reloptions_validator | ( | local_relopts * | relopts, |
| relopts_validator | validator | ||
| ) |
Definition at line 795 of file reloptions.c.
References fb(), and lappend().
Referenced by ltree_gist_options().
Definition at line 2219 of file reloptions.c.
References build_reloptions(), effective_io_concurrency, fb(), lengthof, maintenance_io_concurrency, random_page_cost, RELOPT_KIND_TABLESPACE, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, seq_page_cost, and validate().
Referenced by AlterTableSpaceOptions(), CreateTableSpace(), and get_tablespace().
| Datum transformRelOptions | ( | Datum | oldOptions, |
| List * | defList, | ||
| const char * | nameSpace, | ||
| const char *const | validnsps[], | ||
| bool | acceptOidsOff, | ||
| bool | isReset | ||
| ) |
Definition at line 1256 of file reloptions.c.
References accumArrayResult(), DefElem::arg, CurrentMemoryContext, DatumGetArrayTypeP, DatumGetPointer(), deconstruct_array_builtin(), defGetBoolean(), defGetString(), DefElem::defname, DefElem::defnamespace, ereport, errcode(), errmsg(), ERROR, fb(), i, len, lfirst, makeArrayResult(), name, NIL, palloc(), PointerGetDatum(), SET_VARSIZE(), sprintf, value, VARDATA(), VARHDRSZ, and VARSIZE().
Referenced by AlterTableSpaceOptions(), ATExecSetOptions(), ATExecSetRelOptions(), ComputeIndexAttrs(), create_ctas_internal(), CreateTableSpace(), DefineIndex(), DefineRelation(), and ProcessUtilitySlow().
Definition at line 1440 of file reloptions.c.
References DatumGetArrayTypeP, DatumGetPointer(), deconstruct_array_builtin(), fb(), i, lappend(), makeDefElem(), makeString(), NIL, noptions, TextDatumGetCString, and val.
Referenced by ATExecSetRelOptions(), dblink_fdw_validator(), file_fdw_validator(), generateClonedIndexStmt(), GetForeignColumnOptions(), GetForeignDataWrapperExtended(), GetForeignServerExtended(), GetForeignTable(), GetUserMapping(), pg_options_to_table(), postgres_fdw_validator(), postgresql_fdw_validator(), and transformGenericOptions().
Definition at line 2131 of file reloptions.c.
References build_reloptions(), fb(), lengthof, RELOPT_KIND_VIEW, RELOPT_TYPE_BOOL, RELOPT_TYPE_ENUM, and validate().
Referenced by ATExecSetRelOptions(), DefineRelation(), and extractRelOptions().
|
static |
Definition at line 98 of file reloptions.c.
Referenced by initialize_reloptions().
|
static |
Definition at line 590 of file reloptions.c.
Referenced by add_reloption(), and initialize_reloptions().
|
static |
Definition at line 541 of file reloptions.c.
Referenced by initialize_reloptions().
|
static |
Definition at line 524 of file reloptions.c.
|
static |
Definition at line 186 of file reloptions.c.
Referenced by initialize_reloptions().
|
static |
Definition at line 587 of file reloptions.c.
Referenced by add_reloption_kind().
Definition at line 591 of file reloptions.c.
Referenced by add_reloption(), AlterTableGetRelOptionsLockLevel(), initialize_reloptions(), and parseRelOptions().
|
static |
Definition at line 589 of file reloptions.c.
Referenced by add_reloption(), and initialize_reloptions().
|
static |
Definition at line 411 of file reloptions.c.
Referenced by initialize_reloptions().
|
static |
Definition at line 586 of file reloptions.c.
Referenced by AlterTableGetRelOptionsLockLevel(), initialize_reloptions(), and parseRelOptions().
|
static |
Definition at line 509 of file reloptions.c.
|
static |
Definition at line 580 of file reloptions.c.
Referenced by initialize_reloptions().
|
static |
Definition at line 168 of file reloptions.c.
Referenced by initialize_reloptions().
|
static |
Definition at line 533 of file reloptions.c.