99 "Enables automatic summarization on this BRIN index",
107 "autovacuum_enabled",
108 "Enables autovacuum in this relation",
116 "user_catalog_table",
117 "Declare a table as an additional catalog table, e.g. for the purpose of logical replication",
126 "Enables \"fast update\" feature for this GIN index",
135 "View acts as a row security barrier",
144 "Privileges on underlying relations are checked as the invoking user, not the view owner",
153 "Enables vacuum to truncate empty pages at the end of this table",
162 "Enables \"deduplicate items\" feature for this btree index",
178 "Packs table pages only to this percentage",
188 "Packs btree index pages only to this percentage",
198 "Packs hash index pages only to this percentage",
208 "Packs gist index pages only to this percentage",
218 "Packs spgist index pages only to this percentage",
227 "autovacuum_vacuum_threshold",
228 "Minimum number of tuple updates or deletes prior to vacuum",
236 "autovacuum_vacuum_max_threshold",
237 "Maximum number of tuple updates or deletes prior to vacuum",
245 "autovacuum_vacuum_insert_threshold",
246 "Minimum number of tuple inserts prior to vacuum, or -1 to disable insert vacuums",
254 "autovacuum_analyze_threshold",
255 "Minimum number of tuple inserts, updates or deletes prior to analyze",
263 "autovacuum_vacuum_cost_limit",
264 "Vacuum cost amount available before napping, for autovacuum",
272 "autovacuum_freeze_min_age",
273 "Minimum age at which VACUUM should freeze a table row, for autovacuum",
281 "autovacuum_multixact_freeze_min_age",
282 "Minimum multixact age at which VACUUM should freeze a row multixact's, for autovacuum",
290 "autovacuum_freeze_max_age",
291 "Age at which to autovacuum a table to prevent transaction ID wraparound",
295 -1, 100000, 2000000000
299 "autovacuum_multixact_freeze_max_age",
300 "Multixact age at which to autovacuum a table to prevent multixact wraparound",
304 -1, 10000, 2000000000
308 "autovacuum_freeze_table_age",
309 "Age at which VACUUM should perform a full table sweep to freeze row versions",
316 "autovacuum_multixact_freeze_table_age",
317 "Age of multixact at which VACUUM should perform a full table sweep to freeze row versions",
324 "log_autovacuum_min_duration",
325 "Sets the minimum execution time above which vacuum actions by autovacuum will be logged",
333 "log_autoanalyze_min_duration",
334 "Sets the minimum execution time above which analyze actions by autovacuum will be logged",
342 "toast_tuple_target",
343 "Sets the target tuple length at which external columns will be toasted",
352 "Number of pages that each page range covers in a BRIN index",
359 "gin_pending_list_limit",
360 "Maximum size of the pending list for this GIN index, in kilobytes.",
368 "effective_io_concurrency",
369 "Number of simultaneous requests that can be handled efficiently by the disk subsystem.",
377 "maintenance_io_concurrency",
378 "Number of simultaneous requests that can be handled efficiently by the disk subsystem for maintenance work.",
387 "Number of parallel processes that can be used per executor node for this relation.",
402 "autovacuum_vacuum_cost_delay",
403 "Vacuum cost delay in milliseconds, for autovacuum",
411 "autovacuum_vacuum_scale_factor",
412 "Number of tuple updates or deletes prior to vacuum as a fraction of reltuples",
420 "autovacuum_vacuum_insert_scale_factor",
421 "Number of tuple inserts prior to vacuum as a fraction of reltuples",
429 "autovacuum_analyze_scale_factor",
430 "Number of tuple inserts, updates or deletes prior to analyze as a fraction of reltuples",
438 "vacuum_max_eager_freeze_failure_rate",
439 "Fraction of pages in a relation vacuum can scan and fail to freeze before disabling eager scanning.",
449 "Sets the planner's estimate of the cost of a sequentially fetched disk page.",
458 "Sets the planner's estimate of the cost of a nonsequentially fetched disk page.",
467 "Sets the planner's estimate of the number of distinct values appearing in a column (excluding child relations).",
475 "n_distinct_inherited",
476 "Sets the planner's estimate of the number of distinct values appearing in a column (including child relations).",
484 "vacuum_cleanup_index_scale_factor",
485 "Deprecated B-Tree parameter.",
507 {(
const char *) NULL}
516 {(
const char *) NULL}
525 {(
const char *) NULL}
532 "vacuum_index_cleanup",
533 "Controls index vacuuming and index cleanup",
539 gettext_noop(
"Valid values are \"on\", \"off\", and \"auto\".")
544 "Enables buffering build for this GiST index",
550 gettext_noop(
"Valid values are \"on\", \"off\", and \"auto\".")
555 "View has WITH CHECK OPTION defined (local or cascaded).",
561 gettext_noop(
"Valid values are \"local\" and \"cascaded\".")
589#define GET_STRING_RELOPTION_LEN(option) \
590 ((option).isset ? strlen((option).values.string_val) : \
591 ((relopt_string *) (option).gen)->default_len)
708 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
709 errmsg(
"user-defined relation parameter types limit exceeded")));
722 static int max_custom_options = 0;
730 if (max_custom_options == 0)
732 max_custom_options = 8;
737 max_custom_options *= 2;
781 Assert(offset < relopts->relopt_struct_size);
835 newoption->
desc = NULL;
836 newoption->
kinds = kinds;
853 bool default_val,
LOCKMODE lockmode)
858 name, desc, lockmode);
870 bool default_val,
LOCKMODE lockmode)
873 default_val, lockmode);
886 const char *desc,
bool default_val,
int offset)
902 int default_val,
int min_val,
int max_val,
908 name, desc, lockmode);
910 newoption->
min = min_val;
925 default_val, min_val,
939 const char *desc,
int default_val,
int min_val,
943 name, desc, default_val,
955 double default_val,
double min_val,
double max_val,
961 name, desc, lockmode);
963 newoption->
min = min_val;
975 double default_val,
double min_val,
double max_val,
979 default_val, min_val,
993 const char *desc,
double default_val,
994 double min_val,
double max_val,
int offset)
998 default_val, min_val,
1011 const char *detailmsg,
LOCKMODE lockmode)
1016 name, desc, lockmode);
1040 const char *detailmsg,
LOCKMODE lockmode)
1043 members, default_val,
1044 detailmsg, lockmode);
1058 int default_val,
const char *detailmsg,
int offset)
1062 members, default_val,
1074 const char *default_val,
1083 (validator) (default_val);
1086 name, desc, lockmode);
1139 const char *desc,
const char *default_val,
1177 const char *
const validnsps[],
bool acceptOidsOff,
bool isReset)
1200 for (
i = 0;
i < noldoptions;
i++)
1206 foreach(cell, defList)
1212 if (nameSpace == NULL)
1222 kw_len = strlen(def->
defname);
1223 if (text_len > kw_len && text_str[kw_len] ==
'=' &&
1224 strncmp(text_str, def->
defname, kw_len) == 0)
1242 foreach(cell, defList)
1248 if (def->
arg != NULL)
1250 (
errcode(ERRCODE_SYNTAX_ERROR),
1251 errmsg(
"RESET must not include values for parameters")));
1271 for (
i = 0; validnsps[
i];
i++)
1283 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1284 errmsg(
"unrecognized parameter namespace \"%s\"",
1289 if (nameSpace == NULL)
1305 if (def->
arg != NULL)
1311 if (strchr(
name,
'=') != NULL)
1313 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1314 errmsg(
"invalid option name \"%s\": must not contain \"=\"",
1324 strcmp(
name,
"oids") == 0)
1328 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1329 errmsg(
"tables declared WITH OIDS are not supported")));
1364 Datum *optiondatums;
1417 Anum_pg_class_reloptions,
1426 switch (classForm->relkind)
1428 case RELKIND_RELATION:
1429 case RELKIND_TOASTVALUE:
1430 case RELKIND_MATVIEW:
1433 case RELKIND_PARTITIONED_TABLE:
1440 case RELKIND_PARTITIONED_INDEX:
1443 case RELKIND_FOREIGN_TABLE:
1460 Datum *optiondatums;
1473 for (
j = 0;
j < numoptions;
j++)
1477 if (text_len > kw_len && text_str[kw_len] ==
'=' &&
1478 strncmp(text_str, reloptions[
j].gen->name, kw_len) == 0)
1496 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1497 errmsg(
"unrecognized parameter \"%s\"", s)));
1502 pfree(optiondatums);
1554 reloptions[
j].
isset =
false;
1564 *numrelopts = numoptions;
1604 bool nofree =
false;
1608 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1609 errmsg(
"parameter \"%s\" specified more than once",
1612 value_len = text_len -
option->gen->namelen - 1;
1614 memcpy(
value, text_str +
option->gen->namelen + 1, value_len);
1615 value[value_len] =
'\0';
1617 switch (
option->gen->type)
1624 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1625 errmsg(
"invalid value for boolean option \"%s\": %s",
1636 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1637 errmsg(
"invalid value for integer option \"%s\": %s",
1642 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1643 errmsg(
"value %s out of bounds for option \"%s\"",
1645 errdetail(
"Valid values are between \"%d\" and \"%d\".",
1646 optint->
min, optint->
max)));
1656 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1657 errmsg(
"invalid value for floating point option \"%s\": %s",
1660 option->values.real_val > optreal->
max))
1662 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1663 errmsg(
"value %s out of bounds for option \"%s\"",
1665 errdetail(
"Valid values are between \"%f\" and \"%f\".",
1666 optreal->
min, optreal->
max)));
1679 option->values.enum_val = elt->symbol_val;
1686 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1687 errmsg(
"invalid value for enum option \"%s\": %s",
1736 for (
i = 0;
i < numoptions;
i++)
1777 int offset = basesize;
1779 for (
i = 0;
i < numoptions;
i++)
1784 for (
j = 0;
j < numelems;
j++)
1789 char *itempos = ((
char *) rdopts) + elems[
j].
offset;
1796 if (elems[
j].isset_offset > 0)
1800 *(
bool *) setpos =
options[
i].isset;
1806 *(
bool *) itempos =
options[
i].isset ?
1811 *(
int *) itempos =
options[
i].isset ?
1816 *(
double *) itempos =
options[
i].isset ?
1821 *(
int *) itempos =
options[
i].isset ?
1828 string_val =
options[
i].values.string_val;
1837 optstring->
fill_cb(string_val,
1838 (
char *) rdopts + offset);
1842 *(
int *) itempos = offset;
1846 *(
int *) itempos = 0;
1848 else if (string_val == NULL)
1849 *(
int *) itempos = 0;
1852 strcpy((
char *) rdopts + offset, string_val);
1853 *(
int *) itempos = offset;
1854 offset += strlen(string_val) + 1;
1858 elog(
ERROR,
"unsupported reloption type %d",
1867 elog(
ERROR,
"reloption \"%s\" not found in parse table",
1956 Size relopt_struct_size,
1958 int num_relopt_elems)
1966 Assert(numoptions <= num_relopt_elems);
1969 if (numoptions == 0)
1978 validate, relopt_elems, num_relopt_elems);
2035 errcode(ERRCODE_WRONG_OBJECT_TYPE),
2036 errmsg(
"cannot specify storage parameters for a partitioned table"),
2037 errhint(
"Specify storage parameters for its leaf partitions instead."));
2072 case RELKIND_TOASTVALUE:
2082 return (
bytea *) rdopts;
2083 case RELKIND_RELATION:
2084 case RELKIND_MATVIEW:
2103 Assert(amoptions != NULL);
2109 return amoptions(reloptions,
validate);
2166 foreach(cell, defList)
2177 if (lockmode <
relOpts[
i]->lockmode)
bytea *(* amoptions_function)(Datum reloptions, bool validate)
#define DatumGetArrayTypeP(X)
ArrayBuildState * accumArrayResult(ArrayBuildState *astate, Datum dvalue, bool disnull, Oid element_type, MemoryContext rcontext)
void deconstruct_array_builtin(const ArrayType *array, Oid elmtype, Datum **elemsp, bool **nullsp, int *nelemsp)
Datum makeArrayResult(ArrayBuildState *astate, MemoryContext rcontext)
static bool validate(Port *port, const char *auth)
bool parse_bool(const char *value, bool *result)
static Datum values[MAXATTR]
int maintenance_io_concurrency
int effective_io_concurrency
#define MAX_IO_CONCURRENCY
#define TextDatumGetCString(d)
char * defGetString(DefElem *def)
bool defGetBoolean(DefElem *def)
int errdetail_internal(const char *fmt,...)
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
@ GIST_OPTION_BUFFERING_OFF
@ GIST_OPTION_BUFFERING_AUTO
@ GIST_OPTION_BUFFERING_ON
#define GIST_MIN_FILLFACTOR
#define GIST_DEFAULT_FILLFACTOR
bool parse_int(const char *value, int *result, int flags, const char **hintmsg)
bool parse_real(const char *value, double *result, int flags, const char **hintmsg)
#define HASH_DEFAULT_FILLFACTOR
#define HASH_MIN_FILLFACTOR
Assert(PointerIsAligned(start, uint64))
#define TOAST_TUPLE_TARGET
#define TOAST_TUPLE_TARGET_MAIN
static void * GETSTRUCT(const HeapTupleData *tuple)
static Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
if(TABLE==NULL||TABLE_index==NULL)
List * lappend(List *list, void *datum)
bool DoLockModesConflict(LOCKMODE mode1, LOCKMODE mode2)
#define AccessExclusiveLock
#define ShareUpdateExclusiveLock
DefElem * makeDefElem(char *name, Node *arg, int location)
char * MemoryContextStrdup(MemoryContext context, const char *string)
void * MemoryContextAlloc(MemoryContext context, Size size)
char * pstrdup(const char *in)
void * repalloc(void *pointer, Size size)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext TopMemoryContext
MemoryContext CurrentMemoryContext
#define BTREE_MIN_FILLFACTOR
#define BTREE_DEFAULT_FILLFACTOR
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static AmcheckOptions opts
FormData_pg_class * Form_pg_class
static int list_length(const List *l)
int pg_strcasecmp(const char *s1, const char *s2)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
#define HEAP_MIN_FILLFACTOR
@ VIEW_OPTION_CHECK_OPTION_NOT_SET
@ VIEW_OPTION_CHECK_OPTION_LOCAL
@ VIEW_OPTION_CHECK_OPTION_CASCADED
#define HEAP_DEFAULT_FILLFACTOR
@ STDRD_OPTION_VACUUM_INDEX_CLEANUP_AUTO
@ STDRD_OPTION_VACUUM_INDEX_CLEANUP_OFF
@ STDRD_OPTION_VACUUM_INDEX_CLEANUP_ON
static relopt_string * init_string_reloption(bits32 kinds, const char *name, const char *desc, const char *default_val, validate_string_relopt validator, fill_string_relopt filler, LOCKMODE lockmode)
static int num_custom_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)
static relopt_real realRelOpts[]
void add_int_reloption(bits32 kinds, const char *name, const char *desc, int default_val, int min_val, int max_val, LOCKMODE lockmode)
static relopt_enum_elt_def gistBufferingOptValues[]
bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind)
static relopt_value * parseLocalRelOptions(local_relopts *relopts, Datum options, bool validate)
bytea * tablespace_reloptions(Datum reloptions, bool validate)
static relopt_enum_elt_def StdRdOptIndexCleanupValues[]
#define GET_STRING_RELOPTION_LEN(option)
void add_string_reloption(bits32 kinds, const char *name, const char *desc, const char *default_val, validate_string_relopt validator, LOCKMODE lockmode)
List * untransformRelOptions(Datum options)
static relopt_int intRelOpts[]
static relopt_enum enumRelOpts[]
static void parse_one_reloption(relopt_value *option, char *text_str, int text_len, bool validate)
static relopt_string stringRelOpts[]
bytea * view_reloptions(Datum reloptions, bool validate)
static relopt_int * init_int_reloption(bits32 kinds, const char *name, const char *desc, int default_val, int min_val, int max_val, LOCKMODE lockmode)
bytea * index_reloptions(amoptions_function amoptions, Datum reloptions, bool validate)
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 * build_reloptions(Datum reloptions, bool validate, relopt_kind kind, Size relopt_struct_size, const relopt_parse_elt *relopt_elems, int num_relopt_elems)
bytea * partitioned_table_reloptions(Datum reloptions, bool validate)
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_local_bool_reloption(local_relopts *relopts, const char *name, const char *desc, bool default_val, int offset)
void init_local_reloptions(local_relopts *relopts, Size relopt_struct_size)
static relopt_enum_elt_def viewCheckOptValues[]
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)
static void add_reloption(relopt_gen *newoption)
static void add_local_reloption(local_relopts *relopts, relopt_gen *newoption, int offset)
void add_bool_reloption(bits32 kinds, const char *name, const char *desc, bool default_val, LOCKMODE lockmode)
Datum transformRelOptions(Datum oldOptions, List *defList, const char *nameSpace, const char *const validnsps[], bool acceptOidsOff, bool isReset)
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)
bytea * extractRelOptions(HeapTuple tuple, TupleDesc tupdesc, amoptions_function amoptions)
static void parseRelOptionsInternal(Datum options, bool validate, relopt_value *reloptions, int numoptions)
static void fillRelOptions(void *rdopts, Size basesize, relopt_value *options, int numoptions, bool validate, const relopt_parse_elt *elems, int numelems)
static relopt_enum * init_enum_reloption(bits32 kinds, const char *name, const char *desc, relopt_enum_elt_def *members, int default_val, const char *detailmsg, LOCKMODE lockmode)
static void initialize_reloptions(void)
relopt_kind add_reloption_kind(void)
void * build_local_reloptions(local_relopts *relopts, Datum options, bool validate)
void register_reloptions_validator(local_relopts *relopts, relopts_validator validator)
static bool need_initialization
static relopt_value * parseRelOptions(Datum options, bool validate, relopt_kind kind, int *numrelopts)
static relopt_bool * init_bool_reloption(bits32 kinds, const char *name, const char *desc, bool default_val, LOCKMODE lockmode)
static relopt_gen ** relOpts
static relopt_gen ** custom_options
LOCKMODE AlterTableGetRelOptionsLockLevel(List *defList)
static relopt_real * init_real_reloption(bits32 kinds, const char *name, const char *desc, double default_val, double min_val, double max_val, LOCKMODE lockmode)
bytea * attribute_reloptions(Datum reloptions, bool validate)
static relopt_gen * allocate_reloption(bits32 kinds, int type, const char *name, const char *desc, LOCKMODE lockmode)
static relopt_bool boolRelOpts[]
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)
static void * allocateReloptStruct(Size base, relopt_value *options, int numoptions)
static bits32 last_assigned_kind
bytea * heap_reloptions(char relkind, Datum reloptions, bool validate)
struct relopt_real relopt_real
Size(* fill_string_relopt)(const char *value, void *ptr)
struct relopt_bool relopt_bool
@ RELOPT_KIND_LAST_DEFAULT
struct relopt_string relopt_string
void(* validate_string_relopt)(const char *value)
struct relopt_enum relopt_enum
void(* relopts_validator)(void *parsed_options, relopt_value *vals, int nvals)
struct relopt_int relopt_int
#define SPGIST_DEFAULT_FILLFACTOR
#define SPGIST_MIN_FILLFACTOR
float8 analyze_scale_factor
relopt_enum_elt_def * members
validate_string_relopt validate_cb
fill_string_relopt fill_cb
union relopt_value::@52 values
double vacuum_max_eager_freeze_failure_rate
String * makeString(char *str)
static Size VARSIZE(const void *PTR)
static char * VARDATA(const void *PTR)
static void SET_VARSIZE(void *PTR, Size len)