PostgreSQL Source Code git master
|
#include "postgres_fe.h"
#include <limits.h>
#include "catalog/pg_class_d.h"
#include "common.h"
#include "common/logging.h"
#include "fe_utils/cancel.h"
#include "fe_utils/option_utils.h"
#include "fe_utils/parallel_slot.h"
#include "fe_utils/query_utils.h"
#include "fe_utils/simple_list.h"
#include "fe_utils/string_utils.h"
Go to the source code of this file.
Typedefs | |
typedef enum ReindexType | ReindexType |
Enumerations | |
enum | ReindexType { REINDEX_DATABASE , REINDEX_INDEX , REINDEX_SCHEMA , REINDEX_SYSTEM , REINDEX_TABLE } |
Functions | |
static SimpleStringList * | get_parallel_object_list (PGconn *conn, ReindexType type, SimpleStringList *user_list, bool echo) |
static void | reindex_one_database (ConnParams *cparams, ReindexType type, SimpleStringList *user_list, const char *progname, bool echo, bool verbose, bool concurrently, int concurrentCons, const char *tablespace) |
static void | reindex_all_databases (ConnParams *cparams, const char *progname, bool echo, bool quiet, bool verbose, bool concurrently, int concurrentCons, const char *tablespace, bool syscatalog, SimpleStringList *schemas, SimpleStringList *tables, SimpleStringList *indexes) |
static void | run_reindex_command (PGconn *conn, ReindexType type, const char *name, bool echo, bool verbose, bool concurrently, bool async, const char *tablespace) |
static void | help (const char *progname) |
int | main (int argc, char *argv[]) |
typedef enum ReindexType ReindexType |
enum ReindexType |
Enumerator | |
---|---|
REINDEX_DATABASE | |
REINDEX_INDEX | |
REINDEX_SCHEMA | |
REINDEX_SYSTEM | |
REINDEX_TABLE |
Definition at line 26 of file reindexdb.c.
|
static |
Definition at line 622 of file reindexdb.c.
References appendPQExpBufferStr(), appendQualifiedRelation(), appendStringLiteralConn(), Assert, buf, conn, CppAsString2, PQExpBufferData::data, executeQuery(), fmtQualifiedId(), SimpleStringList::head, i, initPQExpBuffer(), SimpleStringListCell::next, pg_malloc0(), PQclear(), PQfinish(), PQgetvalue(), PQntuples(), REINDEX_DATABASE, REINDEX_INDEX, REINDEX_SCHEMA, REINDEX_SYSTEM, REINDEX_TABLE, res, resetPQExpBuffer(), simple_string_list_append(), simple_string_list_destroy(), SimpleStringList::tail, termPQExpBuffer(), type, and SimpleStringListCell::val.
Referenced by reindex_one_database().
|
static |
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 60 of file reindexdb.c.
References dbname, _connParams::dbname, exit(), get_progname(), get_user_name_or_exit(), getopt_long(), handle_help_version_opts(), SimpleStringList::head, help(), no_argument, optarg, optind, option_parse_int(), _connParams::override_dbname, pg_fatal, pg_log_error, pg_log_error_hint, pg_logging_init(), pg_strdup(), PG_TEXTDOMAIN, _connParams::pghost, _connParams::pgport, _connParams::pguser, port, progname, _connParams::prompt_password, reindex_all_databases(), REINDEX_DATABASE, REINDEX_INDEX, reindex_one_database(), REINDEX_SCHEMA, REINDEX_SYSTEM, REINDEX_TABLE, required_argument, set_pglocale_pgservice(), setup_cancel_handler(), simple_string_list_append(), tablespace, TRI_DEFAULT, TRI_NO, TRI_YES, username, and verbose.
|
static |
Definition at line 804 of file reindexdb.c.
References _, conn, connectMaintenanceDatabase(), dbname, executeQuery(), fflush(), SimpleStringList::head, i, _connParams::override_dbname, PQclear(), PQfinish(), PQgetvalue(), PQntuples(), printf, progname, REINDEX_DATABASE, REINDEX_INDEX, reindex_one_database(), REINDEX_SCHEMA, REINDEX_SYSTEM, REINDEX_TABLE, generate_unaccent_rules::stdout, tablespace, and verbose.
Referenced by main().
|
static |
Definition at line 271 of file reindexdb.c.
References Assert, CancelRequested, conn, connectDatabase(), ParallelSlot::connection, exit(), get_parallel_object_list(), SimpleStringList::head, Min, SimpleStringListCell::next, ParallelSlotsAdoptConn(), ParallelSlotSetHandler(), ParallelSlotsGetIdle(), ParallelSlotsSetup(), ParallelSlotsTerminate(), ParallelSlotsWaitCompletion(), pfree(), pg_fatal, pg_free(), pg_malloc0(), PQdb(), PQfinish(), PQserverVersion(), progname, REINDEX_DATABASE, REINDEX_INDEX, REINDEX_SCHEMA, REINDEX_SYSTEM, REINDEX_TABLE, run_reindex_command(), simple_string_list_append(), simple_string_list_destroy(), TableCommandResultHandler(), tablespace, type, SimpleStringListCell::val, and verbose.
Referenced by main(), and reindex_all_databases().
|
static |
Definition at line 489 of file reindexdb.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendQualifiedRelation(), Assert, comma, conn, PQExpBufferData::data, executeMaintenanceCommand(), exit(), fmtId(), initPQExpBuffer(), name, pg_log_error, PQdb(), PQerrorMessage(), PQfinish(), PQsendQuery(), printf, REINDEX_DATABASE, REINDEX_INDEX, REINDEX_SCHEMA, REINDEX_SYSTEM, REINDEX_TABLE, tablespace, termPQExpBuffer(), type, and verbose.
Referenced by reindex_one_database().