summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_archiver.h
diff options
context:
space:
mode:
authorPhilip Warner <pjw@rhyme.com.au>2000-08-01 15:51:45 +0000
committerPhilip Warner <pjw@rhyme.com.au>2000-08-01 15:51:45 +0000
commit92bd532c1e8b65f4f4d09ffb453782b29d6d1e42 (patch)
tree5127f1e929bf397d1c26729b75e8c0d358634dc1 /src/bin/pg_dump/pg_backup_archiver.h
parent7d0c4188f1b2c5e6b158dac3acab6def10959cae (diff)
downloadpostgresql-92bd532c1e8b65f4f4d09ffb453782b29d6d1e42.tar.gz
- Added --create, --no-owner, --superuser, --no-reconnect (pg_dump & pg_restore)
- Added code to dump 'Create Schema' statement (pg_dump) - Don't bother to disable/enable triggers if we don't have a superuser (pg_restore) - Cleaned up code for reconnecting to database. - Force a reconnect as superuser before enabling/disabling triggers. - Added & Removed --throttle (pg_dump) - Fixed minor bug in language dumping code: expbuffres were not being reset. - Fixed version number initialization in _allocAH (pg_backup_archiver.c) - Added second connection when restoring BLOBs to allow temp. table to survive (db reconnection causes temp tables to be lost).
Diffstat (limited to 'src/bin/pg_dump/pg_backup_archiver.h')
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 326cb4df7f..f200526879 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -59,7 +59,7 @@ typedef z_stream *z_streamp;
#define K_VERS_MAJOR 1
#define K_VERS_MINOR 4
-#define K_VERS_REV 3
+#define K_VERS_REV 8
/* Data block types */
#define BLK_DATA 1
@@ -97,8 +97,7 @@ typedef void (*SaveArchivePtr) (struct _archiveHandle* AH);
typedef void (*WriteExtraTocPtr) (struct _archiveHandle* AH, struct _tocEntry* te);
typedef void (*ReadExtraTocPtr) (struct _archiveHandle* AH, struct _tocEntry* te);
typedef void (*PrintExtraTocPtr) (struct _archiveHandle* AH, struct _tocEntry* te);
-typedef void (*PrintTocDataPtr) (struct _archiveHandle* AH, struct _tocEntry* te,
- RestoreOptions *ropt);
+typedef void (*PrintTocDataPtr) (struct _archiveHandle* AH, struct _tocEntry* te, RestoreOptions *ropt);
typedef int (*CustomOutPtr) (struct _archiveHandle* AH, const void* buf, int len);
@@ -134,7 +133,7 @@ typedef struct _archiveHandle {
char vrev;
int version; /* Conveniently formatted version */
- int debugLevel; /* Not used. Intended for logging */
+ int debugLevel; /* Used for logging (currently only by --verbose) */
int intSize; /* Size of an integer in the archive */
ArchiveFormat format; /* Archive format */
@@ -158,15 +157,15 @@ typedef struct _archiveHandle {
WriteDataPtr WriteDataPtr; /* Called to send some table data to the archive */
EndDataPtr EndDataPtr; /* Called when table data dump is finished */
WriteBytePtr WriteBytePtr; /* Write a byte to output */
- ReadBytePtr ReadBytePtr; /* */
- WriteBufPtr WriteBufPtr;
- ReadBufPtr ReadBufPtr;
+ ReadBytePtr ReadBytePtr; /* Read a byte from an archive */
+ 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 */
WriteExtraTocPtr WriteExtraTocPtr; /* Write extra TOC entry data associated with */
/* the current archive format */
ReadExtraTocPtr ReadExtraTocPtr; /* Read extr info associated with archie format */
PrintExtraTocPtr PrintExtraTocPtr; /* Extra TOC info for format */
- PrintTocDataPtr PrintTocDataPtr;
+ PrintTocDataPtr PrintTocDataPtr;
StartBlobsPtr StartBlobsPtr;
EndBlobsPtr EndBlobsPtr;
@@ -182,6 +181,7 @@ typedef struct _archiveHandle {
char *pghost;
char *pgport;
PGconn *connection;
+ PGconn *blobConnection; /* Connection for BLOB xref */
int connectToDB; /* Flag to indicate if direct DB connection is required */
int pgCopyIn; /* Currently in libpq 'COPY IN' mode. */
PQExpBuffer pgCopyBuf; /* Left-over data from incomplete lines in COPY IN */
@@ -265,7 +265,10 @@ extern int isValidTarHeader(char *header);
extern OutputContext SetOutput(ArchiveHandle* AH, char *filename, int compression);
extern void ResetOutput(ArchiveHandle* AH, OutputContext savedContext);
extern int RestoringToDB(ArchiveHandle* AH);
-extern int ReconnectDatabase(ArchiveHandle *AH, char *newUser);
+extern int ReconnectDatabase(ArchiveHandle *AH, const char* dbname, char *newUser);
+extern int UserIsSuperuser(ArchiveHandle *AH, char* user);
+extern char* ConnectedUser(ArchiveHandle *AH);
+extern int ConnectedUserIsSuperuser(ArchiveHandle *AH);
int ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle* AH);
int ahprintf(ArchiveHandle* AH, const char *fmt, ...);