28{
29 static struct option long_options[] = {
62 {NULL, 0, NULL, 0}
63 };
64
66 int optindex;
69 const char *maintenance_db = NULL;
71 bool echo = false;
72 bool quiet = false;
75 int concurrentCons = 1;
76 unsigned int tbl_count = 0;
77 int ret;
78
79
80 memset(&vacopts, 0, sizeof(vacopts));
89
90
91 memset(&cparams, 0, sizeof(cparams));
93
97
99
100 while ((
c =
getopt_long(argc, argv,
"ad:efFh:j:n:N:p:P:qt:U:vwWzZ",
101 long_options, &optindex)) != -1)
102 {
104 {
105 case 'a':
107 break;
108 case 'd':
111 break;
112 case 'e':
113 echo = true;
114 break;
115 case 'f':
117 break;
118 case 'F':
120 break;
121 case 'h':
123 break;
124 case 'j':
126 &concurrentCons))
127 exit(1);
128 break;
129 case 'n':
132 break;
133 case 'N':
136 break;
137 case 'p':
139 break;
140 case 'P':
143 exit(1);
144 break;
145 case 'q':
146 quiet = true;
147 break;
148 case 't':
151 tbl_count++;
152 break;
153 case 'U':
155 break;
156 case 'v':
158 break;
159 case 'w':
161 break;
162 case 'W':
164 break;
165 case 'z':
167 break;
168 case 'Z':
169
172 break;
173 case 2:
175 break;
176 case 3:
178 break;
179 case 4:
181 break;
182 case 5:
184 break;
185 case 6:
188 exit(1);
189 break;
190 case 7:
193 exit(1);
194 break;
195 case 8:
197 break;
198 case 9:
200 break;
201 case 10:
203 break;
204 case 11:
206 break;
207 case 12:
209 break;
210 case 13:
212 break;
213 case 14:
215 break;
216 default:
217
219 exit(1);
220 }
221 }
222
223
224
225
226
228 {
232 }
233
235 {
236 pg_log_error(
"too many command-line arguments (first is \"%s\")",
239 exit(1);
240 }
241
242
243
244
245
247
250 {
252 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
253 "full");
255 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
256 "freeze");
258 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
259 "disable-page-skipping");
261 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
262 "no-index-cleanup");
264 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
265 "force-index-cleanup");
267 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
268 "no-truncate");
270 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
271 "no-process-main");
273 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
274 "no-process-toast");
275
276 }
277
278
280 {
283 pg_fatal(
"cannot use the \"%s\" option when performing only analyze",
284 "parallel");
286 pg_fatal(
"cannot use the \"%s\" option when performing full vacuum",
287 "parallel");
288 }
289
290
292 pg_fatal(
"cannot use the \"%s\" option with the \"%s\" option",
293 "no-index-cleanup", "force-index-cleanup");
294
295
296
297
298
300 pg_fatal(
"cannot use the \"%s\" option with the \"%s\" option",
301 "buffer-usage-limit", "full");
302
303
304
305
306
309 pg_fatal(
"cannot use the \"%s\" option without \"%s\" or \"%s\"",
310 "missing-stats-only", "analyze-only", "analyze-in-stages");
311
313 &objects, tbl_count,
314 concurrentCons,
316 exit(ret);
317}
#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, bool echo, bool quiet)