Definition at line 27 of file vacuumdb.c.
28{
29 static struct option long_options[] = {
63 {NULL, 0, NULL, 0}
64 };
65
67 int optindex;
70 const char *maintenance_db = NULL;
74 int concurrentCons = 1;
75 unsigned int tbl_count = 0;
76 int ret;
77
78
79 memset(&vacopts, 0, sizeof(vacopts));
84
85
86 memset(&cparams, 0, sizeof(cparams));
88
92
94
95 while ((
c =
getopt_long(argc, argv,
"ad:efFh:j:n:N:p:P:qt:U:vwWzZ",
96 long_options, &optindex)) != -1)
97 {
99 {
100 case 'a':
102 break;
103 case 'd':
106 break;
107 case 'e':
109 break;
110 case 'f':
112 break;
113 case 'F':
115 break;
116 case 'h':
118 break;
119 case 'j':
121 &concurrentCons))
122 exit(1);
123 break;
124 case 'n':
127 break;
128 case 'N':
131 break;
132 case 'p':
134 break;
135 case 'P':
138 exit(1);
139 break;
140 case 'q':
141 vacopts.
quiet =
true;
142 break;
143 case 't':
146 tbl_count++;
147 break;
148 case 'U':
150 break;
151 case 'v':
153 break;
154 case 'w':
156 break;
157 case 'W':
159 break;
160 case 'z':
162 break;
163 case 'Z':
164
167 break;
168 case 2:
170 break;
171 case 3:
173 break;
174 case 4:
176 break;
177 case 5:
179 break;
180 case 6:
183 exit(1);
184 break;
185 case 7:
188 exit(1);
189 break;
190 case 8:
192 break;
193 case 9:
195 break;
196 case 10:
198 break;
199 case 11:
201 break;
202 case 12:
204 break;
205 case 13:
207 break;
208 case 14:
210 break;
211 case 15:
213 break;
214 default:
215
217 exit(1);
218 }
219 }
220
221
222
223
224
226 {
230 }
231
233 {
234 pg_log_error(
"too many command-line arguments (first is \"%s\")",
237 exit(1);
238 }
239
240
241
242
243
245
248 {
250 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
251 "full");
253 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
254 "freeze");
256 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
257 "disable-page-skipping");
259 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
260 "no-index-cleanup");
262 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
263 "force-index-cleanup");
265 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
266 "no-truncate");
268 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
269 "no-process-main");
271 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
272 "no-process-toast");
273
274 }
275
276
278 {
281 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
282 "parallel");
284 pg_fatal(
"cannot use the \"%s\" option when performing full vacuum",
285 "parallel");
286 }
287
288
290 pg_fatal(
"cannot use the \"%s\" option with the \"%s\" option",
291 "no-index-cleanup", "force-index-cleanup");
292
293
294
295
296
298 pg_fatal(
"cannot use the \"%s\" option with the \"%s\" option",
299 "buffer-usage-limit", "full");
300
301
302
303
304
307 pg_fatal(
"cannot use the \"%s\" option without \"%s\" or \"%s\"",
308 "missing-stats-only", "analyze-only", "analyze-in-stages");
309
312 "No commands will be sent to the server.");
313
315 &objects, tbl_count,
316 concurrentCons,
318 exit(ret);
319}
#define PG_TEXTDOMAIN(domain)
void set_pglocale_pgservice(const char *argv0, const char *app)
char * pg_strdup(const char *in)
int getopt_long(int argc, char *const argv[], const char *optstring, const struct option *longopts, int *longindex)
#define required_argument
static char * escape_quotes(const char *src)
void pg_logging_init(const char *argv0)
#define pg_log_error(...)
#define pg_log_error_hint(...)
bool option_parse_int(const char *optarg, const char *optname, int min_range, int max_range, int *result)
void handle_help_version_opts(int argc, char *argv[], const char *fixed_progname, help_handler hlp)
PGDLLIMPORT char * optarg
const char * get_progname(const char *argv0)
void simple_string_list_append(SimpleStringList *list, const char *val)
enum trivalue prompt_password
bool disable_page_skipping
char * buffer_usage_limit
static void help(const char *progname)
static void check_objfilter(bits32 objfilter)
int vacuuming_main(ConnParams *cparams, const char *dbname, const char *maintenance_db, vacuumingOptions *vacopts, SimpleStringList *objects, unsigned int tbl_count, int concurrentCons, const char *progname)
References vacuumingOptions::and_analyze, vacuumingOptions::buffer_usage_limit, check_objfilter(), dbname, vacuumingOptions::disable_page_skipping, vacuumingOptions::do_truncate, vacuumingOptions::dry_run, vacuumingOptions::echo, escape_quotes(), vacuumingOptions::force_index_cleanup, vacuumingOptions::freeze, vacuumingOptions::full, get_progname(), getopt_long(), handle_help_version_opts(), help(), vacuumingOptions::min_mxid_age, vacuumingOptions::min_xid_age, vacuumingOptions::missing_stats_only, vacuumingOptions::mode, MODE_ANALYZE, MODE_ANALYZE_IN_STAGES, no_argument, vacuumingOptions::no_index_cleanup, vacuumingOptions::objfilter, OBJFILTER_ALL_DBS, OBJFILTER_DATABASE, OBJFILTER_SCHEMA, OBJFILTER_SCHEMA_EXCLUDE, OBJFILTER_TABLE, optarg, optind, option_parse_int(), vacuumingOptions::parallel_workers, pg_fatal, pg_log_error, pg_log_error_hint, pg_log_info, pg_logging_init(), pg_strdup(), PG_TEXTDOMAIN, _connParams::pghost, _connParams::pgport, _connParams::pguser, vacuumingOptions::process_main, vacuumingOptions::process_toast, progname, _connParams::prompt_password, vacuumingOptions::quiet, required_argument, set_pglocale_pgservice(), simple_string_list_append(), vacuumingOptions::skip_locked, TRI_DEFAULT, TRI_NO, TRI_YES, vacuuming_main(), and vacuumingOptions::verbose.