101 "Enables automatic summarization on this BRIN index",
109 "autovacuum_enabled",
110 "Enables autovacuum in this relation",
118 "user_catalog_table",
119 "Declare a table as an additional catalog table, e.g. for the purpose of logical replication",
128 "Enables \"fast update\" feature for this GIN index",
137 "View acts as a row security barrier",
146 "Privileges on underlying relations are checked as the invoking user, not the view owner",
155 "Enables vacuum to truncate empty pages at the end of this table",
164 "Enables \"deduplicate items\" feature for this btree index",
180 "Packs table pages only to this percentage",
190 "Packs btree index pages only to this percentage",
200 "Packs hash index pages only to this percentage",
210 "Packs gist index pages only to this percentage",
220 "Packs spgist index pages only to this percentage",
229 "autovacuum_vacuum_threshold",
230 "Minimum number of tuple updates or deletes prior to vacuum",
238 "autovacuum_vacuum_insert_threshold",
239 "Minimum number of tuple inserts prior to vacuum, or -1 to disable insert vacuums",
247 "autovacuum_analyze_threshold",
248 "Minimum number of tuple inserts, updates or deletes prior to analyze",
256 "autovacuum_vacuum_cost_limit",
257 "Vacuum cost amount available before napping, for autovacuum",
265 "autovacuum_freeze_min_age",
266 "Minimum age at which VACUUM should freeze a table row, for autovacuum",
274 "autovacuum_multixact_freeze_min_age",
275 "Minimum multixact age at which VACUUM should freeze a row multixact's, for autovacuum",
283 "autovacuum_freeze_max_age",
284 "Age at which to autovacuum a table to prevent transaction ID wraparound",
288 -1, 100000, 2000000000
292 "autovacuum_multixact_freeze_max_age",
293 "Multixact age at which to autovacuum a table to prevent multixact wraparound",
297 -1, 10000, 2000000000
301 "autovacuum_freeze_table_age",
302 "Age at which VACUUM should perform a full table sweep to freeze row versions",
309 "autovacuum_multixact_freeze_table_age",
310 "Age of multixact at which VACUUM should perform a full table sweep to freeze row versions",
317 "log_autovacuum_min_duration",
318 "Sets the minimum execution time above which autovacuum actions will be logged",
326 "toast_tuple_target",
327 "Sets the target tuple length at which external columns will be toasted",
336 "Number of pages that each page range covers in a BRIN index",
343 "gin_pending_list_limit",
344 "Maximum size of the pending list for this GIN index, in kilobytes.",
352 "effective_io_concurrency",
353 "Number of simultaneous requests that can be handled efficiently by the disk subsystem.",
365 "maintenance_io_concurrency",
366 "Number of simultaneous requests that can be handled efficiently by the disk subsystem for maintenance work.",
379 "Number of parallel processes that can be used per executor node for this relation.",
394 "autovacuum_vacuum_cost_delay",
395 "Vacuum cost delay in milliseconds, for autovacuum",
403 "autovacuum_vacuum_scale_factor",
404 "Number of tuple updates or deletes prior to vacuum as a fraction of reltuples",
412 "autovacuum_vacuum_insert_scale_factor",
413 "Number of tuple inserts prior to vacuum as a fraction of reltuples",
421 "autovacuum_analyze_scale_factor",
422 "Number of tuple inserts, updates or deletes prior to analyze as a fraction of reltuples",
431 "Sets the planner's estimate of the cost of a sequentially fetched disk page.",
440 "Sets the planner's estimate of the cost of a nonsequentially fetched disk page.",
449 "Sets the planner's estimate of the number of distinct values appearing in a column (excluding child relations).",
457 "n_distinct_inherited",
458 "Sets the planner's estimate of the number of distinct values appearing in a column (including child relations).",
466 "vacuum_cleanup_index_scale_factor",
467 "Deprecated B-Tree parameter.",
489 {(
const char *) NULL}
498 {(
const char *) NULL}
507 {(
const char *) NULL}
514 "vacuum_index_cleanup",
515 "Controls index vacuuming and index cleanup",
521 gettext_noop(
"Valid values are \"on\", \"off\", and \"auto\".")
526 "Enables buffering build for this GiST index",
532 gettext_noop(
"Valid values are \"on\", \"off\", and \"auto\".")
537 "View has WITH CHECK OPTION defined (local or cascaded).",
543 gettext_noop(
"Valid values are \"local\" and \"cascaded\".")
564 int text_len,
bool validate);
571 #define GET_STRING_RELOPTION_LEN(option) \
572 ((option).isset ? strlen((option).values.string_val) : \
573 ((relopt_string *) (option).gen)->default_len)
690 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
691 errmsg(
"user-defined relation parameter types limit exceeded")));
704 static int max_custom_options = 0;
712 if (max_custom_options == 0)
714 max_custom_options = 8;
719 max_custom_options *= 2;
740 opts->relopt_struct_size = relopt_struct_size;
763 Assert(offset < relopts->relopt_struct_size);
817 newoption->
desc = NULL;
818 newoption->
kinds = kinds;
835 bool default_val,
LOCKMODE lockmode)
840 name, desc, lockmode);
852 bool default_val,
LOCKMODE lockmode)
855 default_val, lockmode);
868 const char *desc,
bool default_val,
int offset)
884 int default_val,
int min_val,
int max_val,
890 name, desc, lockmode);
892 newoption->
min = min_val;
893 newoption->
max = max_val;
904 int min_val,
int max_val,
LOCKMODE lockmode)
907 default_val, min_val,
921 const char *desc,
int default_val,
int min_val,
922 int max_val,
int offset)
925 name, desc, default_val,
926 min_val, max_val, 0);
937 double default_val,
double min_val,
double max_val,
943 name, desc, lockmode);
945 newoption->
min = min_val;
946 newoption->
max = max_val;
957 double default_val,
double min_val,
double max_val,
961 default_val, min_val,
975 const char *desc,
double default_val,
976 double min_val,
double max_val,
int offset)
980 default_val, min_val,
993 const char *detailmsg,
LOCKMODE lockmode)
998 name, desc, lockmode);
1022 const char *detailmsg,
LOCKMODE lockmode)
1025 members, default_val,
1026 detailmsg, lockmode);
1040 int default_val,
const char *detailmsg,
int offset)
1044 members, default_val,
1056 const char *default_val,
1065 (validator) (default_val);
1068 name, desc, lockmode);
1121 const char *desc,
const char *default_val,
1159 char *validnsps[],
bool acceptOidsOff,
bool isReset)
1181 &oldoptions, NULL, &noldoptions);
1183 for (
i = 0;
i < noldoptions;
i++)
1185 char *text_str =
VARDATA(oldoptions[
i]);
1189 foreach(cell, defList)
1195 if (namspace == NULL)
1205 kw_len = strlen(def->
defname);
1206 if (text_len > kw_len && text_str[kw_len] ==
'=' &&
1207 strncmp(text_str, def->
defname, kw_len) == 0)
1225 foreach(cell, defList)
1231 if (def->
arg != NULL)
1233 (
errcode(ERRCODE_SYNTAX_ERROR),
1234 errmsg(
"RESET must not include values for parameters")));
1253 for (
i = 0; validnsps[
i];
i++)
1265 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1266 errmsg(
"unrecognized parameter namespace \"%s\"",
1271 if (namspace == NULL)
1286 if (def->
arg != NULL)
1298 strcmp(def->
defname,
"oids") == 0)
1302 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1303 errmsg(
"tables declared WITH OIDS are not supported")));
1338 Datum *optiondatums;
1392 Anum_pg_class_reloptions,
1401 switch (classForm->relkind)
1403 case RELKIND_RELATION:
1404 case RELKIND_TOASTVALUE:
1405 case RELKIND_MATVIEW:
1408 case RELKIND_PARTITIONED_TABLE:
1415 case RELKIND_PARTITIONED_INDEX:
1418 case RELKIND_FOREIGN_TABLE:
1435 Datum *optiondatums;
1444 char *text_str =
VARDATA(optiondatums[
i]);
1449 for (
j = 0;
j < numoptions;
j++)
1453 if (text_len > kw_len && text_str[kw_len] ==
'=' &&
1454 strncmp(text_str, reloptions[
j].gen->name, kw_len) == 0)
1462 if (
j >= numoptions && validate)
1472 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1473 errmsg(
"unrecognized parameter \"%s\"", s)));
1478 pfree(optiondatums);
1530 reloptions[
j].
isset =
false;
1540 *numrelopts = numoptions;
1580 bool nofree =
false;
1582 if (
option->isset && validate)
1584 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1585 errmsg(
"parameter \"%s\" specified more than once",
1588 value_len = text_len -
option->gen->namelen - 1;
1590 memcpy(
value, text_str +
option->gen->namelen + 1, value_len);
1591 value[value_len] =
'\0';
1593 switch (
option->gen->type)
1598 if (validate && !parsed)
1600 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1601 errmsg(
"invalid value for boolean option \"%s\": %s",
1610 if (validate && !parsed)
1612 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1613 errmsg(
"invalid value for integer option \"%s\": %s",
1615 if (validate && (
option->values.int_val < optint->
min ||
1618 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1619 errmsg(
"value %s out of bounds for option \"%s\"",
1621 errdetail(
"Valid values are between \"%d\" and \"%d\".",
1622 optint->
min, optint->
max)));
1630 if (validate && !parsed)
1632 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1633 errmsg(
"invalid value for floating point option \"%s\": %s",
1635 if (validate && (
option->values.real_val < optreal->
min ||
1636 option->values.real_val > optreal->
max))
1638 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1639 errmsg(
"value %s out of bounds for option \"%s\"",
1641 errdetail(
"Valid values are between \"%f\" and \"%f\".",
1642 optreal->
min, optreal->
max)));
1655 option->values.enum_val = elt->symbol_val;
1660 if (validate && !parsed)
1662 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1663 errmsg(
"invalid value for enum option \"%s\": %s",
1712 for (
i = 0;
i < numoptions;
i++)
1753 int offset = basesize;
1755 for (
i = 0;
i < numoptions;
i++)
1760 for (
j = 0;
j < numelems;
j++)
1765 char *itempos = ((
char *) rdopts) + elems[
j].
offset;
1771 *(
bool *) itempos =
options[
i].isset ?
1776 *(
int *) itempos =
options[
i].isset ?
1781 *(
double *) itempos =
options[
i].isset ?
1786 *(
int *) itempos =
options[
i].isset ?
1793 string_val =
options[
i].values.string_val;
1802 optstring->
fill_cb(string_val,
1803 (
char *) rdopts + offset);
1807 *(
int *) itempos = offset;
1811 *(
int *) itempos = 0;
1813 else if (string_val == NULL)
1814 *(
int *) itempos = 0;
1817 strcpy((
char *) rdopts + offset, string_val);
1818 *(
int *) itempos = offset;
1819 offset += strlen(string_val) + 1;
1823 elog(
ERROR,
"unsupported reloption type %d",
1831 if (validate && !found)
1832 elog(
ERROR,
"reloption \"%s\" not found in parse table",
1915 Size relopt_struct_size,
1917 int num_relopt_elems)
1925 Assert(numoptions <= num_relopt_elems);
1928 if (numoptions == 0)
1937 validate, relopt_elems, num_relopt_elems);
2030 case RELKIND_TOASTVALUE:
2040 return (
bytea *) rdopts;
2041 case RELKIND_RELATION:
2042 case RELKIND_MATVIEW:
2061 Assert(amoptions != NULL);
2067 return amoptions(reloptions, validate);
2124 foreach(cell, defList)
2135 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(ArrayType *array, Oid elmtype, int elmlen, bool elmbyval, char elmalign, Datum **elemsp, bool **nullsp, int *nelemsp)
Datum makeArrayResult(ArrayBuildState *astate, MemoryContext rcontext)
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)
#define offsetof(type, field)
#define PointerIsValid(pointer)
bool defGetBoolean(DefElem *def)
char * defGetString(DefElem *def)
int errdetail_internal(const char *fmt,...)
int errdetail(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
#define TOAST_TUPLE_TARGET
#define TOAST_TUPLE_TARGET_MAIN
static Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
Assert(fmt[strlen(fmt) - 1] !='\n')
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 * pstrdup(const char *in)
void pfree(void *pointer)
MemoryContext TopMemoryContext
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
void * repalloc(void *pointer, Size size)
void * MemoryContextAlloc(MemoryContext context, Size size)
char * MemoryContextStrdup(MemoryContext context, const char *string)
#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)
#define DatumGetPointer(X)
#define SET_VARSIZE(PTR, len)
#define PointerGetDatum(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 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[]
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)
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 * index_reloptions(amoptions_function amoptions, Datum reloptions, bool validate)
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 * 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)
static relopt_int intRelOpts[]
static relopt_enum enumRelOpts[]
static void parse_one_reloption(relopt_value *option, char *text_str, int text_len, bool validate)
List * untransformRelOptions(Datum options)
static relopt_string stringRelOpts[]
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)
static relopt_value * parseRelOptions(Datum options, bool validate, relopt_kind kind, int *numrelopts)
Datum transformRelOptions(Datum oldOptions, List *defList, const char *namspace, char *validnsps[], bool acceptOidsOff, bool isReset)
bytea * heap_reloptions(char relkind, 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 *opts, Size relopt_struct_size)
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)
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 * allocateReloptStruct(Size base, relopt_value *options, int numoptions)
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)
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)
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_gen * allocate_reloption(bits32 kinds, int type, const char *name, const char *desc, LOCKMODE lockmode)
bytea * view_reloptions(Datum reloptions, bool validate)
bytea * partitioned_table_reloptions(Datum reloptions, bool validate)
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 void initialize_reloptions(void)
relopt_kind add_reloption_kind(void)
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 bool need_initialization
void register_reloptions_validator(local_relopts *opts, relopts_validator validator)
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)
bytea * extractRelOptions(HeapTuple tuple, TupleDesc tupdesc, amoptions_function amoptions)
bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind)
static relopt_bool boolRelOpts[]
bytea * attribute_reloptions(Datum reloptions, bool validate)
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 relopt_value * parseLocalRelOptions(local_relopts *relopts, Datum options, bool validate)
static bits32 last_assigned_kind
void * build_local_reloptions(local_relopts *relopts, Datum options, 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
@ RELOPT_KIND_PARTITIONED
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::@47 values
String * makeString(char *str)