MCPcopy Create free account
hub / github.com/apache/cloudberry / main

Function main

src/bin/scripts/reindexdb.c:55–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53static void help(const char *progname);
54
55int
56main(int argc, char *argv[])
57{
58 static struct option long_options[] = {
59 {"host", required_argument, NULL, 'h'},
60 {"port", required_argument, NULL, 'p'},
61 {"username", required_argument, NULL, 'U'},
62 {"no-password", no_argument, NULL, 'w'},
63 {"password", no_argument, NULL, 'W'},
64 {"echo", no_argument, NULL, 'e'},
65 {"quiet", no_argument, NULL, 'q'},
66 {"schema", required_argument, NULL, 'S'},
67 {"dbname", required_argument, NULL, 'd'},
68 {"all", no_argument, NULL, 'a'},
69 {"system", no_argument, NULL, 's'},
70 {"table", required_argument, NULL, 't'},
71 {"index", required_argument, NULL, 'i'},
72 {"jobs", required_argument, NULL, 'j'},
73 {"verbose", no_argument, NULL, 'v'},
74 {"concurrently", no_argument, NULL, 1},
75 {"maintenance-db", required_argument, NULL, 2},
76 {"tablespace", required_argument, NULL, 3},
77 {NULL, 0, NULL, 0}
78 };
79
80 const char *progname;
81 int optindex;
82 int c;
83
84 const char *dbname = NULL;
85 const char *maintenance_db = NULL;
86 const char *host = NULL;
87 const char *port = NULL;
88 const char *username = NULL;
89 const char *tablespace = NULL;
90 enum trivalue prompt_password = TRI_DEFAULT;
91 ConnParams cparams;
92 bool syscatalog = false;
93 bool alldb = false;
94 bool echo = false;
95 bool quiet = false;
96 bool verbose = false;
97 bool concurrently = false;
98 SimpleStringList indexes = {NULL, NULL};
99 SimpleStringList tables = {NULL, NULL};
100 SimpleStringList schemas = {NULL, NULL};
101 int concurrentCons = 1;
102
103 pg_logging_init(argv[0]);
104 progname = get_progname(argv[0]);
105 set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
106
107 handle_help_version_opts(argc, argv, "reindexdb", help);
108
109 /* process command-line options */
110 while ((c = getopt_long(argc, argv, "h:p:U:wWeqS:d:ast:i:j:v", long_options, &optindex)) != -1)
111 {
112 switch (c)

Callers

nothing calls this directly

Calls 11

pg_logging_initFunction · 0.85
get_prognameFunction · 0.85
set_pglocale_pgserviceFunction · 0.85
handle_help_version_optsFunction · 0.85
getopt_longFunction · 0.85
pg_strdupFunction · 0.85
reindex_all_databasesFunction · 0.85
get_user_name_or_exitFunction · 0.85
reindex_one_databaseFunction · 0.85
setup_cancel_handlerFunction · 0.50

Tested by

no test coverage detected