PostgreSQL Source Code git master
|
#include "postgres_fe.h"
#include <ctype.h>
#include <sys/stat.h>
#include "common/string.h"
#include "connectdb.h"
#include "fe_utils/option_utils.h"
#include "fe_utils/string_utils.h"
#include "filter.h"
#include "getopt_long.h"
#include "parallel.h"
#include "pg_backup_utils.h"
Go to the source code of this file.
Data Structures | |
struct | DbOidName |
Typedefs | |
typedef struct DbOidName | DbOidName |
Functions | |
static void | usage (const char *progname) |
static void | read_restore_filters (const char *filename, RestoreOptions *opts) |
static bool | file_exists_in_directory (const char *dir, const char *filename) |
static int | restore_one_database (const char *inputFileSpec, RestoreOptions *opts, int numWorkers, bool append_data, int num) |
static int | read_one_statement (StringInfo inBuf, FILE *pfile) |
static int | restore_all_databases (PGconn *conn, const char *dumpdirpath, SimpleStringList db_exclude_patterns, RestoreOptions *opts, int numWorkers) |
static int | process_global_sql_commands (PGconn *conn, const char *dumpdirpath, const char *outfile) |
static void | copy_or_print_global_file (const char *outfile, FILE *pfile) |
static int | get_dbnames_list_to_restore (PGconn *conn, SimplePtrList *dbname_oid_list, SimpleStringList db_exclude_patterns) |
static int | get_dbname_oid_list_from_mfile (const char *dumpdirpath, SimplePtrList *dbname_oid_list) |
int | main (int argc, char **argv) |
|
static |
Definition at line 1379 of file pg_restore.c.
References MAXPGPATH, OPF, outfile, PG_BINARY_W, pg_fatal, snprintf, and generate_unaccent_rules::stdout.
Referenced by process_global_sql_commands().
|
static |
Definition at line 842 of file pg_restore.c.
References buf, filename, MAXPGPATH, pg_fatal, S_ISREG, snprintf, stat::st_mode, and stat.
Referenced by get_dbname_oid_list_from_mfile(), main(), and restore_all_databases().
|
static |
Definition at line 1038 of file pg_restore.c.
References StringInfoData::data, dbname, file_exists_in_directory(), initStringInfo(), InvalidOid, MAXPGPATH, DbOidName::oid, OidIsValid, PG_BINARY_R, pg_fatal, pg_get_line_buf(), pg_log_info, pg_malloc(), simple_ptr_list_append(), snprintf, DbOidName::str, str, and strlcpy().
Referenced by restore_all_databases().
|
static |
Definition at line 939 of file pg_restore.c.
References appendPQExpBufferStr(), appendStringLiteralConn(), conn, createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), executeQuery(), exit_nicely(), SimpleStringList::head, SimplePtrList::head, InvalidOid, SimpleStringListCell::next, SimplePtrListCell::next, DbOidName::oid, pg_log_error, pg_log_info, pg_strcasecmp(), PGRES_TUPLES_OK, PQclear(), PQfinish(), PQntuples(), PQresultStatus(), processSQLNamePattern(), resetPQExpBuffer(), and DbOidName::str.
Referenced by restore_all_databases().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 86 of file pg_restore.c.
References archCustom, archDirectory, archTar, conn, ConnectDatabase(), disable_triggers, exit_nicely(), file_exists_in_directory(), get_progname(), getopt_long(), SimpleStringList::head, if_exists, init_parallel_dump_utils(), NewRestoreOptions(), no_argument, no_comments, no_data, no_policies, no_publications, no_schema, no_security_labels, no_statistics, no_subscriptions, optarg, optind, option_parse_int(), opts, pg_fatal, pg_log_error, pg_log_error_hint, pg_log_info, pg_log_warning, PG_LOG_WARNING, pg_logging_increase_verbosity(), pg_logging_init(), pg_logging_set_level(), PG_MAX_JOBS, pg_strcasecmp(), pg_strdup(), PG_TEXTDOMAIN, PQfinish(), process_global_sql_commands(), progname, read_restore_filters(), required_argument, restore_all_databases(), restore_one_database(), set_dump_section(), set_pglocale_pgservice(), simple_string_list_append(), simple_string_list_destroy(), statistics_only, AmcheckOptions::strict_names, strict_names, TRI_DEFAULT, TRI_NO, TRI_YES, usage(), use_setsessauth, AmcheckOptions::verbose, with_data, with_schema, and with_statistics.
|
static |
Definition at line 1303 of file pg_restore.c.
References appendStringInfoChar(), appendStringInfoString(), conn, copy_or_print_global_file(), StringInfoData::data, initStringInfo(), MAXPGPATH, outfile, PG_BINARY_R, pg_fatal, pg_log_error, pg_log_info, pg_log_warning, PGRES_COMMAND_OK, PGRES_EMPTY_QUERY, PGRES_TUPLES_OK, PQclear(), PQerrorMessage(), PQexec(), PQresultStatus(), PQuser(), read_one_statement(), and snprintf.
Referenced by main(), and restore_all_databases().
|
static |
Definition at line 863 of file pg_restore.c.
References appendStringInfoChar(), appendStringInfoString(), StringInfoData::data, initStringInfo(), StringInfoData::len, pg_free(), and resetStringInfo().
Referenced by process_global_sql_commands().
|
static |
Definition at line 744 of file pg_restore.c.
References _, Assert(), exit_nicely(), filename, FILTER_COMMAND_TYPE_EXCLUDE, FILTER_COMMAND_TYPE_INCLUDE, FILTER_COMMAND_TYPE_NONE, filter_free(), filter_init(), FILTER_OBJECT_TYPE_DATABASE, FILTER_OBJECT_TYPE_EXTENSION, FILTER_OBJECT_TYPE_FOREIGN_DATA, FILTER_OBJECT_TYPE_FUNCTION, FILTER_OBJECT_TYPE_INDEX, filter_object_type_name(), FILTER_OBJECT_TYPE_NONE, FILTER_OBJECT_TYPE_SCHEMA, FILTER_OBJECT_TYPE_TABLE, FILTER_OBJECT_TYPE_TABLE_AND_CHILDREN, FILTER_OBJECT_TYPE_TABLE_DATA, FILTER_OBJECT_TYPE_TABLE_DATA_AND_CHILDREN, FILTER_OBJECT_TYPE_TRIGGER, filter_read_item(), free, opts, pg_log_filter_error(), and simple_string_list_append().
Referenced by main().
|
static |
Definition at line 1122 of file pg_restore.c.
References conn, ConnectDatabase(), file_exists_in_directory(), get_dbname_oid_list_from_mfile(), get_dbnames_list_to_restore(), SimplePtrList::head, if(), InvalidOid, MAXPGPATH, SimplePtrListCell::next, DbOidName::oid, opts, pfree(), pg_log_info, pg_log_warning, PQfinish(), process_global_sql_commands(), progname, restore_one_database(), simple_ptr_list_destroy(), snprintf, DbOidName::str, and TRI_DEFAULT.
Referenced by main().
|
static |
Definition at line 601 of file pg_restore.c.
References append_data(), CloseArchive(), Archive::exit_on_error, Archive::n_errors, Archive::numWorkers, on_exit_close_archive(), OpenArchive(), opts, PrintTOCSummary(), ProcessArchiveRestoreOptions(), replace_on_exit_close_archive(), RestoreArchive(), SetArchiveOptions(), SortTocFromFile(), AmcheckOptions::verbose, and Archive::verbose.
Referenced by main(), and restore_all_databases().
|
static |
Definition at line 654 of file pg_restore.c.
References _, printf, and progname.
Referenced by main().