@@ -97,117 +97,117 @@ static relopt_int intRelOpts[] =
9797 "Packs table pages only to this percentage" ,
9898 RELOPT_KIND_HEAP
9999 },
100- HEAP_DEFAULT_FILLFACTOR , HEAP_MIN_FILLFACTOR , 100
100+ HEAP_DEFAULT_FILLFACTOR , HEAP_MIN_FILLFACTOR , 100 , 0
101101 },
102102 {
103103 {
104104 "fillfactor" ,
105105 "Packs btree index pages only to this percentage" ,
106106 RELOPT_KIND_BTREE
107107 },
108- BTREE_DEFAULT_FILLFACTOR , BTREE_MIN_FILLFACTOR , 100
108+ BTREE_DEFAULT_FILLFACTOR , BTREE_MIN_FILLFACTOR , 100 , 0
109109 },
110110 {
111111 {
112112 "fillfactor" ,
113113 "Packs hash index pages only to this percentage" ,
114114 RELOPT_KIND_HASH
115115 },
116- HASH_DEFAULT_FILLFACTOR , HASH_MIN_FILLFACTOR , 100
116+ HASH_DEFAULT_FILLFACTOR , HASH_MIN_FILLFACTOR , 100 , 0
117117 },
118118 {
119119 {
120120 "fillfactor" ,
121121 "Packs gist index pages only to this percentage" ,
122122 RELOPT_KIND_GIST
123123 },
124- GIST_DEFAULT_FILLFACTOR , GIST_MIN_FILLFACTOR , 100
124+ GIST_DEFAULT_FILLFACTOR , GIST_MIN_FILLFACTOR , 100 , 0
125125 },
126126 {
127127 {
128128 "fillfactor" ,
129129 "Packs spgist index pages only to this percentage" ,
130130 RELOPT_KIND_SPGIST
131131 },
132- SPGIST_DEFAULT_FILLFACTOR , SPGIST_MIN_FILLFACTOR , 100
132+ SPGIST_DEFAULT_FILLFACTOR , SPGIST_MIN_FILLFACTOR , 100 , 0
133133 },
134134 {
135135 {
136136 "autovacuum_vacuum_threshold" ,
137137 "Minimum number of tuple updates or deletes prior to vacuum" ,
138138 RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
139139 },
140- -1 , 0 , INT_MAX
140+ -1 , 0 , INT_MAX , 0
141141 },
142142 {
143143 {
144144 "autovacuum_analyze_threshold" ,
145145 "Minimum number of tuple inserts, updates or deletes prior to analyze" ,
146146 RELOPT_KIND_HEAP
147147 },
148- -1 , 0 , INT_MAX
148+ -1 , 0 , INT_MAX , 0
149149 },
150150 {
151151 {
152152 "autovacuum_vacuum_cost_delay" ,
153153 "Vacuum cost delay in milliseconds, for autovacuum" ,
154154 RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
155155 },
156- -1 , 0 , 100
156+ -1 , 0 , 100 , GUC_UNIT_MS
157157 },
158158 {
159159 {
160160 "autovacuum_vacuum_cost_limit" ,
161161 "Vacuum cost amount available before napping, for autovacuum" ,
162162 RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
163163 },
164- -1 , 1 , 10000
164+ -1 , 1 , 10000 , 0
165165 },
166166 {
167167 {
168168 "autovacuum_freeze_min_age" ,
169169 "Minimum age at which VACUUM should freeze a table row, for autovacuum" ,
170170 RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
171171 },
172- -1 , 0 , 1000000000
172+ -1 , 0 , 1000000000 , 0
173173 },
174174 {
175175 {
176176 "autovacuum_multixact_freeze_min_age" ,
177177 "Minimum multixact age at which VACUUM should freeze a row multixact's, for autovacuum" ,
178178 RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
179179 },
180- -1 , 0 , 1000000000
180+ -1 , 0 , 1000000000 , 0
181181 },
182182 {
183183 {
184184 "autovacuum_freeze_max_age" ,
185185 "Age at which to autovacuum a table to prevent transaction ID wraparound" ,
186186 RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
187187 },
188- -1 , 100000000 , 2000000000
188+ -1 , 100000000 , 2000000000 , 0
189189 },
190190 {
191191 {
192192 "autovacuum_multixact_freeze_max_age" ,
193193 "Multixact age at which to autovacuum a table to prevent multixact wraparound" ,
194194 RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
195195 },
196- -1 , 100000000 , 2000000000
196+ -1 , 100000000 , 2000000000 , 0
197197 },
198198 {
199199 {
200200 "autovacuum_freeze_table_age" ,
201201 "Age at which VACUUM should perform a full table sweep to freeze row versions" ,
202202 RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
203- }, -1 , 0 , 2000000000
203+ }, -1 , 0 , 2000000000 , 0
204204 },
205205 {
206206 {
207207 "autovacuum_multixact_freeze_table_age" ,
208208 "Age of multixact at which VACUUM should perform a full table sweep to freeze row versions" ,
209209 RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
210- }, -1 , 0 , 2000000000
210+ }, -1 , 0 , 2000000000 , 0
211211 },
212212
213213 /* list terminator */
@@ -503,7 +503,7 @@ add_bool_reloption(bits32 kinds, char *name, char *desc, bool default_val)
503503 */
504504void
505505add_int_reloption (bits32 kinds , char * name , char * desc , int default_val ,
506- int min_val , int max_val )
506+ int min_val , int max_val , int flags_val )
507507{
508508 relopt_int * newoption ;
509509
@@ -512,6 +512,7 @@ add_int_reloption(bits32 kinds, char *name, char *desc, int default_val,
512512 newoption -> default_val = default_val ;
513513 newoption -> min = min_val ;
514514 newoption -> max = max_val ;
515+ newoption -> flags = flags_val ;
515516
516517 add_reloption ((relopt_gen * ) newoption );
517518}
@@ -1000,12 +1001,15 @@ parse_one_reloption(relopt_value *option, char *text_str, int text_len,
10001001 case RELOPT_TYPE_INT :
10011002 {
10021003 relopt_int * optint = (relopt_int * ) option -> gen ;
1004+ const char * hintmsg ;
10031005
1004- parsed = parse_int (value , & option -> values .int_val , 0 , NULL );
1006+ parsed = parse_int (value , & option -> values .int_val ,
1007+ optint -> flags , & hintmsg );
10051008 if (validate && !parsed )
10061009 ereport (ERROR ,
10071010 (errmsg ("invalid value for integer option \"%s\": %s" ,
1008- option -> gen -> name , value )));
1011+ option -> gen -> name , value ),
1012+ hintmsg ? errhint ("%s" , _ (hintmsg )) : 0 ));
10091013 if (validate && (option -> values .int_val < optint -> min ||
10101014 option -> values .int_val > optint -> max ))
10111015 ereport (ERROR ,
0 commit comments