|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include <sys/stat.h>#include <ctype.h>#include <limits.h>#include <unistd.h>#include "common/file_utils.h"#include "fe_utils/string_utils.h"#include "pg_backup_archiver.h"#include "pg_backup_tar.h"#include "pg_backup_utils.h"#include "pgtar.h"
Go to the source code of this file.
Data Structures | |
| struct | TAR_MEMBER |
| struct | lclContext |
| struct | lclTocEntry |
Macros | |
| #define | K_STD_BUF_SIZE 1024 |
| #define K_STD_BUF_SIZE 1024 |
Definition at line 63 of file pg_backup_tar.c.
|
static |
Definition at line 234 of file pg_backup_tar.c.
References _tocEntry::dataDumper, _tocEntry::dumpId, fb(), lclTocEntry::filename, fn(), _tocEntry::formatData, K_STD_BUF_SIZE, pg_malloc0_object, pg_strdup(), snprintf, and lclTocEntry::TH.
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 769 of file pg_backup_tar.c.
References _scriptOut(), archModeWrite, _archiveHandle::CustomOutPtr, Archive::dopt, _restoreOptions::dropSchema, fb(), _archiveHandle::FH, lclContext::FH, _restoreOptions::filename, _archiveHandle::formatData, fsync_fname(), i, lclContext::isSpecialScript, _archiveHandle::mode, NewRestoreOptions(), _archiveHandle::public, RestoreArchive(), Archive::ropt, lclContext::scriptTH, SetArchiveOptions(), _restoreOptions::superuser, _restoreOptions::suppressDumpWarnings, TAR_BLOCK_SIZE, tarClose(), lclContext::tarFH, tarOpen(), tarPrintf(), Archive::verbose, WRITE_ERROR_EXIT, WriteDataChunks(), WriteHead(), and WriteToc().
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 549 of file pg_backup_tar.c.
References fb(), _tocEntry::formatData, and tarClose().
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 922 of file pg_backup_tar.c.
References fb(), _tocEntry::formatData, and tarClose().
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 936 of file pg_backup_tar.c.
References _archiveHandle::formatData, lclContext::loToc, and tarClose().
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 643 of file pg_backup_tar.c.
References ahwrite(), atooid, buf, _restoreOptions::dropSchema, EndRestoreLO(), EndRestoreLOs(), fb(), lclContext::FH, _archiveHandle::formatData, K_VERS_1_16, pg_log_info, _archiveHandle::public, Archive::ropt, snprintf, StartRestoreLO(), StartRestoreLOs(), _tocEntry::tag, tarClose(), tarOpen(), tarRead(), and _archiveHandle::version.
Referenced by _PrintTocData().
|
static |
Definition at line 285 of file pg_backup_tar.c.
References ahprintf(), fb(), lclTocEntry::filename, _tocEntry::formatData, _archiveHandle::public, and Archive::verbose.
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 562 of file pg_backup_tar.c.
References ahwrite(), buf, fb(), lclContext::FH, filename, _archiveHandle::formatData, tarClose(), tarOpen(), and tarRead().
Referenced by _PrintTocData().
|
static |
Definition at line 589 of file pg_backup_tar.c.
References _LoadLOs(), _PrintFileData(), ahprintf(), ahwrite(), _tocEntry::copyStmt, _tocEntry::desc, fb(), _archiveHandle::formatData, _tocEntry::formatData, lclContext::isSpecialScript, and pg_fatal.
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 757 of file pg_backup_tar.c.
References buf, lclContext::FH, lclContext::filePos, _archiveHandle::formatData, len, pg_fatal, and tarRead().
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 731 of file pg_backup_tar.c.
References lclContext::FH, lclContext::filePos, _archiveHandle::formatData, pg_fatal, and tarRead().
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 265 of file pg_backup_tar.c.
References fb(), lclTocEntry::filename, _tocEntry::formatData, free, pg_malloc0_object, ReadStr(), and lclTocEntry::TH.
Referenced by InitArchiveFmt_Tar().
Definition at line 857 of file pg_backup_tar.c.
References buf, _archiveHandle::formatData, len, lclContext::scriptTH, and tarWrite().
Referenced by _CloseArchive().
|
static |
Definition at line 294 of file pg_backup_tar.c.
References fb(), _tocEntry::formatData, and tarOpen().
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 896 of file pg_backup_tar.c.
References pg_compress_specification::algorithm, _archiveHandle::compression_spec, fb(), _archiveHandle::formatData, _tocEntry::formatData, lclContext::loToc, PG_COMPRESSION_NONE, pg_fatal, sprintf, tarOpen(), and tarPrintf().
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 879 of file pg_backup_tar.c.
References _tocEntry::dumpId, _archiveHandle::formatData, K_STD_BUF_SIZE, lclContext::loToc, sprintf, and tarOpen().
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 1014 of file pg_backup_tar.c.
References _tarWriteHeader(), buf, fb(), _archiveHandle::formatData, fseeko, ftello, i, len, pg_fatal, READ_ERROR_EXIT, lclContext::tarFHpos, tarPaddingBytesRequired(), and WRITE_ERROR_EXIT.
Referenced by tarClose().
|
static |
Definition at line 1140 of file pg_backup_tar.c.
References _tarReadRaw(), fb(), _archiveHandle::formatData, ftello, i, len, ngettext, pg_fatal, pg_log_debug, pg_strdup(), read_tar_number(), strlcpy(), TAR_BLOCK_SIZE, TAR_OFFSET_CHECKSUM, TAR_OFFSET_NAME, TAR_OFFSET_SIZE, tarChecksum(), lclContext::tarFH, and lclContext::tarFHpos.
Referenced by _tarPositionTo().
|
static |
Definition at line 1066 of file pg_backup_tar.c.
References _tarGetHeader(), _tarReadRaw(), fb(), filename, _archiveHandle::formatData, free, i, len, pg_fatal, pg_log_debug, pg_malloc0_object, REQ_DATA, TAR_BLOCK_SIZE, lclContext::tarFH, lclContext::tarFHpos, lclContext::tarNextMember, tarPaddingBytesRequired(), and TocIDRequired().
Referenced by tarOpen().
|
static |
Definition at line 462 of file pg_backup_tar.c.
References Assert, buf, fb(), _archiveHandle::formatData, len, _archiveHandle::lookahead, _archiveHandle::lookaheadLen, _archiveHandle::lookaheadPos, READ_ERROR_EXIT, and lclContext::tarFHpos.
Referenced by _tarGetHeader(), _tarPositionTo(), and tarRead().
|
static |
Definition at line 1212 of file pg_backup_tar.c.
References fb(), TAR_BLOCK_SIZE, tarCreateHeader(), and WRITE_ERROR_EXIT.
Referenced by _tarAddFile().
Definition at line 746 of file pg_backup_tar.c.
References buf, lclContext::FH, lclContext::filePos, _archiveHandle::formatData, len, tarWrite(), and WRITE_ERROR_EXIT.
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 718 of file pg_backup_tar.c.
References b, lclContext::FH, lclContext::filePos, _archiveHandle::formatData, i, tarWrite(), and WRITE_ERROR_EXIT.
Referenced by InitArchiveFmt_Tar().
Definition at line 540 of file pg_backup_tar.c.
References _archiveHandle::currToc, data, fb(), _tocEntry::formatData, tarWrite(), and WRITE_ERROR_EXIT.
Referenced by InitArchiveFmt_Tar().
|
static |
Definition at line 254 of file pg_backup_tar.c.
References lclTocEntry::filename, _tocEntry::formatData, and WriteStr().
Referenced by InitArchiveFmt_Tar().
| 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(), fb(), lclContext::FH, lclContext::filePos, lclContext::hasSeek, lclContext::isSpecialScript, PG_BINARY_R, PG_BINARY_W, PG_COMPRESSION_NONE, pg_fatal, pg_malloc0_object, ReadHead(), ReadToc(), tarClose(), lclContext::tarFH, lclContext::tarFHpos, and tarOpen().
Referenced by _allocAH().
Definition at line 988 of file pg_backup_tar.c.
References fb(), read_tar_number(), TAR_OFFSET_CHECKSUM, TAR_OFFSET_MAGIC, TAR_OFFSET_VERSION, and tarChecksum().
Referenced by _discoverArchiveFormat().
|
static |
Definition at line 398 of file pg_backup_tar.c.
References _tarAddFile(), pg_compress_specification::algorithm, _archiveHandle::compression_spec, fb(), free, PG_COMPRESSION_NONE, and pg_fatal.
Referenced by _CloseArchive(), _EndData(), _EndLO(), _EndLOs(), _LoadLOs(), _PrintFileData(), and InitArchiveFmt_Tar().
|
static |
Definition at line 302 of file pg_backup_tar.c.
References _tarPositionTo(), pg_compress_specification::algorithm, _archiveHandle::compression_spec, fb(), fd(), filename, _archiveHandle::formatData, free, mode, name, PG_COMPRESSION_NONE, pg_fatal, pg_malloc0_object, pg_strdup(), S_IRUSR, S_IRWXG, S_IRWXO, S_IWUSR, lclContext::tarFH, and tm.
Referenced by _CloseArchive(), _LoadLOs(), _PrintFileData(), _StartData(), _StartLO(), _StartLOs(), and InitArchiveFmt_Tar().
|
static |
Definition at line 954 of file pg_backup_tar.c.
References fb(), free, len, pg_malloc(), pvsnprintf(), and tarWrite().
Referenced by _CloseArchive(), and _StartLO().
|
static |
Definition at line 511 of file pg_backup_tar.c.
References _tarReadRaw(), buf, fb(), and len.
Referenced by _LoadLOs(), _PrintFileData(), _ReadBuf(), and _ReadByte().
Definition at line 529 of file pg_backup_tar.c.
References buf, fb(), and len.
Referenced by _scriptOut(), _WriteBuf(), _WriteByte(), _WriteData(), and tarPrintf().