diff options
Diffstat (limited to 'src/bin/pg_dump/pg_backup_archiver.h')
-rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.h | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h index d8520ec9d6b..43756eba4d9 100644 --- a/src/bin/pg_dump/pg_backup_archiver.h +++ b/src/bin/pg_dump/pg_backup_archiver.h @@ -17,7 +17,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.76 2007/11/07 12:24:24 petere Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.77 2009/02/02 20:07:37 adunstan Exp $ * *------------------------------------------------------------------------- */ @@ -62,7 +62,7 @@ typedef z_stream *z_streamp; #endif #define K_VERS_MAJOR 1 -#define K_VERS_MINOR 10 +#define K_VERS_MINOR 11 #define K_VERS_REV 0 /* Data block types */ @@ -85,8 +85,9 @@ typedef z_stream *z_streamp; #define K_VERS_1_9 (( (1 * 256 + 9) * 256 + 0) * 256 + 0) /* add default_with_oids * tracking */ #define K_VERS_1_10 (( (1 * 256 + 10) * 256 + 0) * 256 + 0) /* add tablespace */ +#define K_VERS_1_11 (( (1 * 256 + 11) * 256 + 0) * 256 + 0) /* add toc section indicator */ -#define K_VERS_MAX (( (1 * 256 + 10) * 256 + 255) * 256 + 0) +#define K_VERS_MAX (( (1 * 256 + 11) * 256 + 255) * 256 + 0) /* Flags to indicate disposition of offsets stored in files */ @@ -99,6 +100,7 @@ struct _tocEntry; struct _restoreList; typedef void (*ClosePtr) (struct _archiveHandle * AH); +typedef void (*ReopenPtr) (struct _archiveHandle * AH); typedef void (*ArchiveEntryPtr) (struct _archiveHandle * AH, struct _tocEntry * te); typedef void (*StartDataPtr) (struct _archiveHandle * AH, struct _tocEntry * te); @@ -120,6 +122,9 @@ typedef void (*ReadExtraTocPtr) (struct _archiveHandle * AH, struct _tocEntry * typedef void (*PrintExtraTocPtr) (struct _archiveHandle * AH, struct _tocEntry * te); typedef void (*PrintTocDataPtr) (struct _archiveHandle * AH, struct _tocEntry * te, RestoreOptions *ropt); +typedef void (*ClonePtr) (struct _archiveHandle * AH); +typedef void (*DeClonePtr) (struct _archiveHandle * AH); + typedef size_t (*CustomOutPtr) (struct _archiveHandle * AH, const void *buf, size_t len); typedef struct _outputContext @@ -212,6 +217,7 @@ typedef struct _archiveHandle WriteBufPtr WriteBufPtr; /* Write a buffer of output to the archive */ ReadBufPtr ReadBufPtr; /* Read a buffer of input from the archive */ ClosePtr ClosePtr; /* Close the archive */ + ReopenPtr ReopenPtr; /* Reopen the archive */ WriteExtraTocPtr WriteExtraTocPtr; /* Write extra TOC entry data * associated with the current archive * format */ @@ -225,11 +231,15 @@ typedef struct _archiveHandle StartBlobPtr StartBlobPtr; EndBlobPtr EndBlobPtr; + ClonePtr ClonePtr; /* Clone format-specific fields */ + DeClonePtr DeClonePtr; /* Clean up cloned fields */ + CustomOutPtr CustomOutPtr; /* Alternative script output routine */ /* Stuff for direct DB connection */ char *archdbname; /* DB name *read* from archive */ bool requirePassword; + char *savedPassword; /* password for ropt->username, if known */ PGconn *connection; int connectToDB; /* Flag to indicate if direct DB connection is * required */ @@ -260,9 +270,9 @@ typedef struct _archiveHandle * etc */ /* these vars track state to avoid sending redundant SET commands */ - char *currUser; /* current username */ - char *currSchema; /* current schema */ - char *currTablespace; /* current tablespace */ + char *currUser; /* current username, or NULL if unknown */ + char *currSchema; /* current schema, or NULL */ + char *currTablespace; /* current tablespace, or NULL */ bool currWithOids; /* current default_with_oids setting */ void *lo_buf; @@ -282,6 +292,7 @@ typedef struct _tocEntry struct _tocEntry *next; CatalogId catalogId; DumpId dumpId; + teSection section; bool hadDumper; /* Archiver was passed a dumper routine (used * in restore) */ char *tag; /* index tag */ @@ -300,6 +311,13 @@ typedef struct _tocEntry DataDumperPtr dataDumper; /* Routine to dump data for object */ void *dataDumperArg; /* Arg for above routine */ void *formatData; /* TOC Entry data specific to file format */ + + /* working state (needed only for parallel restore) */ + bool restored; /* item is in progress or done */ + bool created; /* set for DATA member if TABLE was created */ + int depCount; /* number of dependencies not yet restored */ + DumpId *lockDeps; /* dumpIds of objects this one needs lock on */ + int nLockDeps; /* number of such dependencies */ } TocEntry; /* Used everywhere */ |