PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | sqlparseInfo |
struct | _archiveHandle |
struct | _tocEntry |
struct | _archiveOpts |
Macros | |
#define | LOBBUFSIZE 16384 |
#define | BLK_DATA 1 |
#define | BLK_BLOBS 3 |
#define | MAKE_ARCHIVE_VERSION(major, minor, rev) (((major) * 256 + (minor)) * 256 + (rev)) |
#define | ARCHIVE_MAJOR(version) (((version) >> 16) & 255) |
#define | ARCHIVE_MINOR(version) (((version) >> 8) & 255) |
#define | ARCHIVE_REV(version) (((version) ) & 255) |
#define | K_VERS_1_0 MAKE_ARCHIVE_VERSION(1, 0, 0) |
#define | K_VERS_1_2 MAKE_ARCHIVE_VERSION(1, 2, 0) /* Allow No ZLIB */ |
#define | K_VERS_1_3 MAKE_ARCHIVE_VERSION(1, 3, 0) /* BLOBS */ |
#define | K_VERS_1_4 MAKE_ARCHIVE_VERSION(1, 4, 0) /* Date & name in header */ |
#define | K_VERS_1_5 MAKE_ARCHIVE_VERSION(1, 5, 0) /* Handle dependencies */ |
#define | K_VERS_1_6 MAKE_ARCHIVE_VERSION(1, 6, 0) /* Schema field in TOCs */ |
#define | K_VERS_1_7 |
#define | K_VERS_1_8 |
#define | K_VERS_1_9 |
#define | K_VERS_1_10 MAKE_ARCHIVE_VERSION(1, 10, 0) /* add tablespace */ |
#define | K_VERS_1_11 |
#define | K_VERS_1_12 |
#define | K_VERS_1_13 |
#define | K_VERS_1_14 MAKE_ARCHIVE_VERSION(1, 14, 0) /* add tableam */ |
#define | K_VERS_1_15 |
#define | K_VERS_1_16 |
#define | K_VERS_MAJOR 1 |
#define | K_VERS_MINOR 16 |
#define | K_VERS_REV 0 |
#define | K_VERS_SELF MAKE_ARCHIVE_VERSION(K_VERS_MAJOR, K_VERS_MINOR, K_VERS_REV) |
#define | K_VERS_MAX MAKE_ARCHIVE_VERSION(K_VERS_MAJOR, K_VERS_MINOR, 255) |
#define | K_OFFSET_POS_NOT_SET 1 |
#define | K_OFFSET_POS_SET 2 |
#define | K_OFFSET_NO_DATA 3 |
#define | WORKER_OK 0 |
#define | WORKER_CREATE_DONE 10 |
#define | WORKER_INHIBIT_DATA 11 |
#define | WORKER_IGNORED_ERRORS 12 |
#define | READ_ERROR_EXIT(fd) |
#define | WRITE_ERROR_EXIT |
#define | RESTORE_PASS_LAST RESTORE_PASS_POST_ACL |
#define | REQ_SCHEMA 0x01 /* want schema */ |
#define | REQ_DATA 0x02 /* want data */ |
#define | REQ_SPECIAL 0x04 /* for special TOC entries */ |
#define | ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__} |
#define | appendStringLiteralAHX(buf, str, AH) appendStringLiteral(buf, str, (AH)->public.encoding, (AH)->public.std_strings) |
#define | appendByteaLiteralAHX(buf, str, len, AH) appendByteaLiteral(buf, str, len, (AH)->public.std_strings) |
Enumerations | |
enum | T_Action { ACT_DUMP , ACT_RESTORE } |
enum | sqlparseState { SQL_SCAN = 0 , SQL_IN_SINGLE_QUOTE , SQL_IN_DOUBLE_QUOTE } |
enum | ArchiverStage { STAGE_NONE = 0 , STAGE_INITIALIZING , STAGE_PROCESSING , STAGE_FINALIZING } |
enum | ArchiverOutput { OUTPUT_SQLCMDS = 0 , OUTPUT_COPYDATA , OUTPUT_OTHERDATA } |
enum | RestorePass { RESTORE_PASS_MAIN = 0 , RESTORE_PASS_ACL , RESTORE_PASS_POST_ACL } |
#define appendByteaLiteralAHX | ( | buf, | |
str, | |||
len, | |||
AH | |||
) | appendByteaLiteral(buf, str, len, (AH)->public.std_strings) |
Definition at line 420 of file pg_backup_archiver.h.
#define appendStringLiteralAHX | ( | buf, | |
str, | |||
AH | |||
) | appendStringLiteral(buf, str, (AH)->public.encoding, (AH)->public.std_strings) |
Definition at line 417 of file pg_backup_archiver.h.
#define ARCHIVE_MAJOR | ( | version | ) | (((version) >> 16) & 255) |
Definition at line 42 of file pg_backup_archiver.h.
#define ARCHIVE_MINOR | ( | version | ) | (((version) >> 8) & 255) |
Definition at line 43 of file pg_backup_archiver.h.
#define ARCHIVE_OPTS | ( | ... | ) | &(ArchiveOpts){__VA_ARGS__} |
Definition at line 399 of file pg_backup_archiver.h.
#define ARCHIVE_REV | ( | version | ) | (((version) ) & 255) |
Definition at line 44 of file pg_backup_archiver.h.
#define BLK_BLOBS 3 |
Definition at line 37 of file pg_backup_archiver.h.
#define BLK_DATA 1 |
Definition at line 36 of file pg_backup_archiver.h.
#define K_OFFSET_NO_DATA 3 |
Definition at line 77 of file pg_backup_archiver.h.
#define K_OFFSET_POS_NOT_SET 1 |
Definition at line 75 of file pg_backup_archiver.h.
#define K_OFFSET_POS_SET 2 |
Definition at line 76 of file pg_backup_archiver.h.
#define K_VERS_1_0 MAKE_ARCHIVE_VERSION(1, 0, 0) |
Definition at line 47 of file pg_backup_archiver.h.
#define K_VERS_1_10 MAKE_ARCHIVE_VERSION(1, 10, 0) /* add tablespace */ |
Definition at line 56 of file pg_backup_archiver.h.
#define K_VERS_1_11 |
Definition at line 57 of file pg_backup_archiver.h.
#define K_VERS_1_12 |
Definition at line 58 of file pg_backup_archiver.h.
#define K_VERS_1_13 |
Definition at line 59 of file pg_backup_archiver.h.
#define K_VERS_1_14 MAKE_ARCHIVE_VERSION(1, 14, 0) /* add tableam */ |
Definition at line 60 of file pg_backup_archiver.h.
#define K_VERS_1_15 |
Definition at line 61 of file pg_backup_archiver.h.
#define K_VERS_1_16 |
Definition at line 62 of file pg_backup_archiver.h.
#define K_VERS_1_2 MAKE_ARCHIVE_VERSION(1, 2, 0) /* Allow No ZLIB */ |
Definition at line 48 of file pg_backup_archiver.h.
#define K_VERS_1_3 MAKE_ARCHIVE_VERSION(1, 3, 0) /* BLOBS */ |
Definition at line 49 of file pg_backup_archiver.h.
#define K_VERS_1_4 MAKE_ARCHIVE_VERSION(1, 4, 0) /* Date & name in header */ |
Definition at line 50 of file pg_backup_archiver.h.
#define K_VERS_1_5 MAKE_ARCHIVE_VERSION(1, 5, 0) /* Handle dependencies */ |
Definition at line 51 of file pg_backup_archiver.h.
#define K_VERS_1_6 MAKE_ARCHIVE_VERSION(1, 6, 0) /* Schema field in TOCs */ |
Definition at line 52 of file pg_backup_archiver.h.
#define K_VERS_1_7 |
Definition at line 53 of file pg_backup_archiver.h.
#define K_VERS_1_8 |
Definition at line 54 of file pg_backup_archiver.h.
#define K_VERS_1_9 |
Definition at line 55 of file pg_backup_archiver.h.
#define K_VERS_MAJOR 1 |
Definition at line 65 of file pg_backup_archiver.h.
#define K_VERS_MAX MAKE_ARCHIVE_VERSION(K_VERS_MAJOR, K_VERS_MINOR, 255) |
Definition at line 71 of file pg_backup_archiver.h.
#define K_VERS_MINOR 16 |
Definition at line 66 of file pg_backup_archiver.h.
#define K_VERS_REV 0 |
Definition at line 67 of file pg_backup_archiver.h.
#define K_VERS_SELF MAKE_ARCHIVE_VERSION(K_VERS_MAJOR, K_VERS_MINOR, K_VERS_REV) |
Definition at line 68 of file pg_backup_archiver.h.
#define LOBBUFSIZE 16384 |
Definition at line 33 of file pg_backup_archiver.h.
#define MAKE_ARCHIVE_VERSION | ( | major, | |
minor, | |||
rev | |||
) | (((major) * 256 + (minor)) * 256 + (rev)) |
Definition at line 40 of file pg_backup_archiver.h.
#define READ_ERROR_EXIT | ( | fd | ) |
Definition at line 92 of file pg_backup_archiver.h.
#define REQ_DATA 0x02 /* want data */ |
Definition at line 200 of file pg_backup_archiver.h.
#define REQ_SCHEMA 0x01 /* want schema */ |
Definition at line 199 of file pg_backup_archiver.h.
#define REQ_SPECIAL 0x04 /* for special TOC entries */ |
Definition at line 201 of file pg_backup_archiver.h.
#define RESTORE_PASS_LAST RESTORE_PASS_POST_ACL |
Definition at line 196 of file pg_backup_archiver.h.
#define WORKER_CREATE_DONE 10 |
Definition at line 84 of file pg_backup_archiver.h.
#define WORKER_IGNORED_ERRORS 12 |
Definition at line 86 of file pg_backup_archiver.h.
#define WORKER_INHIBIT_DATA 11 |
Definition at line 85 of file pg_backup_archiver.h.
#define WORKER_OK 0 |
Definition at line 83 of file pg_backup_archiver.h.
#define WRITE_ERROR_EXIT |
Definition at line 100 of file pg_backup_archiver.h.
typedef void(* ArchiveEntryPtrType) (ArchiveHandle *AH, TocEntry *te) |
Definition at line 113 of file pg_backup_archiver.h.
typedef struct _archiveHandle ArchiveHandle |
Definition at line 1 of file pg_backup_archiver.h.
typedef void struct _archiveOpts ArchiveOpts |
typedef void(* ClonePtrType) (ArchiveHandle *AH) |
Definition at line 134 of file pg_backup_archiver.h.
typedef void(* ClosePtrType) (ArchiveHandle *AH) |
Definition at line 111 of file pg_backup_archiver.h.
typedef size_t(* CustomOutPtrType) (ArchiveHandle *AH, const void *buf, size_t len) |
Definition at line 140 of file pg_backup_archiver.h.
typedef void(* DeClonePtrType) (ArchiveHandle *AH) |
Definition at line 135 of file pg_backup_archiver.h.
typedef void(* EndDataPtrType) (ArchiveHandle *AH, TocEntry *te) |
Definition at line 117 of file pg_backup_archiver.h.
typedef void(* EndLOPtrType) (ArchiveHandle *AH, TocEntry *te, Oid oid) |
Definition at line 121 of file pg_backup_archiver.h.
typedef void(* EndLOsPtrType) (ArchiveHandle *AH, TocEntry *te) |
Definition at line 122 of file pg_backup_archiver.h.
typedef void(* PrepParallelRestorePtrType) (ArchiveHandle *AH) |
Definition at line 133 of file pg_backup_archiver.h.
typedef void(* PrintExtraTocPtrType) (ArchiveHandle *AH, TocEntry *te) |
Definition at line 130 of file pg_backup_archiver.h.
typedef void(* PrintTocDataPtrType) (ArchiveHandle *AH, TocEntry *te) |
Definition at line 131 of file pg_backup_archiver.h.
typedef void(* ReadBufPtrType) (ArchiveHandle *AH, void *buf, size_t len) |
Definition at line 127 of file pg_backup_archiver.h.
typedef int(* ReadBytePtrType) (ArchiveHandle *AH) |
Definition at line 125 of file pg_backup_archiver.h.
typedef void(* ReadExtraTocPtrType) (ArchiveHandle *AH, TocEntry *te) |
Definition at line 129 of file pg_backup_archiver.h.
typedef void(* ReopenPtrType) (ArchiveHandle *AH) |
Definition at line 112 of file pg_backup_archiver.h.
typedef void(* StartDataPtrType) (ArchiveHandle *AH, TocEntry *te) |
Definition at line 115 of file pg_backup_archiver.h.
typedef void(* StartLOPtrType) (ArchiveHandle *AH, TocEntry *te, Oid oid) |
Definition at line 120 of file pg_backup_archiver.h.
typedef void(* StartLOsPtrType) (ArchiveHandle *AH, TocEntry *te) |
Definition at line 119 of file pg_backup_archiver.h.
Definition at line 1 of file pg_backup_archiver.h.
typedef int(* WorkerJobDumpPtrType) (ArchiveHandle *AH, TocEntry *te) |
Definition at line 137 of file pg_backup_archiver.h.
typedef int(* WorkerJobRestorePtrType) (ArchiveHandle *AH, TocEntry *te) |
Definition at line 138 of file pg_backup_archiver.h.
typedef void(* WriteBufPtrType) (ArchiveHandle *AH, const void *c, size_t len) |
Definition at line 126 of file pg_backup_archiver.h.
typedef int(* WriteBytePtrType) (ArchiveHandle *AH, const int i) |
Definition at line 124 of file pg_backup_archiver.h.
typedef void(* WriteDataPtrType) (ArchiveHandle *AH, const void *data, size_t dLen) |
Definition at line 116 of file pg_backup_archiver.h.
typedef void(* WriteExtraTocPtrType) (ArchiveHandle *AH, TocEntry *te) |
Definition at line 128 of file pg_backup_archiver.h.
enum ArchiverOutput |
Enumerator | |
---|---|
OUTPUT_SQLCMDS | |
OUTPUT_COPYDATA | |
OUTPUT_OTHERDATA |
Definition at line 164 of file pg_backup_archiver.h.
enum ArchiverStage |
Enumerator | |
---|---|
STAGE_NONE | |
STAGE_INITIALIZING | |
STAGE_PROCESSING | |
STAGE_FINALIZING |
Definition at line 156 of file pg_backup_archiver.h.
enum RestorePass |
Enumerator | |
---|---|
RESTORE_PASS_MAIN | |
RESTORE_PASS_ACL | |
RESTORE_PASS_POST_ACL |
Definition at line 190 of file pg_backup_archiver.h.
enum sqlparseState |
Enumerator | |
---|---|
SQL_SCAN | |
SQL_IN_SINGLE_QUOTE | |
SQL_IN_DOUBLE_QUOTE |
Definition at line 142 of file pg_backup_archiver.h.
enum T_Action |
int ahprintf | ( | ArchiveHandle * | AH, |
const char * | fmt, | ||
... | |||
) |
void ahwrite | ( | const void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
ArchiveHandle * | AH | ||
) |
Definition at line 1808 of file pg_backup_archiver.c.
References _archiveHandle::CustomOutPtr, dump_lo_buf(), ExecuteSqlCommandBuf(), if(), _archiveHandle::lo_buf, _archiveHandle::lo_buf_size, _archiveHandle::lo_buf_used, _archiveHandle::OF, _archiveHandle::public, remaining, RestoringToDB(), size, WRITE_ERROR_EXIT, CompressFileHandle::write_func, and _archiveHandle::writingLO.
Referenced by _LoadLOs(), _PrintFileData(), _PrintTocData(), _WriteData(), ahprintf(), and ReadDataFromArchiveNone().
TocEntry* ArchiveEntry | ( | Archive * | AHX, |
CatalogId | catalogId, | ||
DumpId | dumpId, | ||
ArchiveOpts * | opts | ||
) |
Definition at line 1203 of file pg_backup_archiver.c.
References _archiveHandle::ArchiveEntryPtr, _tocEntry::catalogId, _tocEntry::copyStmt, _tocEntry::dataDumper, _tocEntry::dataDumperArg, _tocEntry::dataLength, _tocEntry::defn, _tocEntry::dependencies, _tocEntry::desc, _tocEntry::dropStmt, _tocEntry::dumpId, _tocEntry::formatData, _tocEntry::hadDumper, _archiveHandle::maxDumpId, _tocEntry::nDeps, _tocEntry::next, opts, _tocEntry::owner, pg_malloc(), pg_malloc0(), pg_strdup(), _tocEntry::prev, _tocEntry::relkind, _tocEntry::section, _tocEntry::tableam, _tocEntry::tablespace, _tocEntry::tag, _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(), dumpRule(), dumpSearchPath(), dumpSecLabel(), dumpSequence(), dumpSequenceData(), dumpShellType(), dumpStatisticsExt(), dumpStdStrings(), dumpSubscription(), dumpSubscriptionTable(), dumpTableAttach(), dumpTableComment(), dumpTableData(), dumpTableSchema(), dumpTableSecLabel(), dumpTransform(), dumpTrigger(), dumpTSConfig(), dumpTSDictionary(), dumpTSParser(), dumpTSTemplate(), dumpUndefinedType(), dumpUserMappings(), and refreshMatViewData().
bool checkSeek | ( | FILE * | fp | ) |
Definition at line 4117 of file pg_backup_archiver.c.
References fseeko, ftello, and pgoff_t.
Referenced by InitArchiveFmt_Custom(), and InitArchiveFmt_Tar().
ArchiveHandle* CloneArchive | ( | ArchiveHandle * | AH | ) |
Definition at line 4984 of file pg_backup_archiver.c.
References _doSetFixedOutputState(), archModeRead, Assert, _archiveHandle::ClonePtr, _archiveHandle::connCancel, ConnectDatabase(), _archiveHandle::connection, _restoreOptions::cparams, _archiveHandle::currSchema, _archiveHandle::currTableAm, _archiveHandle::currTablespace, _archiveHandle::currUser, _archiveHandle::lo_buf, _archiveHandle::mode, Archive::n_errors, pg_malloc(), pg_strdup(), _archiveHandle::public, Archive::ropt, _archiveHandle::savedPassword, _archiveHandle::sqlparse, and _restoreOptions::txn_size.
Referenced by RunWorker().
void DeCloneArchive | ( | ArchiveHandle * | AH | ) |
Definition at line 5048 of file pg_backup_archiver.c.
References Assert, _archiveHandle::connection, sqlparseInfo::curCmd, _archiveHandle::currSchema, _archiveHandle::currTableAm, _archiveHandle::currTablespace, _archiveHandle::currUser, _archiveHandle::DeClonePtr, destroyPQExpBuffer(), free, _archiveHandle::savedPassword, and _archiveHandle::sqlparse.
Referenced by RunWorker().
void DropLOIfExists | ( | ArchiveHandle * | AH, |
Oid | oid | ||
) |
Definition at line 673 of file pg_backup_db.c.
References ahprintf().
Referenced by _StartLO(), RestoreArchive(), and StartRestoreLO().
void EndRestoreLO | ( | ArchiveHandle * | AH, |
Oid | oid | ||
) |
Definition at line 1503 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().
void EndRestoreLOs | ( | ArchiveHandle * | AH | ) |
Definition at line 1430 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().
TocEntry* getTocEntryByDumpId | ( | ArchiveHandle * | AH, |
DumpId | id | ||
) |
Definition at line 1988 of file pg_backup_archiver.c.
References buildTocEntryArrays(), and _archiveHandle::tocsByDumpId.
Referenced by _PrintTocData(), _tocEntryRequired(), IssueACLPerBlob(), parseWorkerCommand(), SortTocFromFile(), and TocIDRequired().
void InitArchiveFmt_Custom | ( | ArchiveHandle * | AH | ) |
Definition at line 106 of file pg_backup_custom.c.
References _ArchiveEntry(), _Clone(), _CloseArchive(), _DeClone(), _EndData(), _EndLO(), _EndLOs(), _getFilePos(), _PrepParallelRestore(), _PrintExtraToc(), _PrintTocData(), _ReadBuf(), _ReadByte(), _ReadExtraToc(), _ReopenArchive(), _StartData(), _StartLO(), _StartLOs(), _WorkerJobRestoreCustom(), _WriteBuf(), _WriteByte(), _WriteData(), _WriteExtraToc(), _archiveHandle::ArchiveEntryPtr, archModeWrite, checkSeek(), _archiveHandle::ClonePtr, _archiveHandle::ClosePtr, _archiveHandle::DeClonePtr, _archiveHandle::EndDataPtr, _archiveHandle::EndLOPtr, _archiveHandle::EndLOsPtr, _archiveHandle::FH, _archiveHandle::formatData, _archiveHandle::fSpec, lclContext::hasSeek, lclContext::lastFilePos, _archiveHandle::mode, PG_BINARY_R, PG_BINARY_W, pg_fatal, pg_malloc0(), _archiveHandle::PrepParallelRestorePtr, _archiveHandle::PrintExtraTocPtr, _archiveHandle::PrintTocDataPtr, _archiveHandle::ReadBufPtr, _archiveHandle::ReadBytePtr, _archiveHandle::ReadExtraTocPtr, ReadHead(), ReadToc(), _archiveHandle::ReopenPtr, _archiveHandle::StartDataPtr, _archiveHandle::StartLOPtr, _archiveHandle::StartLOsPtr, generate_unaccent_rules::stdout, _archiveHandle::WorkerJobDumpPtr, _archiveHandle::WorkerJobRestorePtr, _archiveHandle::WriteBufPtr, _archiveHandle::WriteBytePtr, _archiveHandle::WriteDataPtr, and _archiveHandle::WriteExtraTocPtr.
Referenced by _allocAH().
void InitArchiveFmt_Directory | ( | ArchiveHandle * | AH | ) |
Definition at line 109 of file pg_backup_directory.c.
References _ArchiveEntry(), _Clone(), _CloseArchive(), _DeClone(), _EndData(), _EndLO(), _EndLOs(), _PrepParallelRestore(), _PrintExtraToc(), _PrintTocData(), _ReadBuf(), _ReadByte(), _ReadExtraToc(), _ReopenArchive(), _StartData(), _StartLO(), _StartLOs(), _WorkerJobDumpDirectory(), _WorkerJobRestoreDirectory(), _WriteBuf(), _WriteByte(), _WriteData(), _WriteExtraToc(), archDirectory, _archiveHandle::ArchiveEntryPtr, archModeWrite, archTar, _archiveHandle::ClonePtr, closedir(), _archiveHandle::ClosePtr, dirent::d_name, lclContext::dataFH, _archiveHandle::DeClonePtr, lclContext::directory, EndCompressFileHandle(), _archiveHandle::EndDataPtr, _archiveHandle::EndLOPtr, _archiveHandle::EndLOsPtr, _archiveHandle::format, _archiveHandle::formatData, _archiveHandle::fSpec, InitDiscoverCompressFileHandle(), lclContext::LOsTocFH, MAXPGPATH, mkdir, _archiveHandle::mode, opendir(), PG_BINARY_R, pg_fatal, pg_malloc0(), _archiveHandle::PrepParallelRestorePtr, _archiveHandle::PrintExtraTocPtr, _archiveHandle::PrintTocDataPtr, _archiveHandle::ReadBufPtr, _archiveHandle::ReadBytePtr, readdir(), _archiveHandle::ReadExtraTocPtr, ReadHead(), ReadToc(), _archiveHandle::ReopenPtr, S_ISDIR, setFilePath(), stat::st_mode, _archiveHandle::StartDataPtr, _archiveHandle::StartLOPtr, _archiveHandle::StartLOsPtr, stat, _archiveHandle::WorkerJobDumpPtr, _archiveHandle::WorkerJobRestorePtr, _archiveHandle::WriteBufPtr, _archiveHandle::WriteBytePtr, _archiveHandle::WriteDataPtr, and _archiveHandle::WriteExtraTocPtr.
Referenced by _allocAH().
void InitArchiveFmt_Null | ( | ArchiveHandle * | AH | ) |
Definition at line 48 of file pg_backup_null.c.
References _CloseArchive(), _EndData(), _EndLO(), _EndLOs(), _PrintTocData(), _StartLO(), _StartLOs(), _WriteBuf(), _WriteByte(), _WriteData(), archModeRead, _archiveHandle::ClonePtr, _archiveHandle::ClosePtr, _archiveHandle::DeClonePtr, _archiveHandle::EndDataPtr, _archiveHandle::EndLOPtr, _archiveHandle::EndLOsPtr, _archiveHandle::mode, pg_fatal, _archiveHandle::PrintTocDataPtr, _archiveHandle::ReopenPtr, _archiveHandle::StartLOPtr, _archiveHandle::StartLOsPtr, _archiveHandle::WriteBufPtr, _archiveHandle::WriteBytePtr, and _archiveHandle::WriteDataPtr.
Referenced by _allocAH().
void InitArchiveFmt_Tar | ( | ArchiveHandle * | AH | ) |
Definition at line 121 of file pg_backup_tar.c.
References _ArchiveEntry(), _CloseArchive(), _EndData(), _EndLO(), _EndLOs(), _PrintExtraToc(), _PrintTocData(), _ReadBuf(), _ReadByte(), _ReadExtraToc(), _StartData(), _StartLO(), _StartLOs(), _WriteBuf(), _WriteByte(), _WriteData(), _WriteExtraToc(), archModeWrite, checkSeek(), lclContext::FH, lclContext::filePos, lclContext::hasSeek, lclContext::isSpecialScript, PG_BINARY_R, PG_BINARY_W, PG_COMPRESSION_NONE, pg_fatal, pg_malloc0_object, ReadHead(), ReadToc(), generate_unaccent_rules::stdout, tarClose(), lclContext::tarFH, lclContext::tarFHpos, and tarOpen().
Referenced by _allocAH().
void IssueACLPerBlob | ( | ArchiveHandle * | AH, |
TocEntry * | te | ||
) |
Definition at line 599 of file pg_backup_db.c.
References Assert, buf, _tocEntry::defn, _tocEntry::dependencies, _tocEntry::desc, getTocEntryByDumpId(), IssueCommandPerBlob(), pg_fatal, pg_free(), and pg_strdup().
Referenced by _printTocEntry().
void IssueCommandPerBlob | ( | ArchiveHandle * | AH, |
TocEntry * | te, | ||
const char * | cmdBegin, | ||
const char * | cmdEnd | ||
) |
Definition at line 552 of file pg_backup_db.c.
References ahprintf(), buf, CommitTransaction(), _archiveHandle::connection, _tocEntry::defn, pg_free(), pg_strdup(), _archiveHandle::public, Archive::ropt, StartTransaction(), _restoreOptions::txn_size, and _archiveHandle::txnCount.
Referenced by _printTocEntry(), IssueACLPerBlob(), and RestoreArchive().
bool isValidTarHeader | ( | char * | header | ) |
Definition at line 988 of file pg_backup_tar.c.
References read_tar_number(), TAR_OFFSET_CHECKSUM, TAR_OFFSET_MAGIC, TAR_OFFSET_VERSION, and tarChecksum().
Referenced by _discoverArchiveFormat().
void on_exit_close_archive | ( | Archive * | AHX | ) |
Definition at line 328 of file parallel.c.
References ShutdownInformation::AHX, archive_close_connection(), on_exit_nicely(), and shutdown_info.
Referenced by main().
int parallel_restore | ( | ArchiveHandle * | AH, |
TocEntry * | te | ||
) |
Definition at line 4617 of file pg_backup_archiver.c.
References Assert, _archiveHandle::connection, Archive::n_errors, _archiveHandle::public, and restore_toc_entry().
Referenced by _WorkerJobRestoreCustom(), and _WorkerJobRestoreDirectory().
void ReadHead | ( | ArchiveHandle * | AH | ) |
Definition at line 3983 of file pg_backup_archiver.c.
References pg_compress_specification::algorithm, _archiveHandle::archdbname, _archiveHandle::archiveDumpVersion, _archiveHandle::archiveRemoteVersion, _archiveHandle::compression_spec, _archiveHandle::createDate, errmsg(), fmt, _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 2124 of file pg_backup_archiver.c.
References b, _archiveHandle::intSize, K_VERS_1_0, _archiveHandle::ReadBytePtr, res, 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 2029 of file pg_backup_archiver.c.
References i, K_OFFSET_NO_DATA, K_OFFSET_POS_NOT_SET, K_OFFSET_POS_SET, K_VERS_1_7, _archiveHandle::offSize, pg_fatal, pgoff_t, _archiveHandle::ReadBytePtr, ReadInt(), and _archiveHandle::version.
Referenced by _ReadExtraToc().
char* ReadStr | ( | ArchiveHandle * | AH | ) |
Definition at line 2170 of file pg_backup_archiver.c.
References buf, pg_malloc(), _archiveHandle::ReadBufPtr, and ReadInt().
Referenced by _ReadExtraToc(), ReadHead(), and ReadToc().
void ReadToc | ( | ArchiveHandle * | AH | ) |
Definition at line 2630 of file pg_backup_archiver.c.
References _tocEntry::catalogId, _tocEntry::copyStmt, _tocEntry::dataLength, _tocEntry::defn, _tocEntry::dependencies, _tocEntry::desc, _tocEntry::dropStmt, _tocEntry::dumpId, 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().
void ReconnectToServer | ( | ArchiveHandle * | AH, |
const char * | dbname | ||
) |
Definition at line 74 of file pg_backup_db.c.
References ConnectDatabase(), _archiveHandle::connection, _restoreOptions::cparams, dbname, _connParams::override_dbname, pg_strdup(), PQfinish(), _archiveHandle::public, and Archive::ropt.
Referenced by _reconnectToDB().
void StartRestoreLO | ( | ArchiveHandle * | AH, |
Oid | oid, | ||
bool | drop | ||
) |
Definition at line 1453 of file pg_backup_archiver.c.
References ahprintf(), _archiveHandle::connection, DropLOIfExists(), 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().
void StartRestoreLOs | ( | ArchiveHandle * | AH | ) |
Definition at line 1406 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().
int TocIDRequired | ( | ArchiveHandle * | AH, |
DumpId | id | ||
) |
Definition at line 2001 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, | ||
... | |||
) |
void WriteDataChunks | ( | ArchiveHandle * | AH, |
struct ParallelState * | pstate | ||
) |
Definition at line 2456 of file pg_backup_archiver.c.
References ACT_DUMP, _tocEntry::dataDumper, DispatchJobForTocEntry(), 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().
void WriteDataChunksForTocEntry | ( | ArchiveHandle * | AH, |
TocEntry * | te | ||
) |
Definition at line 2537 of file pg_backup_archiver.c.
References _archiveHandle::currToc, _tocEntry::dataDumper, _tocEntry::dataDumperArg, _tocEntry::desc, _archiveHandle::EndDataPtr, _archiveHandle::EndLOsPtr, _archiveHandle::StartDataPtr, and _archiveHandle::StartLOsPtr.
Referenced by _WorkerJobDumpDirectory(), and WriteDataChunks().
void WriteHead | ( | ArchiveHandle * | AH | ) |
Definition at line 3957 of file pg_backup_archiver.c.
References pg_compress_specification::algorithm, ARCHIVE_MAJOR, ARCHIVE_MINOR, ARCHIVE_REV, _archiveHandle::compression_spec, _archiveHandle::connection, _archiveHandle::createDate, _archiveHandle::format, _archiveHandle::intSize, _archiveHandle::offSize, PQdb(), _archiveHandle::public, Archive::remoteVersionStr, tm, _archiveHandle::version, _archiveHandle::WriteBufPtr, _archiveHandle::WriteBytePtr, WriteInt(), and WriteStr().
Referenced by _CloseArchive().
size_t WriteInt | ( | ArchiveHandle * | AH, |
int | i | ||
) |
Definition at line 2093 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 2012 of file pg_backup_archiver.c.
References pgoff_t, and _archiveHandle::WriteBytePtr.
Referenced by _WriteExtraToc().
size_t WriteStr | ( | ArchiveHandle * | AH, |
const char * | c | ||
) |
Definition at line 2151 of file pg_backup_archiver.c.
References len, res, _archiveHandle::WriteBufPtr, and WriteInt().
Referenced by _WriteExtraToc(), WriteHead(), and WriteToc().
void WriteToc | ( | ArchiveHandle * | AH | ) |
Definition at line 2570 of file pg_backup_archiver.c.
References _tocEntry::catalogId, _tocEntry::copyStmt, _tocEntry::dataDumper, _tocEntry::defn, _tocEntry::dependencies, _tocEntry::desc, _tocEntry::dropStmt, _tocEntry::dumpId, i, _tocEntry::nDeps, _tocEntry::next, CatalogId::oid, _tocEntry::owner, _tocEntry::relkind, REQ_DATA, REQ_SCHEMA, REQ_SPECIAL, _tocEntry::reqs, _tocEntry::section, sprintf, _tocEntry::tableam, CatalogId::tableoid, _tocEntry::tablespace, _tocEntry::tag, _archiveHandle::toc, _archiveHandle::WriteExtraTocPtr, WriteInt(), and WriteStr().
Referenced by _CloseArchive().