1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-09 22:41:56 +03:00

- 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).
This commit is contained in:
Philip Warner
2000-08-01 15:51:45 +00:00
parent 7d0c4188f1
commit 92bd532c1e
8 changed files with 567 additions and 99 deletions

View File

@ -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)