151 pg_fatal(
"could not open output file \"%s\": %m", AH->
fSpec);
157 pg_fatal(
"could not open output file: %m");
174 pg_fatal(
"could not open input file: %m");
290 if (
tctx->dataPos >= 0)
355 if (
tctx->dataPos >= 0)
375 pg_fatal(
"invalid OID for large object");
440 pg_fatal(
"error during file seek: %m");
496 pg_fatal(
"unrecognized data block type (%d) while searching archive",
506 pg_fatal(
"error during file seek: %m");
518 pg_fatal(
"could not find block ID %d in archive -- "
519 "possibly due to out-of-order restore request, "
520 "which cannot be handled due to non-seekable input file",
523 pg_fatal(
"could not find block ID %d in archive -- "
524 "possibly corrupt archive",
530 pg_fatal(
"found unexpected block ID (%d) when reading data -- expected %d",
544 pg_fatal(
"unrecognized data block type %d while restoring archive",
642 pg_fatal(
"error during file seek: %m");
655 pg_fatal(
"could not read from input file: end of file");
657 pg_fatal(
"could not read from input file: %m");
757 pg_fatal(
"could not determine seek position in archive file: %m");
775 pg_fatal(
"could not close archive file: %m");
798 pg_fatal(
"can only reopen input archives");
805 pg_fatal(
"parallel restore from standard input is not supported");
807 pg_fatal(
"parallel restore from non-seekable file is not supported");
811 pg_fatal(
"could not determine seek position in archive file: %m");
815 pg_fatal(
"could not close archive file: %m");
823 pg_fatal(
"could not set seek position in archive file: %m");
878 pg_fatal(
"error during file seek: %m");
953 pg_fatal(
"could not determine seek position in archive file: %m");
CompressorState * AllocateCompressor(const pg_compress_specification compression_spec, ReadFunc readF, WriteFunc writeF)
void EndCompressor(ArchiveHandle *AH, CompressorState *cs)
void fsync_fname(const char *fname, bool isdir)
void * pg_malloc(size_t size)
void * pg_malloc0(size_t size)
void WriteHead(ArchiveHandle *AH)
size_t WriteInt(ArchiveHandle *AH, int i)
size_t WriteOffset(ArchiveHandle *AH, pgoff_t o, int wasSet)
void StartRestoreLOs(ArchiveHandle *AH)
TocEntry * getTocEntryByDumpId(ArchiveHandle *AH, DumpId id)
void WriteDataChunks(ArchiveHandle *AH, ParallelState *pstate)
int ahprintf(ArchiveHandle *AH, const char *fmt,...)
int ReadOffset(ArchiveHandle *AH, pgoff_t *o)
int ReadInt(ArchiveHandle *AH)
void ReadHead(ArchiveHandle *AH)
void ReadToc(ArchiveHandle *AH)
void EndRestoreLO(ArchiveHandle *AH, Oid oid)
void WriteToc(ArchiveHandle *AH)
void EndRestoreLOs(ArchiveHandle *AH)
void StartRestoreLO(ArchiveHandle *AH, Oid oid, bool drop)
int parallel_restore(ArchiveHandle *AH, TocEntry *te)
#define K_OFFSET_POS_NOT_SET
#define READ_ERROR_EXIT(fd)
static void _PrintTocData(ArchiveHandle *AH, TocEntry *te)
static void _skipData(ArchiveHandle *AH)
static void _StartData(ArchiveHandle *AH, TocEntry *te)
static void _PrintExtraToc(ArchiveHandle *AH, TocEntry *te)
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
static void _ArchiveEntry(ArchiveHandle *AH, TocEntry *te)
static void _CloseArchive(ArchiveHandle *AH)
static void _skipLOs(ArchiveHandle *AH)
static pgoff_t _getFilePos(ArchiveHandle *AH, lclContext *ctx)
static void _DeClone(ArchiveHandle *AH)
static void _ReopenArchive(ArchiveHandle *AH)
static void _StartLOs(ArchiveHandle *AH, TocEntry *te)
void InitArchiveFmt_Custom(ArchiveHandle *AH)
static void _WriteExtraToc(ArchiveHandle *AH, TocEntry *te)
static void _EndLO(ArchiveHandle *AH, TocEntry *te, Oid oid)
static size_t _CustomReadFunc(ArchiveHandle *AH, char **buf, size_t *buflen)
static void _EndLOs(ArchiveHandle *AH, TocEntry *te)
static int _WriteByte(ArchiveHandle *AH, const int i)
static void _PrepParallelRestore(ArchiveHandle *AH)
static void _StartLO(ArchiveHandle *AH, TocEntry *te, Oid oid)
static int _ReadByte(ArchiveHandle *AH)
static void _PrintData(ArchiveHandle *AH)
static void _ReadExtraToc(ArchiveHandle *AH, TocEntry *te)
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len)
static void _EndData(ArchiveHandle *AH, TocEntry *te)
static void _CustomWriteFunc(ArchiveHandle *AH, const char *buf, size_t len)
static int _WorkerJobRestoreCustom(ArchiveHandle *AH, TocEntry *te)
static void _Clone(ArchiveHandle *AH)
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
static void _readBlockHeader(ArchiveHandle *AH, int *type, int *id)
static void _LoadLOs(ArchiveHandle *AH, bool drop)
static char buf[DEFAULT_XLOG_SEG_SIZE]
#define pg_log_warning(...)
void(* readData)(ArchiveHandle *AH, CompressorState *cs)
void(* writeData)(ArchiveHandle *AH, CompressorState *cs, const void *data, size_t dLen)
DeClonePtrType DeClonePtr
ReadExtraTocPtrType ReadExtraTocPtr
WorkerJobDumpPtrType WorkerJobDumpPtr
StartLOsPtrType StartLOsPtr
ArchiveEntryPtrType ArchiveEntryPtr
pg_compress_specification compression_spec
WriteDataPtrType WriteDataPtr
StartLOPtrType StartLOPtr
WriteBufPtrType WriteBufPtr
PrepParallelRestorePtrType PrepParallelRestorePtr
WriteExtraTocPtrType WriteExtraTocPtr
ReadBytePtrType ReadBytePtr
WorkerJobRestorePtrType WorkerJobRestorePtr
PrintTocDataPtrType PrintTocDataPtr
WriteBytePtrType WriteBytePtr
ReadBufPtrType ReadBufPtr
PrintExtraTocPtrType PrintExtraTocPtr
StartDataPtrType StartDataPtr
EndDataPtrType EndDataPtr
#define fseeko(stream, offset, origin)