|
PostgreSQL Source Code git master
|
#include "common/compression.h"#include "common/file_utils.h"#include "fe_utils/simple_list.h"#include "libpq-fe.h"

Go to the source code of this file.
Data Structures | |
| struct | _connParams |
| struct | _restoreOptions |
| struct | _dumpOptions |
| struct | Archive |
| struct | CatalogId |
Macros | |
| #define | NUM_PREP_QUERIES (PREPQUERY_GETDOMAINCONSTRAINTS + 1) |
| #define | InvalidDumpId 0 |
| #define | appendStringLiteralAH(buf, str, AH) appendStringLiteral(buf, str, (AH)->encoding, (AH)->std_strings) |
Typedefs | |
| typedef enum trivalue | trivalue |
| typedef enum _archiveFormat | ArchiveFormat |
| typedef enum _archiveMode | ArchiveMode |
| typedef enum _teSection | teSection |
| typedef struct _connParams | ConnParams |
| typedef struct _restoreOptions | RestoreOptions |
| typedef struct _dumpOptions | DumpOptions |
| typedef struct Archive | Archive |
| typedef int | DumpId |
| typedef void(* | SetupWorkerPtrType) (Archive *AH) |
Enumerations | |
| enum | trivalue { TRI_DEFAULT , TRI_NO , TRI_YES , TRI_DEFAULT , TRI_NO , TRI_YES , TRI_DEFAULT , TRI_NO , TRI_YES , TRI_DEFAULT , TRI_NO , TRI_YES } |
| enum | _archiveFormat { archUnknown = 0 , archCustom = 1 , archTar = 3 , archNull = 4 , archDirectory = 5 } |
| enum | _archiveMode { archModeAppend , archModeWrite , archModeRead } |
| enum | _teSection { SECTION_NONE = 1 , SECTION_PRE_DATA , SECTION_DATA , SECTION_POST_DATA } |
| enum | _dumpPreparedQueries { PREPQUERY_DUMPAGG , PREPQUERY_DUMPBASETYPE , PREPQUERY_DUMPCOMPOSITETYPE , PREPQUERY_DUMPDOMAIN , PREPQUERY_DUMPENUMTYPE , PREPQUERY_DUMPFUNC , PREPQUERY_DUMPOPR , PREPQUERY_DUMPRANGETYPE , PREPQUERY_DUMPTABLEATTACH , PREPQUERY_GETATTRIBUTESTATS , PREPQUERY_GETCOLUMNACLS , PREPQUERY_GETDOMAINCONSTRAINTS } |
| #define appendStringLiteralAH | ( | buf, | |
| str, | |||
| AH | |||
| ) | appendStringLiteral(buf, str, (AH)->encoding, (AH)->std_strings) |
Definition at line 343 of file pg_backup.h.
| #define InvalidDumpId 0 |
Definition at line 286 of file pg_backup.h.
| #define NUM_PREP_QUERIES (PREPQUERY_GETDOMAINCONSTRAINTS + 1) |
Definition at line 80 of file pg_backup.h.
| typedef enum _archiveFormat ArchiveFormat |
| typedef enum _archiveMode ArchiveMode |
| typedef struct _connParams ConnParams |
| typedef int DumpId |
Definition at line 284 of file pg_backup.h.
| typedef struct _dumpOptions DumpOptions |
| typedef struct _restoreOptions RestoreOptions |
| typedef void(* SetupWorkerPtrType) (Archive *AH) |
Definition at line 291 of file pg_backup.h.
| typedef enum _teSection teSection |
| enum _archiveFormat |
| Enumerator | |
|---|---|
| archUnknown | |
| archCustom | |
| archTar | |
| archNull | |
| archDirectory | |
Definition at line 39 of file pg_backup.h.
| enum _archiveMode |
| Enumerator | |
|---|---|
| archModeAppend | |
| archModeWrite | |
| archModeRead | |
Definition at line 48 of file pg_backup.h.
| enum _dumpPreparedQueries |
Definition at line 64 of file pg_backup.h.
| enum _teSection |
| Enumerator | |
|---|---|
| SECTION_NONE | |
| SECTION_PRE_DATA | |
| SECTION_DATA | |
| SECTION_POST_DATA | |
Definition at line 55 of file pg_backup.h.
| enum trivalue |
| Enumerator | |
|---|---|
| TRI_DEFAULT | |
| TRI_NO | |
| TRI_YES | |
| TRI_DEFAULT | |
| TRI_NO | |
| TRI_YES | |
| TRI_DEFAULT | |
| TRI_NO | |
| TRI_YES | |
| TRI_DEFAULT | |
| TRI_NO | |
| TRI_YES | |
Definition at line 32 of file pg_backup.h.
| int archprintf | ( | Archive * | AH, |
| const char * | fmt, | ||
| ... | |||
| ) |
Referenced by dumpTableData_copy(), and dumpTableData_insert().
| void archputs | ( | const char * | s, |
| Archive * | AH | ||
| ) |
Definition at line 1651 of file pg_backup_archiver.c.
References WriteData().
Referenced by dumpTableData_insert().
| void CloseArchive | ( | Archive * | AHX | ) |
Definition at line 262 of file pg_backup_archiver.c.
References _archiveHandle::ClosePtr, EndCompressFileHandle(), _archiveHandle::OF, and pg_fatal.
Referenced by main().
| void ConnectDatabaseAhx | ( | Archive * | AHX, |
| const ConnParams * | cparams, | ||
| bool | isReconnect | ||
| ) |
Definition at line 109 of file pg_backup_db.c.
References _check_database_version(), ALWAYS_SECURE_SEARCH_PATH_SQL, ConnectDatabase(), _archiveHandle::connection, _connParams::dbname, ExecuteSqlQueryForSingleRow(), free, notice_processor(), _connParams::override_dbname, password, pg_fatal, pg_strdup(), _connParams::pghost, _connParams::pgport, PQclear, PQconnectionUsedPassword(), PQpass(), PQsetNoticeProcessor(), progname, _connParams::promptPassword, _archiveHandle::savedPassword, set_archive_cancel_info(), simple_prompt(), TRI_NO, TRI_YES, and _connParams::username.
Referenced by CloneArchive(), main(), ReconnectToServer(), restore_toc_entries_postfork(), and RestoreArchive().
| Archive * CreateArchive | ( | const char * | FileSpec, |
| const ArchiveFormat | fmt, | ||
| const pg_compress_specification | compression_spec, | ||
| bool | dosync, | ||
| ArchiveMode | mode, | ||
| SetupWorkerPtrType | setupDumpWorker, | ||
| DataDirSyncMethod | sync_method | ||
| ) |
Definition at line 231 of file pg_backup_archiver.c.
References _allocAH(), dosync, mode, setupDumpWorker(), and sync_method.
Referenced by main().
| void DisconnectDatabase | ( | Archive * | AHX | ) |
Definition at line 164 of file pg_backup_db.c.
References _archiveHandle::connCancel, _archiveHandle::connection, PQcancel(), PQfinish(), PQTRANS_ACTIVE, PQtransactionStatus(), and set_archive_cancel_info().
Referenced by archive_close_connection(), restore_toc_entries_prefork(), RestoreArchive(), and RunWorker().
| DumpOptions * dumpOptionsFromRestoreOptions | ( | RestoreOptions * | ropt | ) |
Definition at line 164 of file pg_backup_archiver.c.
References _restoreOptions::aclsSkip, _dumpOptions::aclsSkip, _restoreOptions::column_inserts, _dumpOptions::column_inserts, _restoreOptions::cparams, _dumpOptions::cparams, _restoreOptions::createDB, _connParams::dbname, _restoreOptions::disable_dollar_quoting, _dumpOptions::disable_dollar_quoting, _restoreOptions::disable_triggers, _dumpOptions::disable_triggers, _restoreOptions::dropSchema, _restoreOptions::dump_inserts, _dumpOptions::dump_inserts, _restoreOptions::dumpData, _dumpOptions::dumpData, _restoreOptions::dumpSchema, _dumpOptions::dumpSchema, _restoreOptions::dumpSections, _dumpOptions::dumpSections, _restoreOptions::dumpStatistics, _dumpOptions::dumpStatistics, _restoreOptions::enable_row_security, _dumpOptions::enable_row_security, _restoreOptions::if_exists, _dumpOptions::if_exists, _restoreOptions::include_everything, _dumpOptions::include_everything, _restoreOptions::lockWaitTimeout, _dumpOptions::lockWaitTimeout, NewDumpOptions(), _restoreOptions::no_comments, _dumpOptions::no_comments, _restoreOptions::no_policies, _dumpOptions::no_policies, _restoreOptions::no_publications, _dumpOptions::no_publications, _restoreOptions::no_security_labels, _dumpOptions::no_security_labels, _restoreOptions::no_subscriptions, _dumpOptions::no_subscriptions, _restoreOptions::noOwner, _restoreOptions::noTableAm, _restoreOptions::noTablespace, _dumpOptions::outputClean, _dumpOptions::outputCreateDB, _dumpOptions::outputNoOwner, _dumpOptions::outputNoTableAm, _dumpOptions::outputNoTablespaces, _dumpOptions::outputSuperuser, pg_strdup(), _connParams::pghost, _connParams::pgport, _connParams::promptPassword, _restoreOptions::restrict_key, _dumpOptions::restrict_key, _restoreOptions::sequence_data, _dumpOptions::sequence_data, _restoreOptions::superuser, _restoreOptions::use_setsessauth, _dumpOptions::use_setsessauth, and _connParams::username.
Referenced by SetArchiveOptions().
Definition at line 1429 of file pg_backup_archiver.c.
References _archiveHandle::currToc, and _archiveHandle::EndLOPtr.
Referenced by dumpLOs().
Definition at line 193 of file pg_backup_db.c.
References _archiveHandle::connection.
| void InitDumpOptions | ( | DumpOptions * | opts | ) |
Definition at line 147 of file pg_backup_archiver.c.
References DUMP_UNSECTIONED, opts, and TRI_DEFAULT.
Referenced by main(), and NewDumpOptions().
| DumpOptions * NewDumpOptions | ( | void | ) |
Definition at line 135 of file pg_backup_archiver.c.
References InitDumpOptions(), opts, and pg_malloc().
Referenced by dumpOptionsFromRestoreOptions().
| RestoreOptions * NewRestoreOptions | ( | void | ) |
Definition at line 1106 of file pg_backup_archiver.c.
References archUnknown, DUMP_UNSECTIONED, opts, PG_COMPRESSION_NONE, pg_malloc0(), and TRI_DEFAULT.
Referenced by _CloseArchive(), and main().
| Archive * OpenArchive | ( | const char * | FileSpec, |
| const ArchiveFormat | fmt | ||
| ) |
Definition at line 247 of file pg_backup_archiver.c.
References _allocAH(), pg_compress_specification::algorithm, archModeRead, DATA_DIR_SYNC_METHOD_FSYNC, PG_COMPRESSION_NONE, and setupRestoreWorker().
Referenced by main().
| void PrintTOCSummary | ( | Archive * | AHX | ) |
Definition at line 1303 of file pg_backup_archiver.c.
References _tocEntryRequired(), ahprintf(), pg_compress_specification::algorithm, archCustom, _archiveHandle::archdbname, archDirectory, ARCHIVE_MAJOR, ARCHIVE_MINOR, ARCHIVE_REV, _archiveHandle::archiveDumpVersion, _archiveHandle::archiveRemoteVersion, archTar, _tocEntry::catalogId, _archiveHandle::compression_spec, _archiveHandle::createDate, _tocEntry::dependencies, _tocEntry::desc, _tocEntry::dumpId, _restoreOptions::filename, _archiveHandle::format, free, get_compress_algorithm_name(), i, _archiveHandle::intSize, _tocEntry::nDeps, _tocEntry::next, _archiveHandle::offSize, CatalogId::oid, _tocEntry::owner, PG_COMPRESSION_NONE, PGDUMP_STRFTIME_FMT, _archiveHandle::public, REQ_DATA, REQ_SCHEMA, REQ_STATS, _tocEntry::reqs, RestoreOutput(), Archive::ropt, sanitize_line(), SaveOutput(), _tocEntry::section, SECTION_NONE, SECTION_PRE_DATA, SetOutput(), _restoreOptions::strict_names, StrictNamesCheck(), CatalogId::tableoid, _tocEntry::tag, _archiveHandle::toc, _archiveHandle::tocCount, _restoreOptions::verbose, and _archiveHandle::version.
Referenced by main().
| void ProcessArchiveRestoreOptions | ( | Archive * | AHX | ) |
Definition at line 289 of file pg_backup_archiver.c.
References _tocEntryRequired(), archModeRead, _archiveHandle::mode, _tocEntry::next, pg_fatal, pg_log_warning, _archiveHandle::public, _tocEntry::reqs, Archive::ropt, _tocEntry::section, SECTION_DATA, SECTION_NONE, SECTION_POST_DATA, SECTION_PRE_DATA, _restoreOptions::strict_names, StrictNamesCheck(), and _archiveHandle::toc.
Referenced by main().
| void RestoreArchive | ( | Archive * | AHX | ) |
Definition at line 344 of file pg_backup_archiver.c.
References _becomeOwner(), _doSetFixedOutputState(), _selectOutputSchema(), _tocEntryRestorePass(), ahprintf(), pg_compress_specification::algorithm, appendPQExpBuffer(), appendPQExpBufferStr(), _archiveHandle::archiveDumpVersion, _archiveHandle::archiveRemoteVersion, Assert(), buildTocEntryArrays(), _tocEntry::catalogId, _archiveHandle::ClonePtr, CommitTransaction(), _restoreOptions::compression_spec, _archiveHandle::compression_spec, ConnectDatabaseAhx(), _archiveHandle::connection, _restoreOptions::cparams, _archiveHandle::createDate, _restoreOptions::createDB, createPQExpBuffer(), _archiveHandle::currentTE, _archiveHandle::currSchema, PQExpBufferData::data, _tocEntry::desc, destroyPQExpBuffer(), DisconnectDatabase(), DropLOIfExists(), _restoreOptions::dropSchema, _tocEntry::dropStmt, _restoreOptions::dumpSchema, dumpTimestamp(), errmsg(), _restoreOptions::filename, free, _tocEntry::hadDumper, _restoreOptions::if_exists, IssueCommandPerBlob(), K_VERS_1_3, K_VERS_1_8, Archive::maxRemoteVersion, Archive::minRemoteVersion, _tocEntry::next, _archiveHandle::noTocComments, Archive::numWorkers, CatalogId::oid, ParallelBackupEnd(), ParallelBackupStart(), pending_list_header_init(), PG_COMPRESSION_NONE, pg_fatal, pg_free(), pg_log_info, pg_log_warning, pg_strdup(), _archiveHandle::PrepParallelRestorePtr, _tocEntry::prev, _archiveHandle::PrintTocDataPtr, _archiveHandle::public, _archiveHandle::ReopenPtr, REQ_DATA, REQ_SCHEMA, REQ_STATS, _tocEntry::reqs, RESTORE_PASS_ACL, RESTORE_PASS_MAIN, RESTORE_PASS_POST_ACL, restore_toc_entries_parallel(), restore_toc_entries_postfork(), restore_toc_entries_prefork(), restore_toc_entry(), RestoreOutput(), _restoreOptions::restrict_key, Archive::ropt, SaveOutput(), SetOutput(), _restoreOptions::single_txn, snprintf, _archiveHandle::stage, STAGE_FINALIZING, STAGE_INITIALIZING, STAGE_PROCESSING, StartTransaction(), supports_compression(), _tocEntry::tag, _archiveHandle::toc, _archiveHandle::tocsByDumpId, _restoreOptions::txn_size, _archiveHandle::txnCount, _restoreOptions::useDB, Archive::verbose, and _archiveHandle::version.
Referenced by _CloseArchive(), and main().
| void SetArchiveOptions | ( | Archive * | AH, |
| DumpOptions * | dopt, | ||
| RestoreOptions * | ropt | ||
| ) |
Definition at line 276 of file pg_backup_archiver.c.
References Archive::dopt, dumpOptionsFromRestoreOptions(), and Archive::ropt.
Referenced by _CloseArchive(), and main().
| void SortTocFromFile | ( | Archive * | AHX | ) |
Definition at line 1570 of file pg_backup_archiver.c.
References _moveBefore(), StringInfoData::data, getTocEntryByDumpId(), _restoreOptions::idWanted, initStringInfo(), StringInfoData::len, _archiveHandle::maxDumpId, PG_BINARY_R, pg_fatal, pg_free(), pg_get_line_buf(), pg_log_warning, pg_malloc0(), _archiveHandle::public, Archive::ropt, _archiveHandle::toc, and _restoreOptions::tocFile.
Referenced by main().
Definition at line 1415 of file pg_backup_archiver.c.
References _archiveHandle::currToc, pg_fatal, and _archiveHandle::StartLOPtr.
Referenced by dumpLOs().
| void WriteData | ( | Archive * | AHX, |
| const void * | data, | ||
| size_t | dLen | ||
| ) |
Definition at line 1220 of file pg_backup_archiver.c.
References _archiveHandle::currToc, data, pg_fatal, and _archiveHandle::WriteDataPtr.
Referenced by archprintf(), archputs(), dumpLOs(), and dumpTableData_copy().