PostgreSQL Source Code git master
reloptions.c File Reference
#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"
Include dependency graph for reloptions.c:

Go to the source code of this file.

Macros

#define GET_STRING_RELOPTION_LEN(option)
 

Functions

static void initialize_reloptions (void)
 
static void parse_one_reloption (relopt_value *option, char *text_str, int text_len, bool validate)
 
relopt_kind add_reloption_kind (void)
 
static void add_reloption (relopt_gen *newoption)
 
void init_local_reloptions (local_relopts *relopts, Size relopt_struct_size)
 
void register_reloptions_validator (local_relopts *relopts, relopts_validator validator)
 
static void add_local_reloption (local_relopts *relopts, relopt_gen *newoption, int offset)
 
static relopt_genallocate_reloption (bits32 kinds, int type, const char *name, const char *desc, LOCKMODE lockmode)
 
static relopt_boolinit_bool_reloption (bits32 kinds, const char *name, const char *desc, bool default_val, LOCKMODE lockmode)
 
void add_bool_reloption (bits32 kinds, const char *name, const char *desc, bool default_val, LOCKMODE lockmode)
 
void add_local_bool_reloption (local_relopts *relopts, const char *name, const char *desc, bool default_val, int offset)
 
static relopt_intinit_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)
 
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_realinit_real_reloption (bits32 kinds, const char *name, const char *desc, double default_val, double min_val, double 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_local_real_reloption (local_relopts *relopts, const char *name, const char *desc, double default_val, double min_val, double max_val, int offset)
 
static relopt_enuminit_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_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_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 relopt_stringinit_string_reloption (bits32 kinds, const char *name, const char *desc, const char *default_val, validate_string_relopt validator, fill_string_relopt filler, 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 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)
 
ListuntransformRelOptions (Datum options)
 
byteaextractRelOptions (HeapTuple tuple, TupleDesc tupdesc, amoptions_function amoptions)
 
static void parseRelOptionsInternal (Datum options, bool validate, relopt_value *reloptions, int numoptions)
 
static relopt_valueparseRelOptions (Datum options, bool validate, relopt_kind kind, int *numrelopts)
 
static relopt_valueparseLocalRelOptions (local_relopts *relopts, Datum options, bool validate)
 
static void * allocateReloptStruct (Size base, relopt_value *options, int numoptions)
 
static void fillRelOptions (void *rdopts, Size basesize, relopt_value *options, int numoptions, bool validate, const relopt_parse_elt *elems, int numelems)
 
byteadefault_reloptions (Datum reloptions, bool validate, relopt_kind kind)
 
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)
 
byteapartitioned_table_reloptions (Datum reloptions, bool validate)
 
byteaview_reloptions (Datum reloptions, bool validate)
 
byteaheap_reloptions (char relkind, Datum reloptions, bool validate)
 
byteaindex_reloptions (amoptions_function amoptions, Datum reloptions, bool validate)
 
byteaattribute_reloptions (Datum reloptions, bool validate)
 
byteatablespace_reloptions (Datum reloptions, bool validate)
 
LOCKMODE AlterTableGetRelOptionsLockLevel (List *defList)
 

Variables

static relopt_bool boolRelOpts []
 
static relopt_int intRelOpts []
 
static relopt_real realRelOpts []
 
static relopt_enum_elt_def StdRdOptIndexCleanupValues []
 
static relopt_enum_elt_def gistBufferingOptValues []
 
static relopt_enum_elt_def viewCheckOptValues []
 
static relopt_enum enumRelOpts []
 
static relopt_string stringRelOpts []
 
static relopt_gen ** relOpts = NULL
 
static bits32 last_assigned_kind = RELOPT_KIND_LAST_DEFAULT
 
static int num_custom_options = 0
 
static relopt_gen ** custom_options = NULL
 
static bool need_initialization = true
 

Macro Definition Documentation

◆ GET_STRING_RELOPTION_LEN

#define GET_STRING_RELOPTION_LEN (   option)
Value:
((option).isset ? strlen((option).values.string_val) : \
((relopt_string *) (option).gen)->default_len)

Definition at line 588 of file reloptions.c.

Function Documentation

◆ add_bool_reloption()

void add_bool_reloption ( bits32  kinds,
const char *  name,
const char *  desc,
bool  default_val,
LOCKMODE  lockmode 
)

Definition at line 868 of file reloptions.c.

870{
871 relopt_bool *newoption = init_bool_reloption(kinds, name, desc,
872 default_val, lockmode);
873
874 add_reloption((relopt_gen *) newoption);
875}
static void add_reloption(relopt_gen *newoption)
Definition: reloptions.c:719
static relopt_bool * init_bool_reloption(bits32 kinds, const char *name, const char *desc, bool default_val, LOCKMODE lockmode)
Definition: reloptions.c:851
const char * name

References add_reloption(), init_bool_reloption(), and name.

Referenced by create_reloptions_table().

◆ add_enum_reloption()

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 1037 of file reloptions.c.

1040{
1041 relopt_enum *newoption = init_enum_reloption(kinds, name, desc,
1042 members, default_val,
1043 detailmsg, lockmode);
1044
1045 add_reloption((relopt_gen *) newoption);
1046}
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)
Definition: reloptions.c:1008

References add_reloption(), init_enum_reloption(), and name.

Referenced by create_reloptions_table().

◆ add_int_reloption()

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 920 of file reloptions.c.

922{
923 relopt_int *newoption = init_int_reloption(kinds, name, desc,
924 default_val, min_val,
925 max_val, lockmode);
926
927 add_reloption((relopt_gen *) newoption);
928}
tree ctl max_val
Definition: radixtree.h:1859
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)
Definition: reloptions.c:900

References add_reloption(), init_int_reloption(), max_val, and name.

Referenced by _PG_init(), and create_reloptions_table().

◆ add_local_bool_reloption()

void add_local_bool_reloption ( local_relopts relopts,
const char *  name,
const char *  desc,
bool  default_val,
int  offset 
)

Definition at line 884 of file reloptions.c.

886{
888 name, desc,
889 default_val, 0);
890
891 add_local_reloption(relopts, (relopt_gen *) newoption, offset);
892}
static void add_local_reloption(local_relopts *relopts, relopt_gen *newoption, int offset)
Definition: reloptions.c:776
@ RELOPT_KIND_LOCAL
Definition: reloptions.h:41

References add_local_reloption(), init_bool_reloption(), name, and RELOPT_KIND_LOCAL.

◆ add_local_enum_reloption()

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 1055 of file reloptions.c.

1058{
1060 name, desc,
1061 members, default_val,
1062 detailmsg, 0);
1063
1064 add_local_reloption(relopts, (relopt_gen *) newoption, offset);
1065}

References add_local_reloption(), init_enum_reloption(), name, and RELOPT_KIND_LOCAL.

◆ add_local_int_reloption()

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 
)

◆ add_local_real_reloption()

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 991 of file reloptions.c.

994{
996 name, desc,
997 default_val, min_val,
998 max_val, 0);
999
1000 add_local_reloption(relopts, (relopt_gen *) newoption, offset);
1001}
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)
Definition: reloptions.c:953

References add_local_reloption(), init_real_reloption(), max_val, name, and RELOPT_KIND_LOCAL.

Referenced by brin_bloom_options().

◆ add_local_reloption()

static void add_local_reloption ( local_relopts relopts,
relopt_gen newoption,
int  offset 
)
static

Definition at line 776 of file reloptions.c.

777{
778 local_relopt *opt = palloc(sizeof(*opt));
779
780 Assert(offset < relopts->relopt_struct_size);
781
782 opt->option = newoption;
783 opt->offset = offset;
784
785 relopts->options = lappend(relopts->options, opt);
786}
#define Assert(condition)
Definition: c.h:815
List * lappend(List *list, void *datum)
Definition: list.c:339
void * palloc(Size size)
Definition: mcxt.c:1317
relopt_gen * option
Definition: reloptions.h:160
List * options
Definition: reloptions.h:167

References Assert, lappend(), local_relopt::offset, local_relopt::option, local_relopts::options, and palloc().

Referenced by add_local_bool_reloption(), add_local_enum_reloption(), add_local_int_reloption(), add_local_real_reloption(), and add_local_string_reloption().

◆ add_local_string_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 1137 of file reloptions.c.

1141{
1143 name, desc,
1144 default_val,
1145 validator, filler,
1146 0);
1147
1148 add_local_reloption(relopts, (relopt_gen *) newoption, offset);
1149}
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)
Definition: reloptions.c:1072

References add_local_reloption(), init_string_reloption(), name, and RELOPT_KIND_LOCAL.

◆ add_real_reloption()

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 973 of file reloptions.c.

976{
977 relopt_real *newoption = init_real_reloption(kinds, name, desc,
978 default_val, min_val,
979 max_val, lockmode);
980
981 add_reloption((relopt_gen *) newoption);
982}

References add_reloption(), init_real_reloption(), max_val, and name.

Referenced by create_reloptions_table().

◆ add_reloption()

static void add_reloption ( relopt_gen newoption)
static

Definition at line 719 of file reloptions.c.

720{
721 static int max_custom_options = 0;
722
723 if (num_custom_options >= max_custom_options)
724 {
725 MemoryContext oldcxt;
726
728
729 if (max_custom_options == 0)
730 {
731 max_custom_options = 8;
732 custom_options = palloc(max_custom_options * sizeof(relopt_gen *));
733 }
734 else
735 {
736 max_custom_options *= 2;
738 max_custom_options * sizeof(relopt_gen *));
739 }
740 MemoryContextSwitchTo(oldcxt);
741 }
742 custom_options[num_custom_options++] = newoption;
743
744 need_initialization = true;
745}
void * repalloc(void *pointer, Size size)
Definition: mcxt.c:1541
MemoryContext TopMemoryContext
Definition: mcxt.c:149
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:124
static int num_custom_options
Definition: reloptions.c:575
static bool need_initialization
Definition: reloptions.c:577
static relopt_gen ** custom_options
Definition: reloptions.c:576

References custom_options, MemoryContextSwitchTo(), need_initialization, num_custom_options, palloc(), repalloc(), and TopMemoryContext.

Referenced by add_bool_reloption(), add_enum_reloption(), add_int_reloption(), add_real_reloption(), and add_string_reloption().

◆ add_reloption_kind()

relopt_kind add_reloption_kind ( void  )

Definition at line 702 of file reloptions.c.

703{
704 /* don't hand out the last bit so that the enum's behavior is portable */
707 (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
708 errmsg("user-defined relation parameter types limit exceeded")));
709 last_assigned_kind <<= 1;
711}
int errcode(int sqlerrcode)
Definition: elog.c:853
int errmsg(const char *fmt,...)
Definition: elog.c:1070
#define ERROR
Definition: elog.h:39
#define ereport(elevel,...)
Definition: elog.h:149
static bits32 last_assigned_kind
Definition: reloptions.c:573
relopt_kind
Definition: reloptions.h:40
@ RELOPT_KIND_MAX
Definition: reloptions.h:57

References ereport, errcode(), errmsg(), ERROR, last_assigned_kind, and RELOPT_KIND_MAX.

Referenced by _PG_init(), and create_reloptions_table().

◆ add_string_reloption()

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 1117 of file reloptions.c.

1120{
1121 relopt_string *newoption = init_string_reloption(kinds, name, desc,
1122 default_val,
1123 validator, NULL,
1124 lockmode);
1125
1126 add_reloption((relopt_gen *) newoption);
1127}

References add_reloption(), init_string_reloption(), and name.

Referenced by create_reloptions_table().

◆ allocate_reloption()

static relopt_gen * allocate_reloption ( bits32  kinds,
int  type,
const char *  name,
const char *  desc,
LOCKMODE  lockmode 
)
static

Definition at line 794 of file reloptions.c.

796{
797 MemoryContext oldcxt;
798 size_t size;
799 relopt_gen *newoption;
800
801 if (kinds != RELOPT_KIND_LOCAL)
803 else
804 oldcxt = NULL;
805
806 switch (type)
807 {
808 case RELOPT_TYPE_BOOL:
809 size = sizeof(relopt_bool);
810 break;
811 case RELOPT_TYPE_INT:
812 size = sizeof(relopt_int);
813 break;
814 case RELOPT_TYPE_REAL:
815 size = sizeof(relopt_real);
816 break;
817 case RELOPT_TYPE_ENUM:
818 size = sizeof(relopt_enum);
819 break;
821 size = sizeof(relopt_string);
822 break;
823 default:
824 elog(ERROR, "unsupported reloption type %d", type);
825 return NULL; /* keep compiler quiet */
826 }
827
828 newoption = palloc(size);
829
830 newoption->name = pstrdup(name);
831 if (desc)
832 newoption->desc = pstrdup(desc);
833 else
834 newoption->desc = NULL;
835 newoption->kinds = kinds;
836 newoption->namelen = strlen(name);
837 newoption->type = type;
838 newoption->lockmode = lockmode;
839
840 if (oldcxt != NULL)
841 MemoryContextSwitchTo(oldcxt);
842
843 return newoption;
844}
#define elog(elevel,...)
Definition: elog.h:225
char * pstrdup(const char *in)
Definition: mcxt.c:1696
struct relopt_real relopt_real
struct relopt_bool relopt_bool
struct relopt_string relopt_string
struct relopt_enum relopt_enum
struct relopt_int relopt_int
@ RELOPT_TYPE_ENUM
Definition: reloptions.h:34
@ RELOPT_TYPE_INT
Definition: reloptions.h:32
@ RELOPT_TYPE_BOOL
Definition: reloptions.h:31
@ RELOPT_TYPE_REAL
Definition: reloptions.h:33
@ RELOPT_TYPE_STRING
Definition: reloptions.h:35
static pg_noinline void Size size
Definition: slab.c:607
const char * desc
Definition: reloptions.h:68
bits32 kinds
Definition: reloptions.h:69
const char * name
Definition: reloptions.h:66
LOCKMODE lockmode
Definition: reloptions.h:70
relopt_type type
Definition: reloptions.h:72
int namelen
Definition: reloptions.h:71
const char * type

References relopt_gen::desc, elog, ERROR, relopt_gen::kinds, relopt_gen::lockmode, MemoryContextSwitchTo(), name, relopt_gen::name, relopt_gen::namelen, palloc(), pstrdup(), RELOPT_KIND_LOCAL, RELOPT_TYPE_BOOL, RELOPT_TYPE_ENUM, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, RELOPT_TYPE_STRING, size, TopMemoryContext, type, and relopt_gen::type.

Referenced by init_bool_reloption(), init_enum_reloption(), init_int_reloption(), init_real_reloption(), and init_string_reloption().

◆ allocateReloptStruct()

static void * allocateReloptStruct ( Size  base,
relopt_value options,
int  numoptions 
)
static

Definition at line 1721 of file reloptions.c.

1722{
1723 Size size = base;
1724 int i;
1725
1726 for (i = 0; i < numoptions; i++)
1727 {
1728 relopt_value *optval = &options[i];
1729
1730 if (optval->gen->type == RELOPT_TYPE_STRING)
1731 {
1732 relopt_string *optstr = (relopt_string *) optval->gen;
1733
1734 if (optstr->fill_cb)
1735 {
1736 const char *val = optval->isset ? optval->values.string_val :
1737 optstr->default_isnull ? NULL : optstr->default_val;
1738
1739 size += optstr->fill_cb(val, NULL);
1740 }
1741 else
1742 size += GET_STRING_RELOPTION_LEN(*optval) + 1;
1743 }
1744 }
1745
1746 return palloc0(size);
1747}
size_t Size
Definition: c.h:562
long val
Definition: informix.c:689
int i
Definition: isn.c:72
if(TABLE==NULL||TABLE_index==NULL)
Definition: isn.c:76
void * palloc0(Size size)
Definition: mcxt.c:1347
#define GET_STRING_RELOPTION_LEN(option)
Definition: reloptions.c:588
char * default_val
Definition: reloptions.h:146
fill_string_relopt fill_cb
Definition: reloptions.h:145
bool default_isnull
Definition: reloptions.h:143
relopt_gen * gen
Definition: reloptions.h:78
char * string_val
Definition: reloptions.h:86
union relopt_value::@48 values

References relopt_string::default_isnull, relopt_string::default_val, relopt_string::fill_cb, relopt_value::gen, GET_STRING_RELOPTION_LEN, i, if(), relopt_value::isset, palloc0(), RELOPT_TYPE_STRING, size, relopt_value::string_val, relopt_gen::type, val, and relopt_value::values.

Referenced by build_local_reloptions(), and build_reloptions().

◆ AlterTableGetRelOptionsLockLevel()

LOCKMODE AlterTableGetRelOptionsLockLevel ( List defList)

Definition at line 2131 of file reloptions.c.

2132{
2133 LOCKMODE lockmode = NoLock;
2134 ListCell *cell;
2135
2136 if (defList == NIL)
2137 return AccessExclusiveLock;
2138
2141
2142 foreach(cell, defList)
2143 {
2144 DefElem *def = (DefElem *) lfirst(cell);
2145 int i;
2146
2147 for (i = 0; relOpts[i]; i++)
2148 {
2149 if (strncmp(relOpts[i]->name,
2150 def->defname,
2151 relOpts[i]->namelen + 1) == 0)
2152 {
2153 if (lockmode < relOpts[i]->lockmode)
2154 lockmode = relOpts[i]->lockmode;
2155 }
2156 }
2157 }
2158
2159 return lockmode;
2160}
int LOCKMODE
Definition: lockdefs.h:26
#define NoLock
Definition: lockdefs.h:34
#define AccessExclusiveLock
Definition: lockdefs.h:43
#define lfirst(lc)
Definition: pg_list.h:172
#define NIL
Definition: pg_list.h:68
static void initialize_reloptions(void)
Definition: reloptions.c:599
static relopt_gen ** relOpts
Definition: reloptions.c:572
char * defname
Definition: parsenodes.h:826

References AccessExclusiveLock, DefElem::defname, i, initialize_reloptions(), lfirst, relopt_gen::lockmode, name, relopt_gen::namelen, need_initialization, NIL, NoLock, and relOpts.

Referenced by AlterTableGetLockLevel().

◆ attribute_reloptions()

bytea * attribute_reloptions ( Datum  reloptions,
bool  validate 
)

Definition at line 2092 of file reloptions.c.

2093{
2094 static const relopt_parse_elt tab[] = {
2095 {"n_distinct", RELOPT_TYPE_REAL, offsetof(AttributeOpts, n_distinct)},
2096 {"n_distinct_inherited", RELOPT_TYPE_REAL, offsetof(AttributeOpts, n_distinct_inherited)}
2097 };
2098
2099 return (bytea *) build_reloptions(reloptions, validate,
2101 sizeof(AttributeOpts),
2102 tab, lengthof(tab));
2103}
#define lengthof(array)
Definition: c.h:745
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: reloptions.c:1931
@ RELOPT_KIND_ATTRIBUTE
Definition: reloptions.h:48
Definition: c.h:644

References build_reloptions(), lengthof, RELOPT_KIND_ATTRIBUTE, and RELOPT_TYPE_REAL.

Referenced by ATExecSetOptions(), and get_attribute_options().

◆ build_local_reloptions()

void * build_local_reloptions ( local_relopts relopts,
Datum  options,
bool  validate 
)

Definition at line 1968 of file reloptions.c.

1969{
1970 int noptions = list_length(relopts->options);
1971 relopt_parse_elt *elems = palloc(sizeof(*elems) * noptions);
1972 relopt_value *vals;
1973 void *opts;
1974 int i = 0;
1975 ListCell *lc;
1976
1977 foreach(lc, relopts->options)
1978 {
1979 local_relopt *opt = lfirst(lc);
1980
1981 elems[i].optname = opt->option->name;
1982 elems[i].opttype = opt->option->type;
1983 elems[i].offset = opt->offset;
1984
1985 i++;
1986 }
1987
1988 vals = parseLocalRelOptions(relopts, options, validate);
1990 fillRelOptions(opts, relopts->relopt_struct_size, vals, noptions, validate,
1991 elems, noptions);
1992
1993 if (validate)
1994 foreach(lc, relopts->validators)
1995 ((relopts_validator) lfirst(lc)) (opts, vals, noptions);
1996
1997 if (elems)
1998 pfree(elems);
1999
2000 return opts;
2001}
void pfree(void *pointer)
Definition: mcxt.c:1521
static AmcheckOptions opts
Definition: pg_amcheck.c:112
static int list_length(const List *l)
Definition: pg_list.h:152
static size_t noptions
static relopt_value * parseLocalRelOptions(local_relopts *relopts, Datum options, bool validate)
Definition: reloptions.c:1560
static void fillRelOptions(void *rdopts, Size basesize, relopt_value *options, int numoptions, bool validate, const relopt_parse_elt *elems, int numelems)
Definition: reloptions.c:1761
static void * allocateReloptStruct(Size base, relopt_value *options, int numoptions)
Definition: reloptions.c:1721
void(* relopts_validator)(void *parsed_options, relopt_value *vals, int nvals)
Definition: reloptions.h:137
List * validators
Definition: reloptions.h:168
Size relopt_struct_size
Definition: reloptions.h:169
const char * optname
Definition: reloptions.h:152
relopt_type opttype
Definition: reloptions.h:153

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().

◆ build_reloptions()

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 1931 of file reloptions.c.

1936{
1937 int numoptions;
1939 void *rdopts;
1940
1941 /* parse options specific to given relation option kind */
1942 options = parseRelOptions(reloptions, validate, kind, &numoptions);
1943 Assert(numoptions <= num_relopt_elems);
1944
1945 /* if none set, we're done */
1946 if (numoptions == 0)
1947 {
1948 Assert(options == NULL);
1949 return NULL;
1950 }
1951
1952 /* allocate and fill the structure */
1953 rdopts = allocateReloptStruct(relopt_struct_size, options, numoptions);
1954 fillRelOptions(rdopts, relopt_struct_size, options, numoptions,
1955 validate, relopt_elems, num_relopt_elems);
1956
1957 pfree(options);
1958
1959 return rdopts;
1960}
static char ** options
static relopt_value * parseRelOptions(Datum options, bool validate, relopt_kind kind, int *numrelopts)
Definition: reloptions.c:1518

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().

◆ default_reloptions()

bytea * default_reloptions ( Datum  reloptions,
bool  validate,
relopt_kind  kind 
)

Definition at line 1857 of file reloptions.c.

1858{
1859 static const relopt_parse_elt tab[] = {
1860 {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)},
1861 {"autovacuum_enabled", RELOPT_TYPE_BOOL,
1862 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)},
1863 {"autovacuum_vacuum_threshold", RELOPT_TYPE_INT,
1864 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, vacuum_threshold)},
1865 {"autovacuum_vacuum_max_threshold", RELOPT_TYPE_INT,
1866 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, vacuum_max_threshold)},
1867 {"autovacuum_vacuum_insert_threshold", RELOPT_TYPE_INT,
1868 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, vacuum_ins_threshold)},
1869 {"autovacuum_analyze_threshold", RELOPT_TYPE_INT,
1870 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, analyze_threshold)},
1871 {"autovacuum_vacuum_cost_limit", RELOPT_TYPE_INT,
1872 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, vacuum_cost_limit)},
1873 {"autovacuum_freeze_min_age", RELOPT_TYPE_INT,
1874 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, freeze_min_age)},
1875 {"autovacuum_freeze_max_age", RELOPT_TYPE_INT,
1876 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, freeze_max_age)},
1877 {"autovacuum_freeze_table_age", RELOPT_TYPE_INT,
1878 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, freeze_table_age)},
1879 {"autovacuum_multixact_freeze_min_age", RELOPT_TYPE_INT,
1880 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, multixact_freeze_min_age)},
1881 {"autovacuum_multixact_freeze_max_age", RELOPT_TYPE_INT,
1882 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, multixact_freeze_max_age)},
1883 {"autovacuum_multixact_freeze_table_age", RELOPT_TYPE_INT,
1884 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, multixact_freeze_table_age)},
1885 {"log_autovacuum_min_duration", RELOPT_TYPE_INT,
1886 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, log_min_duration)},
1887 {"toast_tuple_target", RELOPT_TYPE_INT,
1888 offsetof(StdRdOptions, toast_tuple_target)},
1889 {"autovacuum_vacuum_cost_delay", RELOPT_TYPE_REAL,
1890 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, vacuum_cost_delay)},
1891 {"autovacuum_vacuum_scale_factor", RELOPT_TYPE_REAL,
1892 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, vacuum_scale_factor)},
1893 {"autovacuum_vacuum_insert_scale_factor", RELOPT_TYPE_REAL,
1894 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, vacuum_ins_scale_factor)},
1895 {"autovacuum_analyze_scale_factor", RELOPT_TYPE_REAL,
1896 offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, analyze_scale_factor)},
1897 {"user_catalog_table", RELOPT_TYPE_BOOL,
1898 offsetof(StdRdOptions, user_catalog_table)},
1899 {"parallel_workers", RELOPT_TYPE_INT,
1900 offsetof(StdRdOptions, parallel_workers)},
1901 {"vacuum_index_cleanup", RELOPT_TYPE_ENUM,
1902 offsetof(StdRdOptions, vacuum_index_cleanup)},
1903 {"vacuum_truncate", RELOPT_TYPE_BOOL,
1904 offsetof(StdRdOptions, vacuum_truncate)},
1905 {"vacuum_max_eager_freeze_failure_rate", RELOPT_TYPE_REAL,
1907 };
1908
1909 return (bytea *) build_reloptions(reloptions, validate, kind,
1910 sizeof(StdRdOptions),
1911 tab, lengthof(tab));
1912}
static int fillfactor
Definition: pgbench.c:188
double vacuum_max_eager_freeze_failure_rate
Definition: vacuum.c:79
double vacuum_cost_delay
Definition: vacuum.c:88
int vacuum_cost_limit
Definition: vacuum.c:89

References build_reloptions(), fillfactor, lengthof, RELOPT_TYPE_BOOL, RELOPT_TYPE_ENUM, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, vacuum_cost_delay, vacuum_cost_limit, and vacuum_max_eager_freeze_failure_rate.

Referenced by heap_reloptions().

◆ extractRelOptions()

bytea * extractRelOptions ( HeapTuple  tuple,
TupleDesc  tupdesc,
amoptions_function  amoptions 
)

Definition at line 1398 of file reloptions.c.

1400{
1401 bytea *options;
1402 bool isnull;
1403 Datum datum;
1404 Form_pg_class classForm;
1405
1406 datum = fastgetattr(tuple,
1407 Anum_pg_class_reloptions,
1408 tupdesc,
1409 &isnull);
1410 if (isnull)
1411 return NULL;
1412
1413 classForm = (Form_pg_class) GETSTRUCT(tuple);
1414
1415 /* Parse into appropriate format; don't error out here */
1416 switch (classForm->relkind)
1417 {
1418 case RELKIND_RELATION:
1419 case RELKIND_TOASTVALUE:
1420 case RELKIND_MATVIEW:
1421 options = heap_reloptions(classForm->relkind, datum, false);
1422 break;
1423 case RELKIND_PARTITIONED_TABLE:
1424 options = partitioned_table_reloptions(datum, false);
1425 break;
1426 case RELKIND_VIEW:
1427 options = view_reloptions(datum, false);
1428 break;
1429 case RELKIND_INDEX:
1430 case RELKIND_PARTITIONED_INDEX:
1431 options = index_reloptions(amoptions, datum, false);
1432 break;
1433 case RELKIND_FOREIGN_TABLE:
1434 options = NULL;
1435 break;
1436 default:
1437 Assert(false); /* can't get here */
1438 options = NULL; /* keep compiler quiet */
1439 break;
1440 }
1441
1442 return options;
1443}
static void * GETSTRUCT(const HeapTupleData *tuple)
Definition: htup_details.h:728
static Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
Definition: htup_details.h:860
FormData_pg_class * Form_pg_class
Definition: pg_class.h:153
uintptr_t Datum
Definition: postgres.h:69
bytea * view_reloptions(Datum reloptions, bool validate)
Definition: reloptions.c:2021
bytea * index_reloptions(amoptions_function amoptions, Datum reloptions, bool validate)
Definition: reloptions.c:2077
bytea * partitioned_table_reloptions(Datum reloptions, bool validate)
Definition: reloptions.c:2007
bytea * heap_reloptions(char relkind, Datum reloptions, bool validate)
Definition: reloptions.c:2042

References Assert, fastgetattr(), GETSTRUCT(), heap_reloptions(), index_reloptions(), options, partitioned_table_reloptions(), and view_reloptions().

Referenced by extract_autovac_opts(), and RelationParseRelOptions().

◆ fillRelOptions()

static void fillRelOptions ( void *  rdopts,
Size  basesize,
relopt_value options,
int  numoptions,
bool  validate,
const relopt_parse_elt elems,
int  numelems 
)
static

Definition at line 1761 of file reloptions.c.

1765{
1766 int i;
1767 int offset = basesize;
1768
1769 for (i = 0; i < numoptions; i++)
1770 {
1771 int j;
1772 bool found = false;
1773
1774 for (j = 0; j < numelems; j++)
1775 {
1776 if (strcmp(options[i].gen->name, elems[j].optname) == 0)
1777 {
1778 relopt_string *optstring;
1779 char *itempos = ((char *) rdopts) + elems[j].offset;
1780 char *string_val;
1781
1782 switch (options[i].gen->type)
1783 {
1784 case RELOPT_TYPE_BOOL:
1785 *(bool *) itempos = options[i].isset ?
1786 options[i].values.bool_val :
1787 ((relopt_bool *) options[i].gen)->default_val;
1788 break;
1789 case RELOPT_TYPE_INT:
1790 *(int *) itempos = options[i].isset ?
1791 options[i].values.int_val :
1792 ((relopt_int *) options[i].gen)->default_val;
1793 break;
1794 case RELOPT_TYPE_REAL:
1795 *(double *) itempos = options[i].isset ?
1796 options[i].values.real_val :
1797 ((relopt_real *) options[i].gen)->default_val;
1798 break;
1799 case RELOPT_TYPE_ENUM:
1800 *(int *) itempos = options[i].isset ?
1801 options[i].values.enum_val :
1802 ((relopt_enum *) options[i].gen)->default_val;
1803 break;
1804 case RELOPT_TYPE_STRING:
1805 optstring = (relopt_string *) options[i].gen;
1806 if (options[i].isset)
1807 string_val = options[i].values.string_val;
1808 else if (!optstring->default_isnull)
1809 string_val = optstring->default_val;
1810 else
1811 string_val = NULL;
1812
1813 if (optstring->fill_cb)
1814 {
1815 Size size =
1816 optstring->fill_cb(string_val,
1817 (char *) rdopts + offset);
1818
1819 if (size)
1820 {
1821 *(int *) itempos = offset;
1822 offset += size;
1823 }
1824 else
1825 *(int *) itempos = 0;
1826 }
1827 else if (string_val == NULL)
1828 *(int *) itempos = 0;
1829 else
1830 {
1831 strcpy((char *) rdopts + offset, string_val);
1832 *(int *) itempos = offset;
1833 offset += strlen(string_val) + 1;
1834 }
1835 break;
1836 default:
1837 elog(ERROR, "unsupported reloption type %d",
1838 options[i].gen->type);
1839 break;
1840 }
1841 found = true;
1842 break;
1843 }
1844 }
1845 if (validate && !found)
1846 elog(ERROR, "reloption \"%s\" not found in parse table",
1847 options[i].gen->name);
1848 }
1849 SET_VARSIZE(rdopts, offset);
1850}
static Datum values[MAXATTR]
Definition: bootstrap.c:151
int j
Definition: isn.c:73
#define SET_VARSIZE(PTR, len)
Definition: varatt.h:305

References relopt_string::default_isnull, relopt_string::default_val, elog, ERROR, relopt_string::fill_cb, i, j, relopt_parse_elt::offset, relopt_parse_elt::optname, RELOPT_TYPE_BOOL, RELOPT_TYPE_ENUM, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, RELOPT_TYPE_STRING, SET_VARSIZE, size, and values.

Referenced by build_local_reloptions(), and build_reloptions().

◆ heap_reloptions()

bytea * heap_reloptions ( char  relkind,
Datum  reloptions,
bool  validate 
)

Definition at line 2042 of file reloptions.c.

2043{
2044 StdRdOptions *rdopts;
2045
2046 switch (relkind)
2047 {
2048 case RELKIND_TOASTVALUE:
2049 rdopts = (StdRdOptions *)
2050 default_reloptions(reloptions, validate, RELOPT_KIND_TOAST);
2051 if (rdopts != NULL)
2052 {
2053 /* adjust default-only parameters for TOAST relations */
2054 rdopts->fillfactor = 100;
2055 rdopts->autovacuum.analyze_threshold = -1;
2056 rdopts->autovacuum.analyze_scale_factor = -1;
2057 }
2058 return (bytea *) rdopts;
2059 case RELKIND_RELATION:
2060 case RELKIND_MATVIEW:
2061 return default_reloptions(reloptions, validate, RELOPT_KIND_HEAP);
2062 default:
2063 /* other relkinds are not supported */
2064 return NULL;
2065 }
2066}
bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind)
Definition: reloptions.c:1857
@ RELOPT_KIND_TOAST
Definition: reloptions.h:43
@ RELOPT_KIND_HEAP
Definition: reloptions.h:42
int analyze_threshold
Definition: rel.h:314
float8 analyze_scale_factor
Definition: rel.h:326
int fillfactor
Definition: rel.h:340
AutoVacOpts autovacuum
Definition: rel.h:342

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().

◆ index_reloptions()

bytea * index_reloptions ( amoptions_function  amoptions,
Datum  reloptions,
bool  validate 
)

Definition at line 2077 of file reloptions.c.

2078{
2079 Assert(amoptions != NULL);
2080
2081 /* Assume function is strict */
2082 if (!PointerIsValid(DatumGetPointer(reloptions)))
2083 return NULL;
2084
2085 return amoptions(reloptions, validate);
2086}
#define PointerIsValid(pointer)
Definition: c.h:720
static Pointer DatumGetPointer(Datum X)
Definition: postgres.h:317

References Assert, DatumGetPointer(), and PointerIsValid.

Referenced by ATExecSetRelOptions(), DefineIndex(), and extractRelOptions().

◆ init_bool_reloption()

static relopt_bool * init_bool_reloption ( bits32  kinds,
const char *  name,
const char *  desc,
bool  default_val,
LOCKMODE  lockmode 
)
static

Definition at line 851 of file reloptions.c.

853{
854 relopt_bool *newoption;
855
856 newoption = (relopt_bool *) allocate_reloption(kinds, RELOPT_TYPE_BOOL,
857 name, desc, lockmode);
858 newoption->default_val = default_val;
859
860 return newoption;
861}
static relopt_gen * allocate_reloption(bits32 kinds, int type, const char *name, const char *desc, LOCKMODE lockmode)
Definition: reloptions.c:794
bool default_val
Definition: reloptions.h:94

References allocate_reloption(), relopt_bool::default_val, name, and RELOPT_TYPE_BOOL.

Referenced by add_bool_reloption(), and add_local_bool_reloption().

◆ init_enum_reloption()

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

Definition at line 1008 of file reloptions.c.

1011{
1012 relopt_enum *newoption;
1013
1014 newoption = (relopt_enum *) allocate_reloption(kinds, RELOPT_TYPE_ENUM,
1015 name, desc, lockmode);
1016 newoption->members = members;
1017 newoption->default_val = default_val;
1018 newoption->detailmsg = detailmsg;
1019
1020 return newoption;
1021}
int default_val
Definition: reloptions.h:127
const char * detailmsg
Definition: reloptions.h:128
relopt_enum_elt_def * members
Definition: reloptions.h:126

References allocate_reloption(), relopt_enum::default_val, relopt_enum::detailmsg, relopt_enum::members, name, and RELOPT_TYPE_ENUM.

Referenced by add_enum_reloption(), and add_local_enum_reloption().

◆ init_int_reloption()

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 
)
static

Definition at line 900 of file reloptions.c.

903{
904 relopt_int *newoption;
905
906 newoption = (relopt_int *) allocate_reloption(kinds, RELOPT_TYPE_INT,
907 name, desc, lockmode);
908 newoption->default_val = default_val;
909 newoption->min = min_val;
910 newoption->max = max_val;
911
912 return newoption;
913}
int default_val
Definition: reloptions.h:100

References allocate_reloption(), relopt_int::default_val, relopt_int::max, max_val, relopt_int::min, name, and RELOPT_TYPE_INT.

Referenced by add_int_reloption(), and add_local_int_reloption().

◆ init_local_reloptions()

void init_local_reloptions ( local_relopts relopts,
Size  relopt_struct_size 
)

◆ init_real_reloption()

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

Definition at line 953 of file reloptions.c.

956{
957 relopt_real *newoption;
958
959 newoption = (relopt_real *) allocate_reloption(kinds, RELOPT_TYPE_REAL,
960 name, desc, lockmode);
961 newoption->default_val = default_val;
962 newoption->min = min_val;
963 newoption->max = max_val;
964
965 return newoption;
966}
double min
Definition: reloptions.h:109
double max
Definition: reloptions.h:110
double default_val
Definition: reloptions.h:108

References allocate_reloption(), relopt_real::default_val, relopt_real::max, max_val, relopt_real::min, name, and RELOPT_TYPE_REAL.

Referenced by add_local_real_reloption(), and add_real_reloption().

◆ init_string_reloption()

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

Definition at line 1072 of file reloptions.c.

1077{
1078 relopt_string *newoption;
1079
1080 /* make sure the validator/default combination is sane */
1081 if (validator)
1082 (validator) (default_val);
1083
1085 name, desc, lockmode);
1086 newoption->validate_cb = validator;
1087 newoption->fill_cb = filler;
1088 if (default_val)
1089 {
1090 if (kinds == RELOPT_KIND_LOCAL)
1091 newoption->default_val = strdup(default_val);
1092 else
1093 newoption->default_val = MemoryContextStrdup(TopMemoryContext, default_val);
1094 newoption->default_len = strlen(default_val);
1095 newoption->default_isnull = false;
1096 }
1097 else
1098 {
1099 newoption->default_val = "";
1100 newoption->default_len = 0;
1101 newoption->default_isnull = true;
1102 }
1103
1104 return newoption;
1105}
char * MemoryContextStrdup(MemoryContext context, const char *string)
Definition: mcxt.c:1683
validate_string_relopt validate_cb
Definition: reloptions.h:144

References allocate_reloption(), relopt_string::default_isnull, relopt_string::default_len, relopt_string::default_val, relopt_string::fill_cb, MemoryContextStrdup(), name, RELOPT_KIND_LOCAL, RELOPT_TYPE_STRING, TopMemoryContext, and relopt_string::validate_cb.

Referenced by add_local_string_reloption(), and add_string_reloption().

◆ initialize_reloptions()

static void initialize_reloptions ( void  )
static

Definition at line 599 of file reloptions.c.

600{
601 int i;
602 int j;
603
604 j = 0;
605 for (i = 0; boolRelOpts[i].gen.name; i++)
606 {
609 j++;
610 }
611 for (i = 0; intRelOpts[i].gen.name; i++)
612 {
615 j++;
616 }
617 for (i = 0; realRelOpts[i].gen.name; i++)
618 {
621 j++;
622 }
623 for (i = 0; enumRelOpts[i].gen.name; i++)
624 {
627 j++;
628 }
629 for (i = 0; stringRelOpts[i].gen.name; i++)
630 {
633 j++;
634 }
636
637 if (relOpts)
638 pfree(relOpts);
640 (j + 1) * sizeof(relopt_gen *));
641
642 j = 0;
643 for (i = 0; boolRelOpts[i].gen.name; i++)
644 {
647 relOpts[j]->namelen = strlen(relOpts[j]->name);
648 j++;
649 }
650
651 for (i = 0; intRelOpts[i].gen.name; i++)
652 {
653 relOpts[j] = &intRelOpts[i].gen;
655 relOpts[j]->namelen = strlen(relOpts[j]->name);
656 j++;
657 }
658
659 for (i = 0; realRelOpts[i].gen.name; i++)
660 {
663 relOpts[j]->namelen = strlen(relOpts[j]->name);
664 j++;
665 }
666
667 for (i = 0; enumRelOpts[i].gen.name; i++)
668 {
671 relOpts[j]->namelen = strlen(relOpts[j]->name);
672 j++;
673 }
674
675 for (i = 0; stringRelOpts[i].gen.name; i++)
676 {
679 relOpts[j]->namelen = strlen(relOpts[j]->name);
680 j++;
681 }
682
683 for (i = 0; i < num_custom_options; i++)
684 {
686 j++;
687 }
688
689 /* add a list terminator */
690 relOpts[j] = NULL;
691
692 /* flag the work is complete */
693 need_initialization = false;
694}
bool DoLockModesConflict(LOCKMODE mode1, LOCKMODE mode2)
Definition: lock.c:617
void * MemoryContextAlloc(MemoryContext context, Size size)
Definition: mcxt.c:1181
static relopt_real realRelOpts[]
Definition: reloptions.c:397
static relopt_int intRelOpts[]
Definition: reloptions.c:173
static relopt_enum enumRelOpts[]
Definition: reloptions.c:527
static relopt_string stringRelOpts[]
Definition: reloptions.c:566
static relopt_bool boolRelOpts[]
Definition: reloptions.c:94
relopt_gen gen
Definition: reloptions.h:93
relopt_gen gen
Definition: reloptions.h:125
relopt_gen gen
Definition: reloptions.h:99
relopt_gen gen
Definition: reloptions.h:107
relopt_gen gen
Definition: reloptions.h:141

References Assert, boolRelOpts, custom_options, DoLockModesConflict(), enumRelOpts, relopt_bool::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, relOpts, stringRelOpts, TopMemoryContext, and relopt_gen::type.

Referenced by AlterTableGetRelOptionsLockLevel(), and parseRelOptions().

◆ parse_one_reloption()

static void parse_one_reloption ( relopt_value option,
char *  text_str,
int  text_len,
bool  validate 
)
static

Definition at line 1588 of file reloptions.c.

1590{
1591 char *value;
1592 int value_len;
1593 bool parsed;
1594 bool nofree = false;
1595
1596 if (option->isset && validate)
1597 ereport(ERROR,
1598 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1599 errmsg("parameter \"%s\" specified more than once",
1600 option->gen->name)));
1601
1602 value_len = text_len - option->gen->namelen - 1;
1603 value = (char *) palloc(value_len + 1);
1604 memcpy(value, text_str + option->gen->namelen + 1, value_len);
1605 value[value_len] = '\0';
1606
1607 switch (option->gen->type)
1608 {
1609 case RELOPT_TYPE_BOOL:
1610 {
1611 parsed = parse_bool(value, &option->values.bool_val);
1612 if (validate && !parsed)
1613 ereport(ERROR,
1614 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1615 errmsg("invalid value for boolean option \"%s\": %s",
1616 option->gen->name, value)));
1617 }
1618 break;
1619 case RELOPT_TYPE_INT:
1620 {
1621 relopt_int *optint = (relopt_int *) option->gen;
1622
1623 parsed = parse_int(value, &option->values.int_val, 0, NULL);
1624 if (validate && !parsed)
1625 ereport(ERROR,
1626 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1627 errmsg("invalid value for integer option \"%s\": %s",
1628 option->gen->name, value)));
1629 if (validate && (option->values.int_val < optint->min ||
1630 option->values.int_val > optint->max))
1631 ereport(ERROR,
1632 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1633 errmsg("value %s out of bounds for option \"%s\"",
1634 value, option->gen->name),
1635 errdetail("Valid values are between \"%d\" and \"%d\".",
1636 optint->min, optint->max)));
1637 }
1638 break;
1639 case RELOPT_TYPE_REAL:
1640 {
1641 relopt_real *optreal = (relopt_real *) option->gen;
1642
1643 parsed = parse_real(value, &option->values.real_val, 0, NULL);
1644 if (validate && !parsed)
1645 ereport(ERROR,
1646 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1647 errmsg("invalid value for floating point option \"%s\": %s",
1648 option->gen->name, value)));
1649 if (validate && (option->values.real_val < optreal->min ||
1650 option->values.real_val > optreal->max))
1651 ereport(ERROR,
1652 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1653 errmsg("value %s out of bounds for option \"%s\"",
1654 value, option->gen->name),
1655 errdetail("Valid values are between \"%f\" and \"%f\".",
1656 optreal->min, optreal->max)));
1657 }
1658 break;
1659 case RELOPT_TYPE_ENUM:
1660 {
1661 relopt_enum *optenum = (relopt_enum *) option->gen;
1663
1664 parsed = false;
1665 for (elt = optenum->members; elt->string_val; elt++)
1666 {
1667 if (pg_strcasecmp(value, elt->string_val) == 0)
1668 {
1669 option->values.enum_val = elt->symbol_val;
1670 parsed = true;
1671 break;
1672 }
1673 }
1674 if (validate && !parsed)
1675 ereport(ERROR,
1676 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1677 errmsg("invalid value for enum option \"%s\": %s",
1678 option->gen->name, value),
1679 optenum->detailmsg ?
1680 errdetail_internal("%s", _(optenum->detailmsg)) : 0));
1681
1682 /*
1683 * If value is not among the allowed string values, but we are
1684 * not asked to validate, just use the default numeric value.
1685 */
1686 if (!parsed)
1687 option->values.enum_val = optenum->default_val;
1688 }
1689 break;
1690 case RELOPT_TYPE_STRING:
1691 {
1692 relopt_string *optstring = (relopt_string *) option->gen;
1693
1694 option->values.string_val = value;
1695 nofree = true;
1696 if (validate && optstring->validate_cb)
1697 (optstring->validate_cb) (value);
1698 parsed = true;
1699 }
1700 break;
1701 default:
1702 elog(ERROR, "unsupported reloption type %d", option->gen->type);
1703 parsed = true; /* quiet compiler */
1704 break;
1705 }
1706
1707 if (parsed)
1708 option->isset = true;
1709 if (!nofree)
1710 pfree(value);
1711}
bool parse_bool(const char *value, bool *result)
Definition: bool.c:31
int errdetail_internal(const char *fmt,...)
Definition: elog.c:1230
int errdetail(const char *fmt,...)
Definition: elog.c:1203
#define _(x)
Definition: elog.c:90
bool parse_int(const char *value, int *result, int flags, const char **hintmsg)
Definition: guc.c:2871
bool parse_real(const char *value, double *result, int flags, const char **hintmsg)
Definition: guc.c:2961
for(;;)
static struct @162 value
int pg_strcasecmp(const char *s1, const char *s2)
Definition: pgstrcasecmp.c:36
const char * name
Definition: getopt_long.h:19
const char * string_val
Definition: reloptions.h:119

References _, relopt_enum::default_val, relopt_enum::detailmsg, elog, ereport, errcode(), errdetail(), errdetail_internal(), errmsg(), ERROR, for(), if(), relopt_int::max, relopt_real::max, relopt_enum::members, relopt_int::min, relopt_real::min, option::name, palloc(), parse_bool(), parse_int(), parse_real(), pfree(), pg_strcasecmp(), RELOPT_TYPE_BOOL, RELOPT_TYPE_ENUM, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, RELOPT_TYPE_STRING, relopt_enum_elt_def::string_val, relopt_string::validate_cb, and value.

Referenced by parseRelOptionsInternal().

◆ parseLocalRelOptions()

static relopt_value * parseLocalRelOptions ( local_relopts relopts,
Datum  options,
bool  validate 
)
static

Definition at line 1560 of file reloptions.c.

1561{
1562 int nopts = list_length(relopts->options);
1563 relopt_value *values = palloc(sizeof(*values) * nopts);
1564 ListCell *lc;
1565 int i = 0;
1566
1567 foreach(lc, relopts->options)
1568 {
1569 local_relopt *opt = lfirst(lc);
1570
1571 values[i].gen = opt->option;
1572 values[i].isset = false;
1573
1574 i++;
1575 }
1576
1577 if (options != (Datum) 0)
1578 parseRelOptionsInternal(options, validate, values, nopts);
1579
1580 return values;
1581}
static void parseRelOptionsInternal(Datum options, bool validate, relopt_value *reloptions, int numoptions)
Definition: reloptions.c:1446

References i, lfirst, list_length(), local_relopt::option, local_relopts::options, palloc(), parseRelOptionsInternal(), and values.

Referenced by build_local_reloptions().

◆ parseRelOptions()

static relopt_value * parseRelOptions ( Datum  options,
bool  validate,
relopt_kind  kind,
int *  numrelopts 
)
static

Definition at line 1518 of file reloptions.c.

1520{
1521 relopt_value *reloptions = NULL;
1522 int numoptions = 0;
1523 int i;
1524 int j;
1525
1528
1529 /* Build a list of expected options, based on kind */
1530
1531 for (i = 0; relOpts[i]; i++)
1532 if (relOpts[i]->kinds & kind)
1533 numoptions++;
1534
1535 if (numoptions > 0)
1536 {
1537 reloptions = palloc(numoptions * sizeof(relopt_value));
1538
1539 for (i = 0, j = 0; relOpts[i]; i++)
1540 {
1541 if (relOpts[i]->kinds & kind)
1542 {
1543 reloptions[j].gen = relOpts[i];
1544 reloptions[j].isset = false;
1545 j++;
1546 }
1547 }
1548 }
1549
1550 /* Done if no options */
1552 parseRelOptionsInternal(options, validate, reloptions, numoptions);
1553
1554 *numrelopts = numoptions;
1555 return reloptions;
1556}

References DatumGetPointer(), relopt_value::gen, i, initialize_reloptions(), relopt_value::isset, j, need_initialization, palloc(), parseRelOptionsInternal(), PointerIsValid, and relOpts.

Referenced by build_reloptions().

◆ parseRelOptionsInternal()

static void parseRelOptionsInternal ( Datum  options,
bool  validate,
relopt_value reloptions,
int  numoptions 
)
static

Definition at line 1446 of file reloptions.c.

1448{
1450 Datum *optiondatums;
1451 int noptions;
1452 int i;
1453
1454 deconstruct_array_builtin(array, TEXTOID, &optiondatums, NULL, &noptions);
1455
1456 for (i = 0; i < noptions; i++)
1457 {
1458 char *text_str = VARDATA(optiondatums[i]);
1459 int text_len = VARSIZE(optiondatums[i]) - VARHDRSZ;
1460 int j;
1461
1462 /* Search for a match in reloptions */
1463 for (j = 0; j < numoptions; j++)
1464 {
1465 int kw_len = reloptions[j].gen->namelen;
1466
1467 if (text_len > kw_len && text_str[kw_len] == '=' &&
1468 strncmp(text_str, reloptions[j].gen->name, kw_len) == 0)
1469 {
1470 parse_one_reloption(&reloptions[j], text_str, text_len,
1471 validate);
1472 break;
1473 }
1474 }
1475
1476 if (j >= numoptions && validate)
1477 {
1478 char *s;
1479 char *p;
1480
1481 s = TextDatumGetCString(optiondatums[i]);
1482 p = strchr(s, '=');
1483 if (p)
1484 *p = '\0';
1485 ereport(ERROR,
1486 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1487 errmsg("unrecognized parameter \"%s\"", s)));
1488 }
1489 }
1490
1491 /* It's worth avoiding memory leaks in this function */
1492 pfree(optiondatums);
1493
1494 if (((void *) array) != DatumGetPointer(options))
1495 pfree(array);
1496}
#define DatumGetArrayTypeP(X)
Definition: array.h:261
void deconstruct_array_builtin(ArrayType *array, Oid elmtype, Datum **elemsp, bool **nullsp, int *nelemsp)
Definition: arrayfuncs.c:3697
#define TextDatumGetCString(d)
Definition: builtins.h:98
#define VARHDRSZ
Definition: c.h:649
static void parse_one_reloption(relopt_value *option, char *text_str, int text_len, bool validate)
Definition: reloptions.c:1588
#define VARDATA(PTR)
Definition: varatt.h:278
#define VARSIZE(PTR)
Definition: varatt.h:279

References DatumGetArrayTypeP, DatumGetPointer(), deconstruct_array_builtin(), ereport, errcode(), errmsg(), ERROR, relopt_value::gen, i, j, relopt_gen::namelen, noptions, parse_one_reloption(), pfree(), TextDatumGetCString, VARDATA, VARHDRSZ, and VARSIZE.

Referenced by parseLocalRelOptions(), and parseRelOptions().

◆ partitioned_table_reloptions()

bytea * partitioned_table_reloptions ( Datum  reloptions,
bool  validate 
)

Definition at line 2007 of file reloptions.c.

2008{
2009 if (validate && reloptions)
2010 ereport(ERROR,
2011 errcode(ERRCODE_WRONG_OBJECT_TYPE),
2012 errmsg("cannot specify storage parameters for a partitioned table"),
2013 errhint("Specify storage parameters for its leaf partitions instead."));
2014 return NULL;
2015}
int errhint(const char *fmt,...)
Definition: elog.c:1317

References ereport, errcode(), errhint(), errmsg(), and ERROR.

Referenced by ATExecSetRelOptions(), DefineRelation(), and extractRelOptions().

◆ register_reloptions_validator()

void register_reloptions_validator ( local_relopts relopts,
relopts_validator  validator 
)

Definition at line 766 of file reloptions.c.

767{
768 relopts->validators = lappend(relopts->validators, validator);
769}

References lappend(), and local_relopts::validators.

Referenced by ltree_gist_options().

◆ tablespace_reloptions()

bytea * tablespace_reloptions ( Datum  reloptions,
bool  validate 
)

Definition at line 2109 of file reloptions.c.

2110{
2111 static const relopt_parse_elt tab[] = {
2112 {"random_page_cost", RELOPT_TYPE_REAL, offsetof(TableSpaceOpts, random_page_cost)},
2113 {"seq_page_cost", RELOPT_TYPE_REAL, offsetof(TableSpaceOpts, seq_page_cost)},
2114 {"effective_io_concurrency", RELOPT_TYPE_INT, offsetof(TableSpaceOpts, effective_io_concurrency)},
2115 {"maintenance_io_concurrency", RELOPT_TYPE_INT, offsetof(TableSpaceOpts, maintenance_io_concurrency)}
2116 };
2117
2118 return (bytea *) build_reloptions(reloptions, validate,
2120 sizeof(TableSpaceOpts),
2121 tab, lengthof(tab));
2122}
int maintenance_io_concurrency
Definition: bufmgr.c:158
int effective_io_concurrency
Definition: bufmgr.c:151
double random_page_cost
Definition: costsize.c:131
double seq_page_cost
Definition: costsize.c:130
@ RELOPT_KIND_TABLESPACE
Definition: reloptions.h:49

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().

◆ transformRelOptions()

Datum transformRelOptions ( Datum  oldOptions,
List defList,
const char *  namspace,
const char *const  validnsps[],
bool  acceptOidsOff,
bool  isReset 
)

Definition at line 1175 of file reloptions.c.

1177{
1178 Datum result;
1179 ArrayBuildState *astate;
1180 ListCell *cell;
1181
1182 /* no change if empty list */
1183 if (defList == NIL)
1184 return oldOptions;
1185
1186 /* We build new array using accumArrayResult */
1187 astate = NULL;
1188
1189 /* Copy any oldOptions that aren't to be replaced */
1190 if (PointerIsValid(DatumGetPointer(oldOptions)))
1191 {
1192 ArrayType *array = DatumGetArrayTypeP(oldOptions);
1193 Datum *oldoptions;
1194 int noldoptions;
1195 int i;
1196
1197 deconstruct_array_builtin(array, TEXTOID, &oldoptions, NULL, &noldoptions);
1198
1199 for (i = 0; i < noldoptions; i++)
1200 {
1201 char *text_str = VARDATA(oldoptions[i]);
1202 int text_len = VARSIZE(oldoptions[i]) - VARHDRSZ;
1203
1204 /* Search for a match in defList */
1205 foreach(cell, defList)
1206 {
1207 DefElem *def = (DefElem *) lfirst(cell);
1208 int kw_len;
1209
1210 /* ignore if not in the same namespace */
1211 if (namspace == NULL)
1212 {
1213 if (def->defnamespace != NULL)
1214 continue;
1215 }
1216 else if (def->defnamespace == NULL)
1217 continue;
1218 else if (strcmp(def->defnamespace, namspace) != 0)
1219 continue;
1220
1221 kw_len = strlen(def->defname);
1222 if (text_len > kw_len && text_str[kw_len] == '=' &&
1223 strncmp(text_str, def->defname, kw_len) == 0)
1224 break;
1225 }
1226 if (!cell)
1227 {
1228 /* No match, so keep old option */
1229 astate = accumArrayResult(astate, oldoptions[i],
1230 false, TEXTOID,
1232 }
1233 }
1234 }
1235
1236 /*
1237 * If CREATE/SET, add new options to array; if RESET, just check that the
1238 * user didn't say RESET (option=val). (Must do this because the grammar
1239 * doesn't enforce it.)
1240 */
1241 foreach(cell, defList)
1242 {
1243 DefElem *def = (DefElem *) lfirst(cell);
1244
1245 if (isReset)
1246 {
1247 if (def->arg != NULL)
1248 ereport(ERROR,
1249 (errcode(ERRCODE_SYNTAX_ERROR),
1250 errmsg("RESET must not include values for parameters")));
1251 }
1252 else
1253 {
1254 text *t;
1255 const char *value;
1256 Size len;
1257
1258 /*
1259 * Error out if the namespace is not valid. A NULL namespace is
1260 * always valid.
1261 */
1262 if (def->defnamespace != NULL)
1263 {
1264 bool valid = false;
1265 int i;
1266
1267 if (validnsps)
1268 {
1269 for (i = 0; validnsps[i]; i++)
1270 {
1271 if (strcmp(def->defnamespace, validnsps[i]) == 0)
1272 {
1273 valid = true;
1274 break;
1275 }
1276 }
1277 }
1278
1279 if (!valid)
1280 ereport(ERROR,
1281 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1282 errmsg("unrecognized parameter namespace \"%s\"",
1283 def->defnamespace)));
1284 }
1285
1286 /* ignore if not in the same namespace */
1287 if (namspace == NULL)
1288 {
1289 if (def->defnamespace != NULL)
1290 continue;
1291 }
1292 else if (def->defnamespace == NULL)
1293 continue;
1294 else if (strcmp(def->defnamespace, namspace) != 0)
1295 continue;
1296
1297 /*
1298 * Flatten the DefElem into a text string like "name=arg". If we
1299 * have just "name", assume "name=true" is meant. Note: the
1300 * namespace is not output.
1301 */
1302 if (def->arg != NULL)
1303 value = defGetString(def);
1304 else
1305 value = "true";
1306
1307 /*
1308 * This is not a great place for this test, but there's no other
1309 * convenient place to filter the option out. As WITH (oids =
1310 * false) will be removed someday, this seems like an acceptable
1311 * amount of ugly.
1312 */
1313 if (acceptOidsOff && def->defnamespace == NULL &&
1314 strcmp(def->defname, "oids") == 0)
1315 {
1316 if (defGetBoolean(def))
1317 ereport(ERROR,
1318 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1319 errmsg("tables declared WITH OIDS are not supported")));
1320 /* skip over option, reloptions machinery doesn't know it */
1321 continue;
1322 }
1323
1324 len = VARHDRSZ + strlen(def->defname) + 1 + strlen(value);
1325 /* +1 leaves room for sprintf's trailing null */
1326 t = (text *) palloc(len + 1);
1327 SET_VARSIZE(t, len);
1328 sprintf(VARDATA(t), "%s=%s", def->defname, value);
1329
1330 astate = accumArrayResult(astate, PointerGetDatum(t),
1331 false, TEXTOID,
1333 }
1334 }
1335
1336 if (astate)
1337 result = makeArrayResult(astate, CurrentMemoryContext);
1338 else
1339 result = (Datum) 0;
1340
1341 return result;
1342}
ArrayBuildState * accumArrayResult(ArrayBuildState *astate, Datum dvalue, bool disnull, Oid element_type, MemoryContext rcontext)
Definition: arrayfuncs.c:5350
Datum makeArrayResult(ArrayBuildState *astate, MemoryContext rcontext)
Definition: arrayfuncs.c:5420
char * defGetString(DefElem *def)
Definition: define.c:35
bool defGetBoolean(DefElem *def)
Definition: define.c:94
MemoryContext CurrentMemoryContext
Definition: mcxt.c:143
const void size_t len
#define sprintf
Definition: port.h:241
static Datum PointerGetDatum(const void *X)
Definition: postgres.h:327
char * defnamespace
Definition: parsenodes.h:825
Node * arg
Definition: parsenodes.h:827

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().

◆ untransformRelOptions()

List * untransformRelOptions ( Datum  options)

Definition at line 1350 of file reloptions.c.

1351{
1352 List *result = NIL;
1353 ArrayType *array;
1354 Datum *optiondatums;
1355 int noptions;
1356 int i;
1357
1358 /* Nothing to do if no options */
1360 return result;
1361
1362 array = DatumGetArrayTypeP(options);
1363
1364 deconstruct_array_builtin(array, TEXTOID, &optiondatums, NULL, &noptions);
1365
1366 for (i = 0; i < noptions; i++)
1367 {
1368 char *s;
1369 char *p;
1370 Node *val = NULL;
1371
1372 s = TextDatumGetCString(optiondatums[i]);
1373 p = strchr(s, '=');
1374 if (p)
1375 {
1376 *p++ = '\0';
1377 val = (Node *) makeString(p);
1378 }
1379 result = lappend(result, makeDefElem(s, val, -1));
1380 }
1381
1382 return result;
1383}
DefElem * makeDefElem(char *name, Node *arg, int location)
Definition: makefuncs.c:590
Definition: pg_list.h:54
Definition: nodes.h:129
String * makeString(char *str)
Definition: value.c:63

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(), pg_options_to_table(), postgres_fdw_validator(), postgresql_fdw_validator(), and transformGenericOptions().

◆ view_reloptions()

bytea * view_reloptions ( Datum  reloptions,
bool  validate 
)

Definition at line 2021 of file reloptions.c.

2022{
2023 static const relopt_parse_elt tab[] = {
2024 {"security_barrier", RELOPT_TYPE_BOOL,
2025 offsetof(ViewOptions, security_barrier)},
2026 {"security_invoker", RELOPT_TYPE_BOOL,
2027 offsetof(ViewOptions, security_invoker)},
2028 {"check_option", RELOPT_TYPE_ENUM,
2029 offsetof(ViewOptions, check_option)}
2030 };
2031
2032 return (bytea *) build_reloptions(reloptions, validate,
2034 sizeof(ViewOptions),
2035 tab, lengthof(tab));
2036}
@ RELOPT_KIND_VIEW
Definition: reloptions.h:51

References build_reloptions(), lengthof, RELOPT_KIND_VIEW, RELOPT_TYPE_BOOL, and RELOPT_TYPE_ENUM.

Referenced by ATExecSetRelOptions(), DefineRelation(), and extractRelOptions().

Variable Documentation

◆ boolRelOpts

relopt_bool boolRelOpts[]
static

Definition at line 94 of file reloptions.c.

Referenced by initialize_reloptions().

◆ custom_options

relopt_gen** custom_options = NULL
static

Definition at line 576 of file reloptions.c.

Referenced by add_reloption(), and initialize_reloptions().

◆ enumRelOpts

relopt_enum enumRelOpts[]
static

Definition at line 527 of file reloptions.c.

Referenced by initialize_reloptions().

◆ gistBufferingOptValues

relopt_enum_elt_def gistBufferingOptValues[]
static
Initial value:
=
{
{(const char *) NULL}
}
@ GIST_OPTION_BUFFERING_OFF
Definition: gist_private.h:388
@ GIST_OPTION_BUFFERING_AUTO
Definition: gist_private.h:386
@ GIST_OPTION_BUFFERING_ON
Definition: gist_private.h:387

Definition at line 510 of file reloptions.c.

◆ intRelOpts

relopt_int intRelOpts[]
static

Definition at line 173 of file reloptions.c.

Referenced by initialize_reloptions().

◆ last_assigned_kind

bits32 last_assigned_kind = RELOPT_KIND_LAST_DEFAULT
static

Definition at line 573 of file reloptions.c.

Referenced by add_reloption_kind().

◆ need_initialization

bool need_initialization = true
static

◆ num_custom_options

int num_custom_options = 0
static

Definition at line 575 of file reloptions.c.

Referenced by add_reloption(), and initialize_reloptions().

◆ realRelOpts

relopt_real realRelOpts[]
static

Definition at line 397 of file reloptions.c.

Referenced by initialize_reloptions().

◆ relOpts

relopt_gen** relOpts = NULL
static

◆ StdRdOptIndexCleanupValues

relopt_enum_elt_def StdRdOptIndexCleanupValues[]
static
Initial value:

Definition at line 495 of file reloptions.c.

◆ stringRelOpts

relopt_string stringRelOpts[]
static
Initial value:
=
{
{{NULL}}
}

Definition at line 566 of file reloptions.c.

Referenced by initialize_reloptions().

◆ viewCheckOptValues

relopt_enum_elt_def viewCheckOptValues[]
static
Initial value:
=
{
{(const char *) NULL}
}
@ VIEW_OPTION_CHECK_OPTION_LOCAL
Definition: rel.h:412
@ VIEW_OPTION_CHECK_OPTION_CASCADED
Definition: rel.h:413

Definition at line 519 of file reloptions.c.