PostgreSQL Source Code  git master
pg_backup_archiver.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_backup_archiver.h
4  *
5  * Private interface to the pg_dump archiver routines.
6  * It is NOT intended that these routines be called by any
7  * dumper directly.
8  *
9  * See the headers to pg_restore for more details.
10  *
11  * Copyright (c) 2000, Philip Warner
12  * Rights are granted to use this software in any way so long
13  * as this notice is not removed.
14  *
15  * The author is not responsible for loss or damages that may
16  * result from it's use.
17  *
18  *
19  * IDENTIFICATION
20  * src/bin/pg_dump/pg_backup_archiver.h
21  *
22  *-------------------------------------------------------------------------
23  */
24 #ifndef __PG_BACKUP_ARCHIVE__
25 #define __PG_BACKUP_ARCHIVE__
26 
27 
28 #include <time.h>
29 
30 #include "pg_backup.h"
31 
32 #include "libpq-fe.h"
33 #include "pqexpbuffer.h"
34 
35 #define LOBBUFSIZE 16384
36 
37 /*
38  * Note: zlib.h must be included *after* libpq-fe.h, because the latter may
39  * include ssl.h, which has a naming conflict with zlib.h.
40  */
41 #ifdef HAVE_LIBZ
42 #include <zlib.h>
43 #define GZCLOSE(fh) gzclose(fh)
44 #define GZWRITE(p, s, n, fh) gzwrite(fh, p, (n) * (s))
45 #define GZREAD(p, s, n, fh) gzread(fh, p, (n) * (s))
46 #define GZEOF(fh) gzeof(fh)
47 #else
48 #define GZCLOSE(fh) fclose(fh)
49 #define GZWRITE(p, s, n, fh) (fwrite(p, s, n, fh) * (s))
50 #define GZREAD(p, s, n, fh) fread(p, s, n, fh)
51 #define GZEOF(fh) feof(fh)
52 /* this is just the redefinition of a libz constant */
53 #define Z_DEFAULT_COMPRESSION (-1)
54 
55 typedef struct _z_stream
56 {
57  void *next_in;
58  void *next_out;
59  size_t avail_in;
60  size_t avail_out;
61 } z_stream;
63 #endif
64 
65 /* Data block types */
66 #define BLK_DATA 1
67 #define BLK_BLOBS 3
68 
69 /* Encode version components into a convenient integer <maj><min><rev> */
70 #define MAKE_ARCHIVE_VERSION(major, minor, rev) (((major) * 256 + (minor)) * 256 + (rev))
71 
72 #define ARCHIVE_MAJOR(version) (((version) >> 16) & 255)
73 #define ARCHIVE_MINOR(version) (((version) >> 8) & 255)
74 #define ARCHIVE_REV(version) (((version) ) & 255)
75 
76 /* Historical version numbers (checked in code) */
77 #define K_VERS_1_0 MAKE_ARCHIVE_VERSION(1, 0, 0)
78 #define K_VERS_1_2 MAKE_ARCHIVE_VERSION(1, 2, 0) /* Allow No ZLIB */
79 #define K_VERS_1_3 MAKE_ARCHIVE_VERSION(1, 3, 0) /* BLOBs */
80 #define K_VERS_1_4 MAKE_ARCHIVE_VERSION(1, 4, 0) /* Date & name in header */
81 #define K_VERS_1_5 MAKE_ARCHIVE_VERSION(1, 5, 0) /* Handle dependencies */
82 #define K_VERS_1_6 MAKE_ARCHIVE_VERSION(1, 6, 0) /* Schema field in TOCs */
83 #define K_VERS_1_7 MAKE_ARCHIVE_VERSION(1, 7, 0) /* File Offset size in
84  * header */
85 #define K_VERS_1_8 MAKE_ARCHIVE_VERSION(1, 8, 0) /* change interpretation
86  * of ID numbers and
87  * dependencies */
88 #define K_VERS_1_9 MAKE_ARCHIVE_VERSION(1, 9, 0) /* add default_with_oids
89  * tracking */
90 #define K_VERS_1_10 MAKE_ARCHIVE_VERSION(1, 10, 0) /* add tablespace */
91 #define K_VERS_1_11 MAKE_ARCHIVE_VERSION(1, 11, 0) /* add toc section
92  * indicator */
93 #define K_VERS_1_12 MAKE_ARCHIVE_VERSION(1, 12, 0) /* add separate BLOB
94  * entries */
95 #define K_VERS_1_13 MAKE_ARCHIVE_VERSION(1, 13, 0) /* change search_path
96  * behavior */
97 
98 /* Current archive version number (the format we can output) */
99 #define K_VERS_MAJOR 1
100 #define K_VERS_MINOR 13
101 #define K_VERS_REV 0
102 #define K_VERS_SELF MAKE_ARCHIVE_VERSION(K_VERS_MAJOR, K_VERS_MINOR, K_VERS_REV);
103 
104 /* Newest format we can read */
105 #define K_VERS_MAX MAKE_ARCHIVE_VERSION(K_VERS_MAJOR, K_VERS_MINOR, 255)
106 
107 
108 /* Flags to indicate disposition of offsets stored in files */
109 #define K_OFFSET_POS_NOT_SET 1
110 #define K_OFFSET_POS_SET 2
111 #define K_OFFSET_NO_DATA 3
112 
113 /*
114  * Special exit values from worker children. We reserve 0 for normal
115  * success; 1 and other small values should be interpreted as crashes.
116  */
117 #define WORKER_OK 0
118 #define WORKER_CREATE_DONE 10
119 #define WORKER_INHIBIT_DATA 11
120 #define WORKER_IGNORED_ERRORS 12
121 
123 typedef struct _tocEntry TocEntry;
124 struct ParallelState;
125 
126 #define READ_ERROR_EXIT(fd) \
127  do { \
128  if (feof(fd)) \
129  exit_horribly(modulename, \
130  "could not read from input file: end of file\n"); \
131  else \
132  exit_horribly(modulename, \
133  "could not read from input file: %s\n", strerror(errno)); \
134  } while (0)
135 
136 #define WRITE_ERROR_EXIT \
137  do { \
138  exit_horribly(modulename, "could not write to output file: %s\n", \
139  strerror(errno)); \
140  } while (0)
141 
142 typedef enum T_Action
143 {
146 } T_Action;
147 
148 typedef void (*ClosePtrType) (ArchiveHandle *AH);
149 typedef void (*ReopenPtrType) (ArchiveHandle *AH);
151 
152 typedef void (*StartDataPtrType) (ArchiveHandle *AH, TocEntry *te);
153 typedef void (*WriteDataPtrType) (ArchiveHandle *AH, const void *data, size_t dLen);
154 typedef void (*EndDataPtrType) (ArchiveHandle *AH, TocEntry *te);
155 
156 typedef void (*StartBlobsPtrType) (ArchiveHandle *AH, TocEntry *te);
157 typedef void (*StartBlobPtrType) (ArchiveHandle *AH, TocEntry *te, Oid oid);
158 typedef void (*EndBlobPtrType) (ArchiveHandle *AH, TocEntry *te, Oid oid);
159 typedef void (*EndBlobsPtrType) (ArchiveHandle *AH, TocEntry *te);
160 
161 typedef int (*WriteBytePtrType) (ArchiveHandle *AH, const int i);
162 typedef int (*ReadBytePtrType) (ArchiveHandle *AH);
163 typedef void (*WriteBufPtrType) (ArchiveHandle *AH, const void *c, size_t len);
164 typedef void (*ReadBufPtrType) (ArchiveHandle *AH, void *buf, size_t len);
165 typedef void (*SaveArchivePtrType) (ArchiveHandle *AH);
170 
171 typedef void (*ClonePtrType) (ArchiveHandle *AH);
172 typedef void (*DeClonePtrType) (ArchiveHandle *AH);
173 
176 
177 typedef size_t (*CustomOutPtrType) (ArchiveHandle *AH, const void *buf, size_t len);
178 
179 typedef enum
180 {
181  SQL_SCAN = 0, /* normal */
182  SQL_IN_SINGLE_QUOTE, /* '...' literal */
183  SQL_IN_DOUBLE_QUOTE /* "..." identifier */
184 } sqlparseState;
185 
186 typedef struct
187 {
188  sqlparseState state; /* see above */
189  bool backSlash; /* next char is backslash quoted? */
190  PQExpBuffer curCmd; /* incomplete line (NULL if not created) */
191 } sqlparseInfo;
192 
193 typedef enum
194 {
199 } ArchiverStage;
200 
201 typedef enum
202 {
203  OUTPUT_SQLCMDS = 0, /* emitting general SQL commands */
204  OUTPUT_COPYDATA, /* writing COPY data */
205  OUTPUT_OTHERDATA /* writing data as INSERT commands */
207 
208 /*
209  * For historical reasons, ACL items are interspersed with everything else in
210  * a dump file's TOC; typically they're right after the object they're for.
211  * However, we need to restore data before ACLs, as otherwise a read-only
212  * table (ie one where the owner has revoked her own INSERT privilege) causes
213  * data restore failures. On the other hand, matview REFRESH commands should
214  * come out after ACLs, as otherwise non-superuser-owned matviews might not
215  * be able to execute. (If the permissions at the time of dumping would not
216  * allow a REFRESH, too bad; we won't fix that for you.) These considerations
217  * force us to make three passes over the TOC, restoring the appropriate
218  * subset of items in each pass. We assume that the dependency sort resulted
219  * in an appropriate ordering of items within each subset.
220  * XXX This mechanism should be superseded by tracking dependencies on ACLs
221  * properly; but we'll still need it for old dump files even after that.
222  */
223 typedef enum
224 {
225  RESTORE_PASS_MAIN = 0, /* Main pass (most TOC item types) */
226  RESTORE_PASS_ACL, /* ACL item types */
227  RESTORE_PASS_REFRESH /* Matview REFRESH items */
228 
229 #define RESTORE_PASS_LAST RESTORE_PASS_REFRESH
230 } RestorePass;
231 
232 typedef enum
233 {
234  REQ_SCHEMA = 0x01, /* want schema */
235  REQ_DATA = 0x02, /* want data */
236  REQ_SPECIAL = 0x04 /* for special TOC entries */
237 } teReqs;
238 
240 {
241  Archive public; /* Public part of archive */
242  int version; /* Version of file */
243 
244  char *archiveRemoteVersion; /* When reading an archive, the
245  * version of the dumped DB */
246  char *archiveDumpVersion; /* When reading an archive, the version of
247  * the dumper */
248 
249  int debugLevel; /* Used for logging (currently only by
250  * --verbose) */
251  size_t intSize; /* Size of an integer in the archive */
252  size_t offSize; /* Size of a file offset in the archive -
253  * Added V1.7 */
254  ArchiveFormat format; /* Archive format */
255 
256  sqlparseInfo sqlparse; /* state for parsing INSERT data */
257 
258  time_t createDate; /* Date archive created */
259 
260  /*
261  * Fields used when discovering header. A format can always get the
262  * previous read bytes from here...
263  */
264  int readHeader; /* Used if file header has been read already */
265  char *lookahead; /* Buffer used when reading header to discover
266  * format */
267  size_t lookaheadSize; /* Size of allocated buffer */
268  size_t lookaheadLen; /* Length of data in lookahead */
269  pgoff_t lookaheadPos; /* Current read position in lookahead buffer */
270 
271  ArchiveEntryPtrType ArchiveEntryPtr; /* Called for each metadata object */
272  StartDataPtrType StartDataPtr; /* Called when table data is about to be
273  * dumped */
274  WriteDataPtrType WriteDataPtr; /* Called to send some table data to the
275  * archive */
276  EndDataPtrType EndDataPtr; /* Called when table data dump is finished */
277  WriteBytePtrType WriteBytePtr; /* Write a byte to output */
278  ReadBytePtrType ReadBytePtr; /* Read a byte from an archive */
279  WriteBufPtrType WriteBufPtr; /* Write a buffer of output to the archive */
280  ReadBufPtrType ReadBufPtr; /* Read a buffer of input from the archive */
281  ClosePtrType ClosePtr; /* Close the archive */
282  ReopenPtrType ReopenPtr; /* Reopen the archive */
283  WriteExtraTocPtrType WriteExtraTocPtr; /* Write extra TOC entry data
284  * associated with the current
285  * archive format */
286  ReadExtraTocPtrType ReadExtraTocPtr; /* Read extra info associated with
287  * archive format */
288  PrintExtraTocPtrType PrintExtraTocPtr; /* Extra TOC info for format */
290 
295 
299 
300  ClonePtrType ClonePtr; /* Clone format-specific fields */
301  DeClonePtrType DeClonePtr; /* Clean up cloned fields */
302 
303  CustomOutPtrType CustomOutPtr; /* Alternative script output routine */
304 
305  /* Stuff for direct DB connection */
306  char *archdbname; /* DB name *read* from archive */
308  char *savedPassword; /* password for ropt->username, if known */
309  char *use_role;
311  /* If connCancel isn't NULL, SIGINT handler will send a cancel */
312  PGcancel *volatile connCancel;
313 
314  int connectToDB; /* Flag to indicate if direct DB connection is
315  * required */
316  ArchiverOutput outputKind; /* Flag for what we're currently writing */
317  bool pgCopyIn; /* Currently in libpq 'COPY IN' mode. */
318 
319  int loFd; /* BLOB fd */
320  int writingBlob; /* Flag */
321  int blobCount; /* # of blobs restored */
322 
323  char *fSpec; /* Archive File Spec */
324  FILE *FH; /* General purpose file handle */
325  void *OF;
326  int gzOut; /* Output file */
327 
328  struct _tocEntry *toc; /* Header of circular list of TOC entries */
329  int tocCount; /* Number of TOC entries */
330  DumpId maxDumpId; /* largest DumpId among all TOC entries */
331 
332  /* arrays created after the TOC list is complete: */
333  struct _tocEntry **tocsByDumpId; /* TOCs indexed by dumpId */
334  DumpId *tableDataId; /* TABLE DATA ids, indexed by table dumpId */
335 
336  struct _tocEntry *currToc; /* Used when dumping data */
337  int compression; /* Compression requested on open Possible
338  * values for compression: -1
339  * Z_DEFAULT_COMPRESSION 0 COMPRESSION_NONE
340  * 1-9 levels for gzip compression */
341  bool dosync; /* data requested to be synced on sight */
342  ArchiveMode mode; /* File mode - r or w */
343  void *formatData; /* Header data specific to file format */
344 
345  /* these vars track state to avoid sending redundant SET commands */
346  char *currUser; /* current username, or NULL if unknown */
347  char *currSchema; /* current schema, or NULL */
348  char *currTablespace; /* current tablespace, or NULL */
349  bool currWithOids; /* current default_with_oids setting */
350 
351  void *lo_buf;
352  size_t lo_buf_used;
353  size_t lo_buf_size;
354 
358  RestorePass restorePass; /* used only during parallel restore */
361 };
362 
363 struct _tocEntry
364 {
365  struct _tocEntry *prev;
366  struct _tocEntry *next;
370  bool hadDumper; /* Archiver was passed a dumper routine (used
371  * in restore) */
372  char *tag; /* index tag */
373  char *namespace; /* null or empty string if not in a schema */
374  char *tablespace; /* null if not in a tablespace; empty string
375  * means use database default */
376  char *owner;
377  bool withOids; /* Used only by "TABLE" tags */
378  char *desc;
379  char *defn;
380  char *dropStmt;
381  char *copyStmt;
382  DumpId *dependencies; /* dumpIds of objects this one depends on */
383  int nDeps; /* number of dependencies */
384 
385  DataDumperPtr dataDumper; /* Routine to dump data for object */
386  void *dataDumperArg; /* Arg for above routine */
387  void *formatData; /* TOC Entry data specific to file format */
388 
389  /* working state while dumping/restoring */
390  teReqs reqs; /* do we need schema and/or data of object */
391  bool created; /* set for DATA member if TABLE was created */
392 
393  /* working state (needed only for parallel restore) */
394  struct _tocEntry *par_prev; /* list links for pending/ready items; */
395  struct _tocEntry *par_next; /* these are NULL if not in either list */
396  int depCount; /* number of dependencies not yet restored */
397  DumpId *revDeps; /* dumpIds of objects depending on this one */
398  int nRevDeps; /* number of such dependencies */
399  DumpId *lockDeps; /* dumpIds of objects this one needs lock on */
400  int nLockDeps; /* number of such dependencies */
401 };
402 
403 extern int parallel_restore(ArchiveHandle *AH, TocEntry *te);
404 extern void on_exit_close_archive(Archive *AHX);
405 
406 extern void warn_or_exit_horribly(ArchiveHandle *AH, const char *modulename, const char *fmt,...) pg_attribute_printf(3, 4);
407 
408 extern void WriteTOC(ArchiveHandle *AH);
409 extern void ReadTOC(ArchiveHandle *AH);
410 extern void WriteHead(ArchiveHandle *AH);
411 extern void ReadHead(ArchiveHandle *AH);
412 extern void WriteToc(ArchiveHandle *AH);
413 extern void ReadToc(ArchiveHandle *AH);
414 extern void WriteDataChunks(ArchiveHandle *AH, struct ParallelState *pstate);
417 extern void DeCloneArchive(ArchiveHandle *AH);
418 
419 extern teReqs TocIDRequired(ArchiveHandle *AH, DumpId id);
421 extern bool checkSeek(FILE *fp);
422 
423 #define appendStringLiteralAHX(buf,str,AH) \
424  appendStringLiteral(buf, str, (AH)->public.encoding, (AH)->public.std_strings)
425 
426 #define appendByteaLiteralAHX(buf,str,len,AH) \
427  appendByteaLiteral(buf, str, len, (AH)->public.std_strings)
428 
429 /*
430  * Mandatory routines for each supported format
431  */
432 
433 extern size_t WriteInt(ArchiveHandle *AH, int i);
434 extern int ReadInt(ArchiveHandle *AH);
435 extern char *ReadStr(ArchiveHandle *AH);
436 extern size_t WriteStr(ArchiveHandle *AH, const char *s);
437 
439 size_t WriteOffset(ArchiveHandle *, pgoff_t, int);
440 
441 extern void StartRestoreBlobs(ArchiveHandle *AH);
442 extern void StartRestoreBlob(ArchiveHandle *AH, Oid oid, bool drop);
443 extern void EndRestoreBlob(ArchiveHandle *AH, Oid oid);
444 extern void EndRestoreBlobs(ArchiveHandle *AH);
445 
446 extern void InitArchiveFmt_Custom(ArchiveHandle *AH);
447 extern void InitArchiveFmt_Null(ArchiveHandle *AH);
448 extern void InitArchiveFmt_Directory(ArchiveHandle *AH);
449 extern void InitArchiveFmt_Tar(ArchiveHandle *AH);
450 
451 extern bool isValidTarHeader(char *header);
452 
453 extern void ReconnectToServer(ArchiveHandle *AH, const char *dbname, const char *newUser);
454 extern void DropBlobIfExists(ArchiveHandle *AH, Oid oid);
455 
456 void ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH);
457 int ahprintf(ArchiveHandle *AH, const char *fmt,...) pg_attribute_printf(2, 3);
458 
459 void ahlog(ArchiveHandle *AH, int level, const char *fmt,...) pg_attribute_printf(3, 4);
460 
461 #endif
struct _tocEntry * next
ReopenPtrType ReopenPtr
void ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
ReadBufPtrType ReadBufPtr
PQExpBuffer curCmd
int DumpId
Definition: pg_backup.h:235
sqlparseState state
DeClonePtrType DeClonePtr
struct _tocEntry * currentTE
static const char * modulename
Definition: compress_io.c:78
int(* ReadBytePtrType)(ArchiveHandle *AH)
void DropBlobIfExists(ArchiveHandle *AH, Oid oid)
Definition: pg_backup_db.c:661
void(* ClosePtrType)(ArchiveHandle *AH)
int void ahlog(ArchiveHandle *AH, int level, const char *fmt,...) pg_attribute_printf(3
int ReadInt(ArchiveHandle *AH)
WriteBufPtrType WriteBufPtr
CatalogId catalogId
int(* WorkerJobDumpPtrType)(ArchiveHandle *AH, TocEntry *te)
void * dataDumperArg
size_t WriteInt(ArchiveHandle *AH, int i)
void(* DeClonePtrType)(ArchiveHandle *AH)
void on_exit_close_archive(Archive *AHX)
Definition: parallel.c:347
int parallel_restore(ArchiveHandle *AH, TocEntry *te)
StartBlobPtrType StartBlobPtr
int(* WriteBytePtrType)(ArchiveHandle *AH, const int i)
EndDataPtrType EndDataPtr
void InitArchiveFmt_Tar(ArchiveHandle *AH)
DataDumperPtr dataDumper
StartBlobsPtrType StartBlobsPtr
PGcancel *volatile connCancel
unsigned int Oid
Definition: postgres_ext.h:31
void ReadHead(ArchiveHandle *AH)
bool isValidTarHeader(char *header)
void(* PrintTocDataPtrType)(ArchiveHandle *AH, TocEntry *te)
DumpId * lockDeps
bool checkSeek(FILE *fp)
void DeCloneArchive(ArchiveHandle *AH)
SetupWorkerPtrType SetupWorkerPtr
void ReconnectToServer(ArchiveHandle *AH, const char *dbname, const char *newUser)
Definition: pg_backup_db.c:83
struct _tocEntry * currToc
ReadBytePtrType ReadBytePtr
RestorePass restorePass
sqlparseState
#define pg_attribute_printf(f, a)
Definition: c.h:132
teSection section
#define pgoff_t
Definition: win32_port.h:206
EndBlobPtrType EndBlobPtr
void EndRestoreBlobs(ArchiveHandle *AH)
void WriteDataChunksForTocEntry(ArchiveHandle *AH, TocEntry *te)
void(* EndBlobPtrType)(ArchiveHandle *AH, TocEntry *te, Oid oid)
void EndRestoreBlob(ArchiveHandle *AH, Oid oid)
int ahprintf(ArchiveHandle *AH, const char *fmt,...) pg_attribute_printf(2
char * c
struct _tocEntry * toc
static char * buf
Definition: pg_test_fsync.c:67
DumpId * dependencies
StartDataPtrType StartDataPtr
struct _tocEntry * par_prev
z_stream * z_streamp
sqlparseInfo sqlparse
WriteBytePtrType WriteBytePtr
void WriteDataChunks(ArchiveHandle *AH, struct ParallelState *pstate)
void(* ReadExtraTocPtrType)(ArchiveHandle *AH, TocEntry *te)
void(* ArchiveEntryPtrType)(ArchiveHandle *AH, TocEntry *te)
struct _tocEntry * par_next
trivalue
Definition: vacuumlo.c:32
void ReadTOC(ArchiveHandle *AH)
struct _tocEntry * prev
TocEntry * getTocEntryByDumpId(ArchiveHandle *AH, DumpId id)
void(* StartDataPtrType)(ArchiveHandle *AH, TocEntry *te)
ArchiveFormat format
size_t WriteOffset(ArchiveHandle *, pgoff_t, int)
ArchiverStage stage
void(* StartBlobPtrType)(ArchiveHandle *AH, TocEntry *te, Oid oid)
PrintTocDataPtrType PrintTocDataPtr
size_t WriteStr(ArchiveHandle *AH, const char *s)
ArchiverStage
void StartRestoreBlob(ArchiveHandle *AH, Oid oid, bool drop)
WriteDataPtrType WriteDataPtr
void(* EndBlobsPtrType)(ArchiveHandle *AH, TocEntry *te)
void InitArchiveFmt_Directory(ArchiveHandle *AH)
enum _archiveFormat ArchiveFormat
int ReadOffset(ArchiveHandle *, pgoff_t *)
void(* WriteDataPtrType)(ArchiveHandle *AH, const void *data, size_t dLen)
void InitArchiveFmt_Null(ArchiveHandle *AH)
void(* SaveArchivePtrType)(ArchiveHandle *AH)
void(* StartBlobsPtrType)(ArchiveHandle *AH, TocEntry *te)
void warn_or_exit_horribly(ArchiveHandle *AH, const char *modulename, const char *fmt,...) pg_attribute_printf(3
enum _teSection teSection
void InitArchiveFmt_Custom(ArchiveHandle *AH)
void(* WriteBufPtrType)(ArchiveHandle *AH, const void *c, size_t len)
void StartRestoreBlobs(ArchiveHandle *AH)
void void WriteTOC(ArchiveHandle *AH)
ArchiveHandle * CloneArchive(ArchiveHandle *AH)
CustomOutPtrType CustomOutPtr
void(* ReopenPtrType)(ArchiveHandle *AH)
TocEntry ** te
Definition: parallel.h:44
void(* EndDataPtrType)(ArchiveHandle *AH, TocEntry *te)
void(* WriteExtraTocPtrType)(ArchiveHandle *AH, TocEntry *te)
EndBlobsPtrType EndBlobsPtr
ArchiveMode
Definition: xlog.h:116
char * dbname
Definition: streamutil.c:51
ArchiveEntryPtrType ArchiveEntryPtr
DumpId * revDeps
ArchiverOutput outputKind
static void header(const char *fmt,...) pg_attribute_printf(1
Definition: pg_regress.c:208
void(* PrintExtraTocPtrType)(ArchiveHandle *AH, TocEntry *te)
int(* DataDumperPtr)(Archive *AH, void *userArg)
Definition: pg_backup.h:237
void(* ClonePtrType)(ArchiveHandle *AH)
struct _tocEntry ** tocsByDumpId
ClonePtrType ClonePtr
void WriteToc(ArchiveHandle *AH)
ArchiverOutput
int(* WorkerJobRestorePtrType)(ArchiveHandle *AH, TocEntry *te)
char * ReadStr(ArchiveHandle *AH)
int i
WorkerJobRestorePtrType WorkerJobRestorePtr
teReqs TocIDRequired(ArchiveHandle *AH, DumpId id)
ArchiverStage lastErrorStage
struct _z_stream z_stream
ClosePtrType ClosePtr
PrintExtraTocPtrType PrintExtraTocPtr
struct _tocEntry * lastErrorTE
size_t(* CustomOutPtrType)(ArchiveHandle *AH, const void *buf, size_t len)
void(* SetupWorkerPtrType)(Archive *AH)
Definition: pg_backup.h:239
WriteExtraTocPtrType WriteExtraTocPtr
void WriteHead(ArchiveHandle *AH)
ReadExtraTocPtrType ReadExtraTocPtr
void ReadToc(ArchiveHandle *AH)
WorkerJobDumpPtrType WorkerJobDumpPtr
void(* ReadBufPtrType)(ArchiveHandle *AH, void *buf, size_t len)