aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Warner <pjw@rhyme.com.au>2000-10-25 10:21:38 +0000
committerPhilip Warner <pjw@rhyme.com.au>2000-10-25 10:21:38 +0000
commit48f0490809794011b449339d3844459177bb353f (patch)
treeb5e02cc1dcb1fd04cca83264278b7aa3ccd04357 /src
parent03f9e5a5fc43a265d49675d12393a87c8d03314f (diff)
downloadpostgresql-48f0490809794011b449339d3844459177bb353f.tar.gz
postgresql-48f0490809794011b449339d3844459177bb353f.zip
Final (?) fix for tar (null block at end)
Dump template db in dumpall
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.h2
-rw-r--r--src/bin/pg_dump/pg_backup_tar.c9
-rw-r--r--src/bin/pg_dump/pg_dumpall.sh16
3 files changed, 24 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 417c50bf68a..41fbb5c9c06 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -62,7 +62,7 @@ typedef z_stream *z_streamp;
#define K_VERS_MAJOR 1
#define K_VERS_MINOR 4
-#define K_VERS_REV 20
+#define K_VERS_REV 21
/* Data block types */
#define BLK_DATA 1
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index 674c24191dc..a137513e78c 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -721,7 +721,7 @@ static void _CloseArchive(ArchiveHandle* AH)
lclContext* ctx = (lclContext*)AH->formatData;
TAR_MEMBER *th;
RestoreOptions *ropt;
- int savVerbose;
+ int savVerbose, i;
if (AH->mode == archModeWrite) {
@@ -774,6 +774,13 @@ static void _CloseArchive(ArchiveHandle* AH)
AH->public.verbose = savVerbose;
tarClose(AH, th);
+
+ /* Add a block of NULLs since it's de-rigeur. */
+ for(i=0; i<512; i++)
+ {
+ fputc(0, ctx->tarFH);
+ }
+
}
AH->FH = NULL;
diff --git a/src/bin/pg_dump/pg_dumpall.sh b/src/bin/pg_dump/pg_dumpall.sh
index e6386815623..f24922d3f37 100644
--- a/src/bin/pg_dump/pg_dumpall.sh
+++ b/src/bin/pg_dump/pg_dumpall.sh
@@ -6,7 +6,7 @@
# and "pg_group" tables, which belong to the whole installation rather
# than any one individual database.
#
-# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.4 2000/09/08 18:29:27 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.5 2000/10/25 10:21:38 pjw Exp $
CMDNAME=`basename $0`
@@ -179,6 +179,20 @@ while read GRONAME GROSYSID GROLIST ; do
done
+# First we dump the template in case there are local extensions.
+
+echo
+echo "--"
+echo "-- Database template1"
+echo "--"
+echo "${BS}connect template1"
+$PGDUMP "template1"
+if [ "$?" -ne 0 ] ; then
+ echo "pg_dump failed on template1, exiting" 1>&2
+ exit 1
+fi
+
+
# For each database, run pg_dump to dump the contents of that database.
$PSQL -d template1 -At -F ' ' \