|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include <ctype.h>#include <fcntl.h>#include <unistd.h>#include <sys/stat.h>#include <sys/wait.h>#include "catalog/pg_class_d.h"#include "catalog/pg_largeobject_metadata_d.h"#include "catalog/pg_shdepend_d.h"#include "common/string.h"#include "compress_io.h"#include "dumputils.h"#include "fe_utils/string_utils.h"#include "lib/binaryheap.h"#include "lib/stringinfo.h"#include "libpq/libpq-fs.h"#include "parallel.h"#include "pg_backup_archiver.h"#include "pg_backup_db.h"#include "pg_backup_utils.h"
Go to the source code of this file.
Macros | |
| #define | TEXT_DUMP_HEADER "--\n-- PostgreSQL database dump\n--\n\n" |
| #define | TEXT_DUMPALL_HEADER "--\n-- PostgreSQL database cluster dump\n--\n\n" |
| #define | TOC_PREFIX_NONE "" |
| #define | TOC_PREFIX_DATA "Data for " |
| #define | TOC_PREFIX_STATS "Statistics for " |
| #define TEXT_DUMP_HEADER "--\n-- PostgreSQL database dump\n--\n\n" |
Definition at line 48 of file pg_backup_archiver.c.
| #define TEXT_DUMPALL_HEADER "--\n-- PostgreSQL database cluster dump\n--\n\n" |
Definition at line 49 of file pg_backup_archiver.c.
Definition at line 52 of file pg_backup_archiver.c.
| #define TOC_PREFIX_NONE "" |
Definition at line 51 of file pg_backup_archiver.c.
Definition at line 53 of file pg_backup_archiver.c.
|
static |
Definition at line 2376 of file pg_backup_archiver.c.
References _discoverArchiveFormat(), pg_compress_specification::algorithm, archCustom, archDirectory, _archiveHandle::archiveDumpVersion, archModeWrite, archNull, archTar, archUnknown, _archiveHandle::compression_spec, _archiveHandle::createDate, _archiveHandle::currSchema, _archiveHandle::currTableAm, _archiveHandle::currTablespace, _archiveHandle::currUser, _archiveHandle::dosync, dosync, Archive::encoding, Archive::exit_on_error, fb(), _archiveHandle::format, _archiveHandle::fSpec, InitArchiveFmt_Custom(), InitArchiveFmt_Directory(), InitArchiveFmt_Null(), InitArchiveFmt_Tar(), InitCompressFileHandle(), _archiveHandle::intSize, K_VERS_SELF, mode, _archiveHandle::mode, Archive::n_errors, _tocEntry::next, _archiveHandle::OF, _archiveHandle::offSize, PG_BINARY_A, PG_COMPRESSION_NONE, pg_fatal, pg_log_debug, pg_malloc0(), pg_strdup(), _tocEntry::prev, _archiveHandle::public, _archiveHandle::SetupWorkerPtr, _archiveHandle::sqlparse, Archive::std_strings, sync_method, _archiveHandle::sync_method, _archiveHandle::toc, and _archiveHandle::version.
Referenced by CreateArchive(), and OpenArchive().
|
static |
Definition at line 3576 of file pg_backup_archiver.c.
References _becomeUser(), _restoreOptions::noOwner, _tocEntry::owner, _archiveHandle::public, Archive::ropt, and _restoreOptions::use_setsessauth.
Referenced by _printTocEntry(), restore_toc_entry(), and RestoreArchive().
|
static |
Definition at line 3553 of file pg_backup_archiver.c.
References _doSetSessionAuth(), _archiveHandle::currUser, fb(), free, pg_strdup(), and user.
Referenced by _becomeOwner(), _disableTriggersIfNecessary(), and _enableTriggersIfNecessary().
|
static |
Definition at line 1126 of file pg_backup_archiver.c.
References _becomeUser(), ahprintf(), _restoreOptions::disable_triggers, _restoreOptions::dumpSchema, fmtQualifiedId(), pg_log_info, _archiveHandle::public, Archive::ropt, _restoreOptions::superuser, and _tocEntry::tag.
Referenced by restore_toc_entry().
|
static |
Definition at line 2243 of file pg_backup_archiver.c.
References _fileExistsInDirectory(), archCustom, archDirectory, archTar, fb(), _archiveHandle::format, free, _archiveHandle::fSpec, isValidTarHeader(), _archiveHandle::lookahead, _archiveHandle::lookaheadLen, _archiveHandle::lookaheadPos, _archiveHandle::lookaheadSize, PG_BINARY_R, pg_fatal, pg_log_debug, pg_malloc0(), READ_ERROR_EXIT, _archiveHandle::readHeader, S_ISDIR, sig, stat::st_mode, stat, TEXT_DUMP_HEADER, and TEXT_DUMPALL_HEADER.
Referenced by _allocAH().
|
static |
Definition at line 3394 of file pg_backup_archiver.c.
References ahprintf(), _archiveHandle::connection, _restoreOptions::enable_row_security, Archive::encoding, fmtId(), pg_encoding_to_char, _archiveHandle::public, Archive::ropt, Archive::searchpath, StartTransaction(), Archive::std_strings, _restoreOptions::txn_size, _archiveHandle::txnCount, and _restoreOptions::use_role.
Referenced by _reconnectToDB(), CloneArchive(), restore_toc_entries_postfork(), and RestoreArchive().
|
static |
Definition at line 3459 of file pg_backup_archiver.c.
References ahprintf(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendStringLiteralAHX, _archiveHandle::connection, createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), pg_fatal, PGRES_COMMAND_OK, PQclear, PQerrorMessage(), PQexec(), PQresultStatus, RestoringToDB(), and user.
Referenced by _becomeUser().
|
static |
Definition at line 1152 of file pg_backup_archiver.c.
References _becomeUser(), ahprintf(), _restoreOptions::disable_triggers, _restoreOptions::dumpSchema, fmtQualifiedId(), pg_log_info, _archiveHandle::public, Archive::ropt, _restoreOptions::superuser, and _tocEntry::tag.
Referenced by restore_toc_entry().
Definition at line 2231 of file pg_backup_archiver.c.
References buf, filename, MAXPGPATH, pg_fatal, S_ISREG, snprintf, stat::st_mode, and stat.
Referenced by _discoverArchiveFormat().
|
static |
Definition at line 3801 of file pg_backup_archiver.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), buf, _tocEntry::desc, _tocEntry::dropStmt, fb(), fmtId(), free, pg_fatal, pg_strdup(), _tocEntry::tag, and type.
Referenced by _printTocEntry().
Definition at line 1963 of file pg_backup_archiver.c.
References _tocEntry::next, and _tocEntry::prev.
Referenced by SortTocFromFile().
|
static |
Definition at line 3753 of file pg_backup_archiver.c.
References ahprintf(), appendPQExpBuffer(), appendPQExpBufferStr(), Assert, _archiveHandle::connection, createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), fb(), fmtId(), fmtQualifiedId(), _restoreOptions::noTableAm, PGRES_COMMAND_OK, PQclear, PQerrorMessage(), PQexec(), PQresultStatus, _archiveHandle::public, _tocEntry::relkind, RestoringToDB(), Archive::ropt, _tocEntry::tableam, _tocEntry::tag, and warn_or_exit_horribly().
Referenced by _printTocEntry().
Definition at line 3895 of file pg_backup_archiver.c.
References _becomeOwner(), _getObjectDescription(), _printTableAccessMethodNoStorage(), _selectOutputSchema(), _selectTableAccessMethod(), _selectTablespace(), _tocEntryIsACL(), ahprintf(), archTar, _tocEntry::catalogId, _archiveHandle::currUser, _tocEntry::defn, _tocEntry::defnDumper, _tocEntry::defnDumperArg, _tocEntry::defnLen, _tocEntry::dependencies, _tocEntry::desc, _tocEntry::dropStmt, _tocEntry::dumpId, fb(), fmtId(), _archiveHandle::format, free, i, initPQExpBuffer(), IssueACLPerBlob(), IssueCommandPerBlob(), _tocEntry::nDeps, _restoreOptions::noOwner, _restoreOptions::noTablespace, _archiveHandle::noTocComments, CatalogId::oid, _tocEntry::owner, pg_fatal, pg_free(), _archiveHandle::PrintExtraTocPtr, psprintf(), _archiveHandle::public, _tocEntry::relkind, Archive::ropt, sanitize_line(), _tocEntry::tableam, CatalogId::tableoid, _tocEntry::tablespace, _tocEntry::tag, termPQExpBuffer(), _restoreOptions::txn_size, _archiveHandle::txnCount, _restoreOptions::use_setsessauth, and Archive::verbose.
Referenced by restore_toc_entry().
|
static |
Definition at line 3502 of file pg_backup_archiver.c.
References _doSetFixedOutputState(), ahprintf(), appendPsqlMetaConnect(), _archiveHandle::currSchema, _archiveHandle::currTableAm, _archiveHandle::currTablespace, _archiveHandle::currUser, dbname, fb(), free, initPQExpBuffer(), _archiveHandle::public, ReconnectToServer(), RestoringToDB(), _restoreOptions::restrict_key, Archive::ropt, and termPQExpBuffer().
Referenced by restore_toc_entry().
|
static |
Definition at line 3592 of file pg_backup_archiver.c.
References ahprintf(), appendPQExpBuffer(), appendPQExpBufferStr(), _archiveHandle::connection, createPQExpBuffer(), _archiveHandle::currSchema, PQExpBufferData::data, destroyPQExpBuffer(), fb(), fmtId(), free, pg_strdup(), PGRES_COMMAND_OK, PQclear, PQerrorMessage(), PQexec(), PQresultStatus, _archiveHandle::public, RestoringToDB(), Archive::searchpath, and warn_or_exit_horribly().
Referenced by _printTocEntry(), restore_toc_entry(), and RestoreArchive().
|
static |
Definition at line 3703 of file pg_backup_archiver.c.
References ahprintf(), appendPQExpBuffer(), _archiveHandle::connection, createPQExpBuffer(), _archiveHandle::currTableAm, PQExpBufferData::data, destroyPQExpBuffer(), fb(), fmtId(), free, _restoreOptions::noTableAm, pg_strdup(), PGRES_COMMAND_OK, PQclear, PQerrorMessage(), PQexec(), PQresultStatus, _archiveHandle::public, RestoringToDB(), Archive::ropt, and warn_or_exit_horribly().
Referenced by _printTocEntry().
|
static |
Definition at line 3643 of file pg_backup_archiver.c.
References ahprintf(), appendPQExpBuffer(), appendPQExpBufferStr(), _archiveHandle::connection, createPQExpBuffer(), _archiveHandle::currTablespace, PQExpBufferData::data, destroyPQExpBuffer(), fb(), fmtId(), free, _restoreOptions::noTablespace, pg_strdup(), PGRES_COMMAND_OK, PQclear, PQerrorMessage(), PQexec(), PQresultStatus, _archiveHandle::public, RestoringToDB(), Archive::ropt, tablespace, and warn_or_exit_horribly().
Referenced by _printTocEntry().
Definition at line 3379 of file pg_backup_archiver.c.
References _tocEntry::desc, and fb().
Referenced by _printTocEntry(), and _tocEntryRequired().
|
static |
Definition at line 2986 of file pg_backup_archiver.c.
References _tocEntryIsACL(), _restoreOptions::aclsSkip, _restoreOptions::binary_upgrade, _tocEntry::catalogId, _restoreOptions::createDB, _tocEntry::defn, _tocEntry::dependencies, _tocEntry::desc, DUMP_DATA, DUMP_POST_DATA, DUMP_PRE_DATA, _restoreOptions::dumpData, _tocEntry::dumpId, _restoreOptions::dumpSchema, _restoreOptions::dumpSections, _restoreOptions::dumpStatistics, fb(), _restoreOptions::functionNames, getTocEntryByDumpId(), _tocEntry::hadDumper, SimpleStringList::head, i, _restoreOptions::idWanted, _restoreOptions::indexNames, _tocEntry::nDeps, _restoreOptions::no_comments, _restoreOptions::no_policies, _restoreOptions::no_publications, _restoreOptions::no_security_labels, _restoreOptions::no_subscriptions, CatalogId::oid, _archiveHandle::public, Archive::remoteVersion, REQ_DATA, REQ_SCHEMA, REQ_SPECIAL, REQ_STATS, Archive::ropt, _restoreOptions::schemaExcludeNames, _restoreOptions::schemaNames, SECTION_DATA, SECTION_POST_DATA, SECTION_PRE_DATA, _restoreOptions::selFunction, _restoreOptions::selIndex, _restoreOptions::selTable, _restoreOptions::selTrigger, _restoreOptions::selTypes, _restoreOptions::sequence_data, simple_string_list_member(), _restoreOptions::tableNames, _tocEntry::tag, and _restoreOptions::triggerNames.
Referenced by PrintTOCSummary(), and ProcessArchiveRestoreOptions().
|
static |
Definition at line 3331 of file pg_backup_archiver.c.
References _tocEntry::desc, fb(), RESTORE_PASS_ACL, RESTORE_PASS_MAIN, RESTORE_PASS_POST_ACL, _tocEntry::section, SECTION_POST_DATA, and _tocEntry::tag.
Referenced by move_to_ready_heap(), reduce_dependencies(), restore_toc_entries_prefork(), and RestoreArchive().
| int ahprintf | ( | ArchiveHandle * | AH, |
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 1758 of file pg_backup_archiver.c.
References ahwrite(), fb(), free, len, pg_malloc(), and pvsnprintf().
Referenced by _disableTriggersIfNecessary(), _doSetFixedOutputState(), _doSetSessionAuth(), _enableTriggersIfNecessary(), _EndData(), _EndLO(), _EndLOs(), _PrintExtraToc(), _PrintExtraToc(), _PrintExtraToc(), _printTableAccessMethodNoStorage(), _PrintTocData(), _printTocEntry(), _reconnectToDB(), _selectOutputSchema(), _selectTableAccessMethod(), _selectTablespace(), _StartLO(), _StartLOs(), _WriteLOData(), DropLOIfExists(), dump_lo_buf(), dumpTimestamp(), EndRestoreLO(), EndRestoreLOs(), IssueCommandPerBlob(), PrintTOCSummary(), restore_toc_entry(), RestoreArchive(), StartRestoreLO(), and StartRestoreLOs().
Definition at line 1849 of file pg_backup_archiver.c.
References _archiveHandle::CustomOutPtr, dump_lo_buf(), ExecuteSqlCommandBuf(), fb(), _archiveHandle::lo_buf, _archiveHandle::lo_buf_size, _archiveHandle::lo_buf_used, _archiveHandle::OF, _archiveHandle::public, remaining, RestoringToDB(), WRITE_ERROR_EXIT, and _archiveHandle::writingLO.
Referenced by _LoadLOs(), _PrintFileData(), _PrintFileData(), _PrintTocData(), _WriteData(), ahprintf(), and ReadDataFromArchiveNone().
| TocEntry * ArchiveEntry | ( | Archive * | AHX, |
| CatalogId | catalogId, | ||
| DumpId | dumpId, | ||
| ArchiveOpts * | opts | ||
| ) |
Definition at line 1241 of file pg_backup_archiver.c.
References _archiveHandle::ArchiveEntryPtr, _tocEntry::catalogId, fb(), _archiveHandle::maxDumpId, _tocEntry::next, opts, pg_malloc(), pg_malloc0(), pg_strdup(), _tocEntry::prev, _archiveHandle::toc, _archiveHandle::tocCount, and true.
Referenced by dumpAccessMethod(), dumpACL(), dumpAgg(), dumpAttrDef(), dumpBaseType(), dumpCast(), dumpCollation(), dumpCommentExtended(), dumpCompositeType(), dumpCompositeTypeColComments(), dumpConstraint(), dumpConversion(), dumpDatabase(), dumpDefaultACL(), dumpDomain(), dumpDumpableObject(), dumpEncoding(), dumpEnumType(), dumpEventTrigger(), dumpExtension(), dumpForeignDataWrapper(), dumpForeignServer(), dumpFunc(), dumpIndex(), dumpIndexAttach(), dumpLO(), dumpNamespace(), dumpOpclass(), dumpOpfamily(), dumpOpr(), dumpPolicy(), dumpProcLang(), dumpPublication(), dumpPublicationNamespace(), dumpPublicationTable(), dumpRangeType(), dumpRelationStats(), dumpRule(), dumpSearchPath(), dumpSecLabel(), dumpSequence(), dumpSequenceData(), dumpShellType(), dumpStatisticsExt(), dumpStatisticsExtStats(), dumpStdStrings(), dumpSubscription(), dumpSubscriptionTable(), dumpTableAttach(), dumpTableComment(), dumpTableData(), dumpTableSchema(), dumpTableSecLabel(), dumpTransform(), dumpTrigger(), dumpTSConfig(), dumpTSDictionary(), dumpTSParser(), dumpTSTemplate(), dumpUndefinedType(), dumpUserMappings(), and refreshMatViewData().
Definition at line 1658 of file pg_backup_archiver.c.
References fb(), free, len, pg_malloc(), pvsnprintf(), and WriteData().
Definition at line 1651 of file pg_backup_archiver.c.
References fb(), and WriteData().
Referenced by dumpTableData_insert().
|
static |
Definition at line 1988 of file pg_backup_archiver.c.
References _tocEntry::dependencies, _tocEntry::desc, _tocEntry::dumpId, fb(), _archiveHandle::maxDumpId, _tocEntry::nDeps, _tocEntry::next, pg_fatal, pg_malloc0(), _archiveHandle::tableDataId, _archiveHandle::toc, and _archiveHandle::tocsByDumpId.
Referenced by getTocEntryByDumpId(), and RestoreArchive().
Definition at line 4279 of file pg_backup_archiver.c.
References fb(), fseeko, and ftello.
Referenced by InitArchiveFmt_Custom(), and InitArchiveFmt_Tar().
| ArchiveHandle * CloneArchive | ( | ArchiveHandle * | AH | ) |
Definition at line 5146 of file pg_backup_archiver.c.
References _doSetFixedOutputState(), archModeRead, Assert, ConnectDatabaseAhx(), fb(), _archiveHandle::mode, pg_malloc(), pg_strdup(), _archiveHandle::public, and Archive::ropt.
Referenced by RunWorker().
Definition at line 262 of file pg_backup_archiver.c.
References _archiveHandle::ClosePtr, EndCompressFileHandle(), fb(), _archiveHandle::OF, and pg_fatal.
Referenced by main().
| 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, fb(), mode, setupDumpWorker(), and sync_method.
Referenced by main().
| void DeCloneArchive | ( | ArchiveHandle * | AH | ) |
Definition at line 5210 of file pg_backup_archiver.c.
References Assert, _archiveHandle::connection, sqlparseInfo::curCmd, _archiveHandle::currSchema, _archiveHandle::currTableAm, _archiveHandle::currTablespace, _archiveHandle::currUser, _archiveHandle::DeClonePtr, destroyPQExpBuffer(), fb(), free, _archiveHandle::savedPassword, and _archiveHandle::sqlparse.
Referenced by RunWorker().
|
static |
Definition at line 1806 of file pg_backup_archiver.c.
References ahprintf(), appendByteaLiteralAHX, buf, _archiveHandle::connection, createPQExpBuffer(), destroyPQExpBuffer(), _archiveHandle::lo_buf, _archiveHandle::lo_buf_used, lo_write(), _archiveHandle::loFd, ngettext, pg_log_debug, PQerrorMessage(), warn_or_exit_horribly(), and _archiveHandle::writingLO.
Referenced by ahwrite(), and EndRestoreLO().
| 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, fb(), _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 4304 of file pg_backup_archiver.c.
References ahprintf(), buf, fb(), and PGDUMP_STRFTIME_FMT.
Referenced by RestoreArchive().
Definition at line 1429 of file pg_backup_archiver.c.
References _archiveHandle::currToc, and _archiveHandle::EndLOPtr.
Referenced by dumpLOs().
| void EndRestoreLO | ( | ArchiveHandle * | AH, |
| Oid | oid | ||
| ) |
Definition at line 1544 of file pg_backup_archiver.c.
References ahprintf(), _archiveHandle::connection, dump_lo_buf(), _archiveHandle::lo_buf_used, lo_close(), _archiveHandle::loFd, and _archiveHandle::writingLO.
Referenced by _LoadLOs(), _LoadLOs(), and _LoadLOs().
| void EndRestoreLOs | ( | ArchiveHandle * | AH | ) |
Definition at line 1471 of file pg_backup_archiver.c.
References ahprintf(), CommitTransaction(), _archiveHandle::connection, _archiveHandle::loCount, ngettext, pg_log_info, _archiveHandle::public, Archive::ropt, _restoreOptions::single_txn, and _restoreOptions::txn_size.
Referenced by _LoadLOs(), _LoadLOs(), and _LoadLOs().
|
static |
Definition at line 4843 of file pg_backup_archiver.c.
References _tocEntry::depCount, _tocEntry::dependencies, _tocEntry::desc, _tocEntry::dumpId, fb(), i, identify_locking_dependencies(), K_VERS_1_11, _tocEntry::lockDeps, _tocEntry::nDeps, _tocEntry::next, _tocEntry::nLockDeps, _tocEntry::nRevDeps, _tocEntry::pending_next, _tocEntry::pending_prev, pg_malloc(), repoint_table_dependencies(), _tocEntry::revDeps, _archiveHandle::toc, _archiveHandle::tocsByDumpId, and _archiveHandle::version.
Referenced by IndexSetParentIndex(), and restore_toc_entries_prefork().
| TocEntry * getTocEntryByDumpId | ( | ArchiveHandle * | AH, |
| DumpId | id | ||
| ) |
Definition at line 2029 of file pg_backup_archiver.c.
References buildTocEntryArrays(), fb(), and _archiveHandle::tocsByDumpId.
Referenced by _PrintTocData(), _tocEntryRequired(), IssueACLPerBlob(), parseWorkerCommand(), SortTocFromFile(), and TocIDRequired().
Definition at line 4597 of file pg_backup_archiver.c.
Referenced by pop_next_work_item().
|
static |
Definition at line 5007 of file pg_backup_archiver.c.
References _tocEntry::dependencies, _tocEntry::desc, fb(), free, i, _tocEntry::lockDeps, _tocEntry::nDeps, _tocEntry::nLockDeps, pg_malloc(), pg_realloc(), _tocEntry::section, SECTION_POST_DATA, and _archiveHandle::tocsByDumpId.
Referenced by fix_dependencies().
|
static |
Definition at line 5126 of file pg_backup_archiver.c.
References _tocEntry::dumpId, fb(), pg_log_info, _tocEntry::reqs, _archiveHandle::tableDataId, _tocEntry::tag, and _archiveHandle::tocsByDumpId.
Referenced by mark_restore_job_done(), and restore_toc_entry().
| void InitDumpOptions | ( | DumpOptions * | opts | ) |
Definition at line 147 of file pg_backup_archiver.c.
References DUMP_UNSECTIONED, fb(), opts, and TRI_DEFAULT.
Referenced by main(), and NewDumpOptions().
Definition at line 1189 of file pg_backup_archiver.c.
References appendPQExpBuffer(), _tocEntry::copyStmt, createPQExpBuffer(), PQExpBufferData::data, _tocEntry::defn, destroyPQExpBuffer(), fb(), fmtQualifiedId(), PQExpBufferData::len, and _tocEntry::tag.
Referenced by restore_toc_entry().
|
static |
Definition at line 5111 of file pg_backup_archiver.c.
References _tocEntry::created, _tocEntry::dumpId, fb(), _archiveHandle::tableDataId, and _archiveHandle::tocsByDumpId.
Referenced by mark_restore_job_done(), and restore_toc_entry().
|
static |
Definition at line 2562 of file pg_backup_archiver.c.
References _tocEntry::desc, _tocEntry::dumpId, pg_fatal, pg_log_info, and _tocEntry::tag.
Referenced by WriteDataChunks().
|
static |
Definition at line 4802 of file pg_backup_archiver.c.
References _tocEntry::desc, _tocEntry::dumpId, fb(), inhibit_data_for_failed_table(), mark_create_done(), Archive::n_errors, pg_fatal, pg_log_info, _archiveHandle::public, reduce_dependencies(), _tocEntry::tag, WORKER_CREATE_DONE, WORKER_IGNORED_ERRORS, and WORKER_INHIBIT_DATA.
Referenced by restore_toc_entries_parallel().
|
static |
Definition at line 4687 of file pg_backup_archiver.c.
References _tocEntryRestorePass(), binaryheap_add(), _tocEntry::depCount, fb(), pending_list_remove(), and _tocEntry::pending_next.
Referenced by restore_toc_entries_parallel().
| 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, fb(), PG_COMPRESSION_NONE, and setupRestoreWorker().
Referenced by main().
| int parallel_restore | ( | ArchiveHandle * | AH, |
| TocEntry * | te | ||
| ) |
Definition at line 4779 of file pg_backup_archiver.c.
References Assert, _archiveHandle::connection, fb(), Archive::n_errors, _archiveHandle::public, and restore_toc_entry().
Referenced by _WorkerJobRestoreCustom(), and _WorkerJobRestoreDirectory().
Definition at line 4629 of file pg_backup_archiver.c.
References _tocEntry::pending_next, and _tocEntry::pending_prev.
Referenced by restore_toc_entries_prefork().
Definition at line 4622 of file pg_backup_archiver.c.
References _tocEntry::pending_next, and _tocEntry::pending_prev.
Referenced by RestoreArchive().
Definition at line 4639 of file pg_backup_archiver.c.
References fb(), _tocEntry::pending_next, and _tocEntry::pending_prev.
Referenced by move_to_ready_heap(), and reduce_dependencies().
|
static |
Definition at line 4722 of file pg_backup_archiver.c.
References binaryheap_get_node, binaryheap_remove_node(), binaryheap_size, fb(), has_lock_conflicts(), i, ParallelState::numWorkers, pg_log_debug, and ParallelState::te.
Referenced by restore_toc_entries_parallel().
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, fb(), _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().
Definition at line 289 of file pg_backup_archiver.c.
References _tocEntryRequired(), archModeRead, fb(), _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().
|
static |
Definition at line 2880 of file pg_backup_archiver.c.
References _tocEntry::defn, encoding, Archive::encoding, fb(), free, pg_char_to_encoding, pg_fatal, pg_strdup(), _archiveHandle::public, and setFmtEncoding().
Referenced by ReadToc().
|
static |
Definition at line 2925 of file pg_backup_archiver.c.
References _tocEntry::defn, pg_strdup(), _archiveHandle::public, and Archive::searchpath.
Referenced by ReadToc().
|
static |
Definition at line 2909 of file pg_backup_archiver.c.
References _tocEntry::defn, fb(), pg_fatal, _archiveHandle::public, and Archive::std_strings.
Referenced by ReadToc().
| void ReadHead | ( | ArchiveHandle * | AH | ) |
Definition at line 4146 of file pg_backup_archiver.c.
References pg_compress_specification::algorithm, _archiveHandle::archdbname, _archiveHandle::archiveDumpVersion, _archiveHandle::archiveRemoteVersion, _archiveHandle::compression_spec, _archiveHandle::createDate, errmsg(), fb(), _archiveHandle::format, _archiveHandle::intSize, K_VERS_1_0, K_VERS_1_10, K_VERS_1_15, K_VERS_1_2, K_VERS_1_4, K_VERS_1_7, K_VERS_MAX, pg_compress_specification::level, MAKE_ARCHIVE_VERSION, _archiveHandle::offSize, PG_COMPRESSION_GZIP, pg_fatal, pg_free(), pg_log_warning, _archiveHandle::ReadBufPtr, _archiveHandle::ReadBytePtr, _archiveHandle::readHeader, ReadInt(), ReadStr(), supports_compression(), tm, pg_tm::tm_sec, and _archiveHandle::version.
Referenced by InitArchiveFmt_Custom(), InitArchiveFmt_Directory(), and InitArchiveFmt_Tar().
| int ReadInt | ( | ArchiveHandle * | AH | ) |
Definition at line 2165 of file pg_backup_archiver.c.
References b, fb(), _archiveHandle::intSize, K_VERS_1_0, _archiveHandle::ReadBytePtr, sign, and _archiveHandle::version.
Referenced by _CustomReadFunc(), _LoadLOs(), _readBlockHeader(), _ReadExtraToc(), _skipData(), _skipLOs(), ReadHead(), ReadOffset(), ReadStr(), and ReadToc().
| int ReadOffset | ( | ArchiveHandle * | AH, |
| pgoff_t * | o | ||
| ) |
Definition at line 2070 of file pg_backup_archiver.c.
References fb(), i, K_OFFSET_NO_DATA, K_OFFSET_POS_NOT_SET, K_OFFSET_POS_SET, K_VERS_1_7, _archiveHandle::offSize, pg_fatal, _archiveHandle::ReadBytePtr, ReadInt(), and _archiveHandle::version.
Referenced by _ReadExtraToc().
| char * ReadStr | ( | ArchiveHandle * | AH | ) |
Definition at line 2211 of file pg_backup_archiver.c.
References buf, fb(), pg_malloc(), _archiveHandle::ReadBufPtr, and ReadInt().
Referenced by _ReadExtraToc(), _ReadExtraToc(), ReadHead(), and ReadToc().
| void ReadToc | ( | ArchiveHandle * | AH | ) |
Definition at line 2708 of file pg_backup_archiver.c.
References _tocEntry::catalogId, _tocEntry::copyStmt, _tocEntry::dataLength, _tocEntry::defn, _tocEntry::dependencies, _tocEntry::desc, _tocEntry::dropStmt, _tocEntry::dumpId, fb(), free, _tocEntry::hadDumper, i, InvalidOid, K_VERS_1_10, K_VERS_1_11, K_VERS_1_14, K_VERS_1_16, K_VERS_1_3, K_VERS_1_5, K_VERS_1_6, K_VERS_1_8, K_VERS_1_9, _archiveHandle::maxDumpId, _tocEntry::nDeps, _tocEntry::next, CatalogId::oid, _tocEntry::owner, pg_fatal, pg_log_debug, pg_log_warning, pg_malloc(), pg_malloc0(), pg_realloc(), _tocEntry::prev, processEncodingEntry(), processSearchPathEntry(), processStdStringsEntry(), _archiveHandle::ReadExtraTocPtr, ReadInt(), ReadStr(), _tocEntry::relkind, _tocEntry::section, SECTION_DATA, SECTION_NONE, SECTION_POST_DATA, SECTION_PRE_DATA, _tocEntry::tableam, CatalogId::tableoid, _tocEntry::tablespace, _tocEntry::tag, _archiveHandle::toc, _archiveHandle::tocCount, and _archiveHandle::version.
Referenced by InitArchiveFmt_Custom(), InitArchiveFmt_Directory(), and InitArchiveFmt_Tar().
|
static |
Definition at line 5071 of file pg_backup_archiver.c.
References _tocEntryRestorePass(), Assert, binaryheap_add(), _tocEntry::dumpId, fb(), i, _tocEntry::nRevDeps, pending_list_remove(), pg_log_debug, _archiveHandle::restorePass, _tocEntry::revDeps, and _archiveHandle::tocsByDumpId.
Referenced by mark_restore_job_done(), restore_toc_entries_parallel(), and restore_toc_entries_prefork().
|
static |
Definition at line 4973 of file pg_backup_archiver.c.
References _tocEntry::dataLength, _tocEntry::dependencies, _tocEntry::dumpId, fb(), i, Max, _tocEntry::nDeps, _tocEntry::next, pg_log_debug, _tocEntry::section, SECTION_POST_DATA, _archiveHandle::tableDataId, _archiveHandle::toc, and _archiveHandle::tocsByDumpId.
Referenced by fix_dependencies().
|
static |
Definition at line 4445 of file pg_backup_archiver.c.
References ACT_RESTORE, Assert, binaryheap_allocate(), binaryheap_empty, binaryheap_free(), DispatchJobForTocEntry(), fb(), IsEveryWorkerIdle(), mark_restore_job_done(), move_to_ready_heap(), pg_log_debug, pg_log_info, pop_next_work_item(), reduce_dependencies(), REQ_DATA, REQ_SCHEMA, REQ_STATS, RESTORE_PASS_LAST, RESTORE_PASS_MAIN, _archiveHandle::restorePass, _archiveHandle::tocCount, TocEntrySizeCompareBinaryheap(), WaitForWorkers(), WFW_GOT_STATUS, and WFW_ONE_IDLE.
Referenced by RestoreArchive().
|
static |
Definition at line 4563 of file pg_backup_archiver.c.
References _doSetFixedOutputState(), ConnectDatabaseAhx(), _restoreOptions::cparams, _tocEntry::desc, _tocEntry::dumpId, fb(), _tocEntry::pending_next, pg_log_debug, pg_log_info, _archiveHandle::public, restore_toc_entry(), Archive::ropt, and _tocEntry::tag.
Referenced by RestoreArchive().
|
static |
Definition at line 4322 of file pg_backup_archiver.c.
References _tocEntryRestorePass(), CommitTransaction(), _archiveHandle::currSchema, _archiveHandle::currTableAm, _archiveHandle::currTablespace, _archiveHandle::currUser, DisconnectDatabase(), fb(), fix_dependencies(), free, _tocEntry::next, pending_list_append(), pg_log_debug, pg_log_info, _archiveHandle::public, reduce_dependencies(), RESTORE_PASS_MAIN, restore_toc_entry(), _archiveHandle::restorePass, Archive::ropt, SECTION_DATA, SECTION_POST_DATA, SECTION_PRE_DATA, _archiveHandle::toc, and _restoreOptions::txn_size.
Referenced by RestoreArchive().
|
static |
Definition at line 844 of file pg_backup_archiver.c.
References _becomeOwner(), _disableTriggersIfNecessary(), _enableTriggersIfNecessary(), _printTocEntry(), _reconnectToDB(), _selectOutputSchema(), ahprintf(), CommitTransaction(), _archiveHandle::connection, _tocEntry::copyStmt, _tocEntry::created, _archiveHandle::currentTE, _tocEntry::defn, _tocEntry::desc, _restoreOptions::dumpSchema, EndDBCopyMode(), fb(), fmtQualifiedId(), _tocEntry::hadDumper, inhibit_data_for_failed_table(), is_load_via_partition_root(), _archiveHandle::lastErrorTE, mark_create_done(), Archive::n_errors, _restoreOptions::noDataForFailedTables, OUTPUT_COPYDATA, OUTPUT_OTHERDATA, OUTPUT_SQLCMDS, _archiveHandle::outputKind, pg_log_info, pg_log_warning, _archiveHandle::PrintTocDataPtr, _archiveHandle::public, REQ_DATA, REQ_SCHEMA, REQ_STATS, _tocEntry::reqs, RestoringToDB(), Archive::ropt, StartTransaction(), _restoreOptions::suppressDumpWarnings, _tocEntry::tag, TOC_PREFIX_DATA, TOC_PREFIX_NONE, TOC_PREFIX_STATS, _restoreOptions::txn_size, _archiveHandle::txnCount, WORKER_CREATE_DONE, WORKER_IGNORED_ERRORS, WORKER_INHIBIT_DATA, and WORKER_OK.
Referenced by parallel_restore(), restore_toc_entries_postfork(), restore_toc_entries_prefork(), and RestoreArchive().
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, _tocEntry::desc, destroyPQExpBuffer(), DisconnectDatabase(), DropLOIfExists(), _restoreOptions::dropSchema, _tocEntry::dropStmt, _restoreOptions::dumpSchema, dumpTimestamp(), errmsg(), fb(), _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().
|
static |
Definition at line 1743 of file pg_backup_archiver.c.
References EndCompressFileHandle(), fb(), _archiveHandle::OF, and pg_fatal.
Referenced by PrintTOCSummary(), and RestoreArchive().
|
static |
Definition at line 1795 of file pg_backup_archiver.c.
References _archiveHandle::connection, _archiveHandle::public, Archive::ropt, and _restoreOptions::useDB.
Referenced by _doSetSessionAuth(), _printTableAccessMethodNoStorage(), _reconnectToDB(), _selectOutputSchema(), _selectTableAccessMethod(), _selectTablespace(), ahwrite(), and restore_toc_entry().
|
static |
Definition at line 1737 of file pg_backup_archiver.c.
References _archiveHandle::OF.
Referenced by PrintTOCSummary(), and RestoreArchive().
| void SetArchiveOptions | ( | Archive * | AH, |
| DumpOptions * | dopt, | ||
| RestoreOptions * | ropt | ||
| ) |
Definition at line 276 of file pg_backup_archiver.c.
References Archive::dopt, dumpOptionsFromRestoreOptions(), fb(), and Archive::ropt.
Referenced by _CloseArchive(), and main().
|
static |
Definition at line 1697 of file pg_backup_archiver.c.
References archModeAppend, fb(), _archiveHandle::FH, filename, fn(), _archiveHandle::fSpec, InitCompressFileHandle(), mode, _archiveHandle::mode, _archiveHandle::OF, PG_BINARY_A, PG_BINARY_W, and pg_fatal.
Referenced by PrintTOCSummary(), and RestoreArchive().
Definition at line 220 of file pg_backup_archiver.c.
References _archiveHandle::ReopenPtr.
Referenced by OpenArchive().
Definition at line 1570 of file pg_backup_archiver.c.
References _moveBefore(), fb(), getTocEntryByDumpId(), _restoreOptions::idWanted, initStringInfo(), _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 StartRestoreLO | ( | ArchiveHandle * | AH, |
| Oid | oid, | ||
| bool | drop | ||
| ) |
Definition at line 1494 of file pg_backup_archiver.c.
References ahprintf(), _archiveHandle::connection, DropLOIfExists(), fb(), INV_WRITE, K_VERS_1_12, _archiveHandle::lo_buf, _archiveHandle::lo_buf_size, _archiveHandle::lo_buf_used, lo_create(), lo_open(), LOBBUFSIZE, _archiveHandle::loCount, _archiveHandle::loFd, pg_fatal, pg_log_info, pg_malloc(), PQerrorMessage(), _archiveHandle::version, and _archiveHandle::writingLO.
Referenced by _LoadLOs(), _LoadLOs(), and _LoadLOs().
| void StartRestoreLOs | ( | ArchiveHandle * | AH | ) |
Definition at line 1447 of file pg_backup_archiver.c.
References ahprintf(), _archiveHandle::connection, _archiveHandle::loCount, _archiveHandle::public, Archive::ropt, _restoreOptions::single_txn, StartTransaction(), and _restoreOptions::txn_size.
Referenced by _LoadLOs(), _LoadLOs(), and _LoadLOs().
|
static |
Definition at line 2935 of file pg_backup_archiver.c.
References Assert, fb(), _restoreOptions::functionNames, SimpleStringList::head, _restoreOptions::indexNames, pg_fatal, _restoreOptions::schemaNames, simple_string_list_not_touched(), _restoreOptions::strict_names, _restoreOptions::tableNames, and _restoreOptions::triggerNames.
Referenced by PrintTOCSummary(), and ProcessArchiveRestoreOptions().
Definition at line 4672 of file pg_backup_archiver.c.
References fb(), and TocEntrySizeCompareQsort().
Referenced by restore_toc_entries_parallel().
Definition at line 4650 of file pg_backup_archiver.c.
References fb().
Referenced by TocEntrySizeCompareBinaryheap(), and WriteDataChunks().
| int TocIDRequired | ( | ArchiveHandle * | AH, |
| DumpId | id | ||
| ) |
Definition at line 2042 of file pg_backup_archiver.c.
References getTocEntryByDumpId(), and _tocEntry::reqs.
Referenced by _tarPositionTo(), and findDumpableDependencies().
| void warn_or_exit_horribly | ( | ArchiveHandle * | AH, |
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 1896 of file pg_backup_archiver.c.
References _tocEntry::catalogId, _archiveHandle::currentTE, _tocEntry::desc, _tocEntry::dumpId, exit_nicely(), Archive::exit_on_error, fb(), _archiveHandle::lastErrorStage, _archiveHandle::lastErrorTE, Archive::n_errors, CatalogId::oid, _tocEntry::owner, PG_LOG_ERROR, pg_log_generic_v(), pg_log_info, PG_LOG_PRIMARY, _archiveHandle::public, _archiveHandle::stage, STAGE_FINALIZING, STAGE_INITIALIZING, STAGE_NONE, STAGE_PROCESSING, CatalogId::tableoid, and _tocEntry::tag.
Referenced by _printTableAccessMethodNoStorage(), _selectOutputSchema(), _selectTableAccessMethod(), _selectTablespace(), dump_lo_buf(), EndDBCopyMode(), and ExecuteSqlCommand().
Definition at line 1220 of file pg_backup_archiver.c.
References _archiveHandle::currToc, data, fb(), pg_fatal, and _archiveHandle::WriteDataPtr.
Referenced by archprintf(), archputs(), dumpLOs(), and dumpTableData_copy().
| void WriteDataChunks | ( | ArchiveHandle * | AH, |
| ParallelState * | pstate | ||
| ) |
Definition at line 2496 of file pg_backup_archiver.c.
References ACT_DUMP, _tocEntry::dataDumper, DispatchJobForTocEntry(), fb(), i, mark_dump_job_done(), _tocEntry::next, ParallelState::numWorkers, pg_free(), pg_malloc(), qsort, REQ_DATA, _tocEntry::reqs, _archiveHandle::toc, _archiveHandle::tocCount, TocEntrySizeCompareQsort(), WaitForWorkers(), WFW_ALL_IDLE, and WriteDataChunksForTocEntry().
Referenced by _CloseArchive(), _CloseArchive(), and _CloseArchive().
| void WriteDataChunksForTocEntry | ( | ArchiveHandle * | AH, |
| TocEntry * | te | ||
| ) |
Definition at line 2577 of file pg_backup_archiver.c.
References _archiveHandle::currToc, _tocEntry::dataDumper, _tocEntry::dataDumperArg, _tocEntry::desc, _archiveHandle::EndDataPtr, _archiveHandle::EndLOsPtr, fb(), _archiveHandle::StartDataPtr, and _archiveHandle::StartLOsPtr.
Referenced by _WorkerJobDumpDirectory(), and WriteDataChunks().
| void WriteHead | ( | ArchiveHandle * | AH | ) |
Definition at line 4120 of file pg_backup_archiver.c.
References pg_compress_specification::algorithm, ARCHIVE_MAJOR, ARCHIVE_MINOR, ARCHIVE_REV, _archiveHandle::compression_spec, _archiveHandle::connection, _archiveHandle::createDate, fb(), _archiveHandle::format, _archiveHandle::intSize, _archiveHandle::offSize, PQdb(), _archiveHandle::public, Archive::remoteVersionStr, tm, _archiveHandle::version, _archiveHandle::WriteBufPtr, _archiveHandle::WriteBytePtr, WriteInt(), and WriteStr().
Referenced by _CloseArchive(), _CloseArchive(), and _CloseArchive().
| size_t WriteInt | ( | ArchiveHandle * | AH, |
| int | i | ||
| ) |
Definition at line 2134 of file pg_backup_archiver.c.
References b, i, _archiveHandle::intSize, and _archiveHandle::WriteBytePtr.
Referenced by _CustomWriteFunc(), _EndData(), _EndLO(), _EndLOs(), _StartData(), _StartLO(), _StartLOs(), WriteHead(), WriteStr(), and WriteToc().
| size_t WriteOffset | ( | ArchiveHandle * | AH, |
| pgoff_t | o, | ||
| int | wasSet | ||
| ) |
Definition at line 2053 of file pg_backup_archiver.c.
References fb(), and _archiveHandle::WriteBytePtr.
Referenced by _WriteExtraToc().
| size_t WriteStr | ( | ArchiveHandle * | AH, |
| const char * | c | ||
| ) |
Definition at line 2192 of file pg_backup_archiver.c.
References fb(), len, _archiveHandle::WriteBufPtr, and WriteInt().
Referenced by _WriteExtraToc(), _WriteExtraToc(), WriteHead(), and WriteToc().
| void WriteToc | ( | ArchiveHandle * | AH | ) |
Definition at line 2610 of file pg_backup_archiver.c.
References archCustom, _tocEntry::catalogId, _tocEntry::copyStmt, _tocEntry::dataDumper, _tocEntry::defn, _tocEntry::defnDumper, _tocEntry::defnDumperArg, _tocEntry::defnLen, _tocEntry::dependencies, _tocEntry::desc, _tocEntry::dropStmt, _tocEntry::dumpId, fb(), _archiveHandle::FH, _archiveHandle::format, fseeko, i, _tocEntry::nDeps, _tocEntry::next, CatalogId::oid, _tocEntry::owner, pg_fatal, pg_free(), _tocEntry::relkind, REQ_DATA, REQ_SCHEMA, REQ_SPECIAL, REQ_STATS, _tocEntry::reqs, _tocEntry::section, sprintf, _tocEntry::tableam, CatalogId::tableoid, _tocEntry::tablespace, _tocEntry::tag, _archiveHandle::toc, _archiveHandle::WriteExtraTocPtr, WriteInt(), and WriteStr().
Referenced by _CloseArchive(), _CloseArchive(), and _CloseArchive().