Skip to content

Commit 48f0490

Browse files
committed
Final (?) fix for tar (null block at end)
Dump template db in dumpall
1 parent 03f9e5a commit 48f0490

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

src/bin/pg_dump/pg_backup_archiver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ typedef z_stream *z_streamp;
6262

6363
#define K_VERS_MAJOR 1
6464
#define K_VERS_MINOR 4
65-
#define K_VERS_REV 20
65+
#define K_VERS_REV 21
6666

6767
/* Data block types */
6868
#define BLK_DATA 1

src/bin/pg_dump/pg_backup_tar.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ static void _CloseArchive(ArchiveHandle* AH)
721721
lclContext* ctx = (lclContext*)AH->formatData;
722722
TAR_MEMBER *th;
723723
RestoreOptions *ropt;
724-
int savVerbose;
724+
int savVerbose, i;
725725

726726
if (AH->mode == archModeWrite) {
727727

@@ -774,6 +774,13 @@ static void _CloseArchive(ArchiveHandle* AH)
774774
AH->public.verbose = savVerbose;
775775

776776
tarClose(AH, th);
777+
778+
/* Add a block of NULLs since it's de-rigeur. */
779+
for(i=0; i<512; i++)
780+
{
781+
fputc(0, ctx->tarFH);
782+
}
783+
777784
}
778785

779786
AH->FH = NULL;

src/bin/pg_dump/pg_dumpall.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# and "pg_group" tables, which belong to the whole installation rather
77
# than any one individual database.
88
#
9-
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.4 2000/09/08 18:29:27 petere Exp $
9+
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.5 2000/10/25 10:21:38 pjw Exp $
1010

1111
CMDNAME=`basename $0`
1212

@@ -179,6 +179,20 @@ while read GRONAME GROSYSID GROLIST ; do
179179
done
180180

181181

182+
# First we dump the template in case there are local extensions.
183+
184+
echo
185+
echo "--"
186+
echo "-- Database template1"
187+
echo "--"
188+
echo "${BS}connect template1"
189+
$PGDUMP "template1"
190+
if [ "$?" -ne 0 ] ; then
191+
echo "pg_dump failed on template1, exiting" 1>&2
192+
exit 1
193+
fi
194+
195+
182196
# For each database, run pg_dump to dump the contents of that database.
183197

184198
$PSQL -d template1 -At -F ' ' \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy