PostgreSQL Source Code
git master
|
#include "access/amapi.h"
#include "access/htup.h"
#include "access/tupdesc.h"
#include "nodes/pg_list.h"
#include "storage/lock.h"
Go to the source code of this file.
Data Structures | |
struct | relopt_gen |
struct | relopt_value |
struct | relopt_bool |
struct | relopt_int |
struct | relopt_real |
struct | relopt_enum_elt_def |
struct | relopt_enum |
struct | relopt_string |
struct | relopt_parse_elt |
struct | local_relopt |
struct | local_relopts |
Macros | |
#define | HEAP_RELOPT_NAMESPACES { "toast", NULL } |
#define | GET_STRING_RELOPTION(optstruct, member) |
Typedefs | |
typedef enum relopt_type | relopt_type |
typedef enum relopt_kind | relopt_kind |
typedef struct relopt_gen | relopt_gen |
typedef struct relopt_value | relopt_value |
typedef struct relopt_bool | relopt_bool |
typedef struct relopt_int | relopt_int |
typedef struct relopt_real | relopt_real |
typedef struct relopt_enum_elt_def | relopt_enum_elt_def |
typedef struct relopt_enum | relopt_enum |
typedef void(* | validate_string_relopt) (const char *value) |
typedef Size(* | fill_string_relopt) (const char *value, void *ptr) |
typedef void(* | relopts_validator) (void *parsed_options, relopt_value *vals, int nvals) |
typedef struct relopt_string | relopt_string |
typedef struct local_relopt | local_relopt |
typedef struct local_relopts | local_relopts |
Enumerations | |
enum | relopt_type { RELOPT_TYPE_BOOL , RELOPT_TYPE_INT , RELOPT_TYPE_REAL , RELOPT_TYPE_ENUM , RELOPT_TYPE_STRING } |
enum | relopt_kind { RELOPT_KIND_LOCAL = 0 , RELOPT_KIND_HEAP = (1 << 0) , RELOPT_KIND_TOAST = (1 << 1) , RELOPT_KIND_BTREE = (1 << 2) , RELOPT_KIND_HASH = (1 << 3) , RELOPT_KIND_GIN = (1 << 4) , RELOPT_KIND_GIST = (1 << 5) , RELOPT_KIND_ATTRIBUTE = (1 << 6) , RELOPT_KIND_TABLESPACE = (1 << 7) , RELOPT_KIND_SPGIST = (1 << 8) , RELOPT_KIND_VIEW = (1 << 9) , RELOPT_KIND_BRIN = (1 << 10) , RELOPT_KIND_PARTITIONED = (1 << 11) , RELOPT_KIND_LAST_DEFAULT = RELOPT_KIND_PARTITIONED , RELOPT_KIND_MAX = (1 << 30) } |
Functions | |
relopt_kind | add_reloption_kind (void) |
void | add_bool_reloption (bits32 kinds, const char *name, const char *desc, bool default_val, LOCKMODE lockmode) |
void | add_int_reloption (bits32 kinds, const char *name, const char *desc, int default_val, int min_val, int max_val, LOCKMODE lockmode) |
void | add_real_reloption (bits32 kinds, const char *name, const char *desc, double default_val, double min_val, double max_val, LOCKMODE lockmode) |
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) |
void | add_string_reloption (bits32 kinds, const char *name, const char *desc, const char *default_val, validate_string_relopt validator, LOCKMODE lockmode) |
void | init_local_reloptions (local_relopts *relopts, Size relopt_struct_size) |
void | register_reloptions_validator (local_relopts *relopts, relopts_validator validator) |
void | add_local_bool_reloption (local_relopts *relopts, const char *name, const char *desc, bool default_val, int offset) |
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) |
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) |
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) |
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) |
Datum | transformRelOptions (Datum oldOptions, List *defList, const char *namspace, const char *const validnsps[], bool acceptOidsOff, bool isReset) |
List * | untransformRelOptions (Datum options) |
bytea * | extractRelOptions (HeapTuple tuple, TupleDesc tupdesc, amoptions_function amoptions) |
void * | build_reloptions (Datum reloptions, bool validate, relopt_kind kind, Size relopt_struct_size, const relopt_parse_elt *relopt_elems, int num_relopt_elems) |
void * | build_local_reloptions (local_relopts *relopts, Datum options, bool validate) |
bytea * | default_reloptions (Datum reloptions, bool validate, relopt_kind kind) |
bytea * | heap_reloptions (char relkind, Datum reloptions, bool validate) |
bytea * | view_reloptions (Datum reloptions, bool validate) |
bytea * | partitioned_table_reloptions (Datum reloptions, bool validate) |
bytea * | index_reloptions (amoptions_function amoptions, Datum reloptions, bool validate) |
bytea * | attribute_reloptions (Datum reloptions, bool validate) |
bytea * | tablespace_reloptions (Datum reloptions, bool validate) |
LOCKMODE | AlterTableGetRelOptionsLockLevel (List *defList) |
#define GET_STRING_RELOPTION | ( | optstruct, | |
member | |||
) |
Definition at line 178 of file reloptions.h.
#define HEAP_RELOPT_NAMESPACES { "toast", NULL } |
Definition at line 61 of file reloptions.h.
Definition at line 134 of file reloptions.h.
typedef struct local_relopt local_relopt |
typedef struct local_relopts local_relopts |
typedef struct relopt_bool relopt_bool |
typedef struct relopt_enum relopt_enum |
typedef struct relopt_enum_elt_def relopt_enum_elt_def |
typedef struct relopt_gen relopt_gen |
typedef struct relopt_int relopt_int |
typedef enum relopt_kind relopt_kind |
typedef struct relopt_real relopt_real |
typedef struct relopt_string relopt_string |
typedef enum relopt_type relopt_type |
typedef struct relopt_value relopt_value |
typedef void(* relopts_validator) (void *parsed_options, relopt_value *vals, int nvals) |
Definition at line 137 of file reloptions.h.
typedef void(* validate_string_relopt) (const char *value) |
Definition at line 133 of file reloptions.h.
enum relopt_kind |
Definition at line 39 of file reloptions.h.
enum relopt_type |
Enumerator | |
---|---|
RELOPT_TYPE_BOOL | |
RELOPT_TYPE_INT | |
RELOPT_TYPE_REAL | |
RELOPT_TYPE_ENUM | |
RELOPT_TYPE_STRING |
Definition at line 29 of file reloptions.h.
void add_bool_reloption | ( | bits32 | kinds, |
const char * | name, | ||
const char * | desc, | ||
bool | default_val, | ||
LOCKMODE | lockmode | ||
) |
Definition at line 849 of file reloptions.c.
References add_reloption(), 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 1018 of file reloptions.c.
References add_reloption(), 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 901 of file reloptions.c.
References add_reloption(), 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 865 of file reloptions.c.
References add_local_reloption(), 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 1036 of file reloptions.c.
References add_local_reloption(), 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 918 of file reloptions.c.
References add_local_reloption(), 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 972 of file reloptions.c.
References add_local_reloption(), init_real_reloption(), max_val, name, and RELOPT_KIND_LOCAL.
Referenced by brin_bloom_options().
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 1118 of file reloptions.c.
References add_local_reloption(), init_string_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 954 of file reloptions.c.
References add_reloption(), init_real_reloption(), max_val, and name.
Referenced by create_reloptions_table().
relopt_kind add_reloption_kind | ( | void | ) |
Definition at line 683 of file reloptions.c.
References ereport, errcode(), errmsg(), ERROR, 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 1098 of file reloptions.c.
References add_reloption(), init_string_reloption(), and name.
Referenced by create_reloptions_table().
Definition at line 2108 of file reloptions.c.
References AccessExclusiveLock, DefElem::defname, i, initialize_reloptions(), lfirst, relopt_gen::lockmode, name, relopt_gen::namelen, need_initialization, NIL, NoLock, and relOpts.
Referenced by AlterTableGetLockLevel().
Definition at line 2069 of file reloptions.c.
References build_reloptions(), lengthof, RELOPT_KIND_ATTRIBUTE, and RELOPT_TYPE_REAL.
Referenced by ATExecSetOptions(), and get_attribute_options().
void* build_local_reloptions | ( | local_relopts * | relopts, |
Datum | options, | ||
bool | validate | ||
) |
Definition at line 1945 of file reloptions.c.
References allocateReloptStruct(), fillRelOptions(), i, lfirst, list_length(), relopt_gen::name, noptions, relopt_parse_elt::offset, local_relopt::offset, local_relopt::option, local_relopts::options, relopt_parse_elt::optname, opts, relopt_parse_elt::opttype, palloc(), parseLocalRelOptions(), pfree(), local_relopts::relopt_struct_size, relopt_gen::type, and local_relopts::validators.
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 1908 of file reloptions.c.
References allocateReloptStruct(), Assert, fillRelOptions(), options, parseRelOptions(), and pfree().
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 1838 of file reloptions.c.
References build_reloptions(), fillfactor, lengthof, RELOPT_TYPE_BOOL, RELOPT_TYPE_ENUM, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, vacuum_cost_delay, and vacuum_cost_limit.
Referenced by heap_reloptions().
bytea* extractRelOptions | ( | HeapTuple | tuple, |
TupleDesc | tupdesc, | ||
amoptions_function | amoptions | ||
) |
Definition at line 1379 of file reloptions.c.
References Assert, fastgetattr(), GETSTRUCT, heap_reloptions(), index_reloptions(), options, partitioned_table_reloptions(), and view_reloptions().
Referenced by extract_autovac_opts(), and RelationParseRelOptions().
Definition at line 2019 of file reloptions.c.
References AutoVacOpts::analyze_scale_factor, AutoVacOpts::analyze_threshold, StdRdOptions::autovacuum, default_reloptions(), StdRdOptions::fillfactor, RELOPT_KIND_HEAP, and RELOPT_KIND_TOAST.
Referenced by ATExecSetRelOptions(), create_ctas_internal(), DefineRelation(), extractRelOptions(), and ProcessUtilitySlow().
bytea* index_reloptions | ( | amoptions_function | amoptions, |
Datum | reloptions, | ||
bool | validate | ||
) |
Definition at line 2054 of file reloptions.c.
References Assert, DatumGetPointer(), and PointerIsValid.
Referenced by ATExecSetRelOptions(), DefineIndex(), and extractRelOptions().
void init_local_reloptions | ( | local_relopts * | relopts, |
Size | relopt_struct_size | ||
) |
Definition at line 734 of file reloptions.c.
References NIL, local_relopts::options, local_relopts::relopt_struct_size, and local_relopts::validators.
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().
Definition at line 1984 of file reloptions.c.
References ereport, errcode(), errhint(), errmsg(), and ERROR.
Referenced by ATExecSetRelOptions(), DefineRelation(), and extractRelOptions().
void register_reloptions_validator | ( | local_relopts * | relopts, |
relopts_validator | validator | ||
) |
Definition at line 747 of file reloptions.c.
References lappend(), and local_relopts::validators.
Referenced by ltree_gist_options().
Definition at line 2086 of file reloptions.c.
References build_reloptions(), effective_io_concurrency, lengthof, maintenance_io_concurrency, random_page_cost, RELOPT_KIND_TABLESPACE, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, and seq_page_cost.
Referenced by AlterTableSpaceOptions(), CreateTableSpace(), and get_tablespace().
Datum transformRelOptions | ( | Datum | oldOptions, |
List * | defList, | ||
const char * | namspace, | ||
const char *const | validnsps[], | ||
bool | acceptOidsOff, | ||
bool | isReset | ||
) |
Definition at line 1156 of file reloptions.c.
References accumArrayResult(), DefElem::arg, CurrentMemoryContext, DatumGetArrayTypeP, DatumGetPointer(), deconstruct_array_builtin(), defGetBoolean(), defGetString(), DefElem::defname, DefElem::defnamespace, ereport, errcode(), errmsg(), ERROR, i, len, lfirst, makeArrayResult(), NIL, palloc(), PointerGetDatum(), PointerIsValid, 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 1331 of file reloptions.c.
References DatumGetArrayTypeP, DatumGetPointer(), deconstruct_array_builtin(), i, lappend(), makeDefElem(), makeString(), NIL, noptions, PointerIsValid, TextDatumGetCString, and val.
Referenced by ATExecSetRelOptions(), dblink_fdw_validator(), file_fdw_validator(), generateClonedIndexStmt(), GetForeignColumnOptions(), GetForeignDataWrapperExtended(), GetForeignServerExtended(), GetForeignTable(), GetUserMapping(), postgres_fdw_validator(), postgresql_fdw_validator(), and transformGenericOptions().
Definition at line 1998 of file reloptions.c.
References build_reloptions(), lengthof, RELOPT_KIND_VIEW, RELOPT_TYPE_BOOL, and RELOPT_TYPE_ENUM.
Referenced by ATExecSetRelOptions(), DefineRelation(), and extractRelOptions().