aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_tar.c
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_tar.c
parent7d0c4188f1b2c5e6b158dac3acab6def10959cae (diff)
downloadpostgresql-92bd532c1e8b65f4f4d09ffb453782b29d6d1e42.tar.gz
postgresql-92bd532c1e8b65f4f4d09ffb453782b29d6d1e42.zip
- 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_tar.c')
-rw-r--r--src/bin/pg_dump/pg_backup_tar.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index ca1bdf7a61f..6a3b2122064 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -55,7 +55,7 @@ static void _EndBlobs(ArchiveHandle* AH, TocEntry* te);
#ifdef HAVE_LIBZ
- //typedef gzFile ThingFile;
+ /* typedef gzFile ThingFile; */
typedef FILE ThingFile;
#else
typedef FILE ThingFile;
@@ -159,7 +159,7 @@ void InitArchiveFmt_Tar(ArchiveHandle* AH)
ctx->tarFHpos = 0;
/* Make unbuffered since we will dup() it, and the buffers screw each other */
- //setvbuf(ctx->tarFH, NULL, _IONBF, 0);
+ /* setvbuf(ctx->tarFH, NULL, _IONBF, 0); */
ctx->hasSeek = (fseek(ctx->tarFH, 0, SEEK_CUR) == 0);
@@ -186,7 +186,7 @@ void InitArchiveFmt_Tar(ArchiveHandle* AH)
}
/* Make unbuffered since we will dup() it, and the buffers screw each other */
- //setvbuf(ctx->tarFH, NULL, _IONBF, 0);
+ /* setvbuf(ctx->tarFH, NULL, _IONBF, 0); */
ctx->tarFHpos = 0;
@@ -487,7 +487,7 @@ static int _WriteData(ArchiveHandle* AH, const void* data, int dLen)
tarWrite((void*)data, dLen, tctx->TH);
- //GZWRITE((void*)data, 1, dLen, tctx->TH->FH);
+ /* GZWRITE((void*)data, 1, dLen, tctx->TH->FH); */
return dLen;
}
@@ -764,6 +764,7 @@ static void _CloseArchive(ArchiveHandle* AH)
ropt = NewRestoreOptions();
ropt->dropSchema = 1;
ropt->compression = 0;
+ ropt->superuser = PQuser(AH->connection);
savVerbose = AH->public.verbose;
AH->public.verbose = 0;
@@ -1116,10 +1117,10 @@ static void _tarWriteHeader(TAR_MEMBER* th)
sprintf(&h[297], "%.31s", ""); /* How do I get group reliably? Do I need to? */
/* Maj Dev 8 */
- // sprintf(&h[329], "%8o", 0);
+ /* sprintf(&h[329], "%8o", 0); */
/* Min Dev */
- // sprintf(&h[337], "%8o", 0);
+ /* sprintf(&h[337], "%8o", 0); */
while ( (sum = _tarChecksum(h)) != lastSum)