pg_dump with BLOBS & V7.0.2 UPDATED
Another update of the dump code; this fixes a few bugs that people without
zlib under 7.02 would have experienced. Also, if you wish to use zlib, you
need to modify the Makefile to add -DHAVE_LIBZ to the CFLAGS....
--- Original announcement ----
There is a new version of pg_dump (with blob support) at:
ftp://ftp.rhyme.com.au/pub/postgresql/pg_dump/blobs/
This version supports TAR output and has a few bug fixes. There are two
versions to download:
pg_dump_...CVS.tar.gz
and
pg_dump_...702.tar.gz
which can be used to build against CVS and version 7.0.2 respectively.
A TAR format dump is produced by using the -Ft option, and can be used as
input into pg_restore. As with the previous release, BLOBs can only be
reloaded by pg_restore if a db connection is used (via --db=<dbname>).
Any comments & suggestions would be appreciated...
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/
From: Philip Warner <pjw@rhyme.com.au>
Date: Sun, 16 Jul 2000 20:49:35 +1000
Hi Philip,
Another update of the dump code; this fixes a few bugs that people without
zlib under 7.02 would have experienced. Also, if you wish to use zlib, you
need to modify the Makefile to add -DHAVE_LIBZ to the CFLAGS....
please apply attached patch for 7.0.2 version. It is long, but it only
removes Makefile and creates Makefile.in which can be used for 7.0.2. With
this patch applied, just untar the newest snapshot to src/bin/pg_dump and
you can continue with normal installation: configure && make && make install.
Thank you for good work.
--
Pavel Jan�k ml.
Pavel.Janik@linux.cz
Attachments:
pg_dump_141_702-Makefile.difftext/x-patchDownload
diff -uN pg_dump_141.orig/Makefile pg_dump_141/Makefile
--- pg_dump_141.orig/Makefile Wed Jul 19 10:53:31 2000
+++ pg_dump_141/Makefile Thu Jan 1 01:00:00 1970
@@ -1,64 +0,0 @@
-#-------------------------------------------------------------------------
-#
-# Makefile for src/bin/pg_dump
-#
-# Copyright (c) 1994, Regents of the University of California
-#
-# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.19 2000/07/04 19:52:00 petere Exp $
-#
-#-------------------------------------------------------------------------
-
-subdir = src/bin/pg_dump
-top_builddir = ../../..
-
-SRCDIR= ../..
-include ../../Makefile.global
-
-OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o pg_backup_files.o \
- pg_backup_null.o pg_backup_tar.o $(STRDUP)
-
-CFLAGS+= -I$(LIBPQDIR)
-LIBS+= -lz
-
-all: submake pg_dump pg_restore pg_dumpall
-
-pg_dump: pg_dump.o common.o $(OBJS) $(LIBPQDIR)/libpq.a
- $(CC) $(CFLAGS) -o $@ pg_dump.o common.o $(OBJS) $(LIBPQ) $(LDFLAGS)
-
-pg_restore: pg_restore.o $(OBJS) $(LIBPQDIR)/libpq.a
- $(CC) $(CFLAGS) -o $@ pg_restore.o $(OBJS) $(LIBPQ) $(LDFLAGS)
-
-../../utils/strdup.o:
- $(MAKE) -C ../../utils strdup.o
-
-pg_dumpall: pg_dumpall.sh
- sed -e 's:__VERSION__:$(VERSION):g' \
- -e 's:__MULTIBYTE__:$(MULTIBYTE):g' \
- -e 's:__bindir__:$(bindir):g' \
- < $< > $@
-
-.PHONY: submake
-submake:
- $(MAKE) -C $(LIBPQDIR) all
-
-install: all installdirs
- $(INSTALL_PROGRAM) pg_dump$(X) $(bindir)/pg_dump$(X)
- $(INSTALL_PROGRAM) pg_restore$(X) $(bindir)/pg_restore$(X)
- $(INSTALL_SCRIPT) pg_dumpall $(bindir)/pg_dumpall
- $(INSTALL_SCRIPT) pg_upgrade $(bindir)/pg_upgrade
-
-installdirs:
- $(mkinstalldirs) $(bindir)
-
-uninstall:
- rm -f $(addprefix $(bindir)/, pg_dump$(X) pg_restore$(X) pg_dumpall pg_upgrade)
-
-depend dep:
- $(CC) -MM $(CFLAGS) *.c >depend
-
-clean distclean maintainer-clean:
- rm -f pg_dump$(X) pg_restore$(X) $(OBJS) pg_dump.o common.o pg_restore.o pg_dumpall
-
-ifeq (depend,$(wildcard depend))
-include depend
-endif
diff -uN pg_dump_141.orig/Makefile.in pg_dump_141/Makefile.in
--- pg_dump_141.orig/Makefile.in Thu Jan 1 01:00:00 1970
+++ pg_dump_141/Makefile.in Wed Jul 19 10:45:08 2000
@@ -0,0 +1,55 @@
+#-------------------------------------------------------------------------
+#
+# Makefile for src/bin/pg_dump
+#
+# Copyright (c) 1994, Regents of the University of California
+#
+# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.19 2000/07/04 19:52:00 petere Exp $
+#
+#-------------------------------------------------------------------------
+
+SRCDIR= ../..
+include ../../Makefile.global
+
+OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o pg_backup_files.o \
+ pg_backup_null.o pg_backup_tar.o @STRDUP@
+
+CFLAGS+= -I$(LIBPQDIR)
+LIBS+= -lz
+
+all: submake pg_dump pg_restore pg_dumpall
+
+pg_dump: pg_dump.o common.o $(OBJS) $(LIBPQDIR)/libpq.a
+ $(CC) $(CFLAGS) -o $@ pg_dump.o common.o $(OBJS) $(LIBPQ) $(LDFLAGS)
+
+pg_restore: pg_restore.o $(OBJS) $(LIBPQDIR)/libpq.a
+ $(CC) $(CFLAGS) -o $@ pg_restore.o $(OBJS) $(LIBPQ) $(LDFLAGS)
+
+../../utils/strdup.o:
+ $(MAKE) -C ../../utils strdup.o
+
+pg_dumpall: pg_dumpall.sh
+ sed -e 's:__VERSION__:$(VERSION):g' \
+ -e 's:__MULTIBYTE__:$(MULTIBYTE):g' \
+ -e 's:__bindir__:$(bindir):g' \
+ < $< > $@
+
+.PHONY: submake
+submake:
+ $(MAKE) -C $(LIBPQDIR) all
+
+install: all
+ $(INSTALL) $(INSTL_EXE_OPTS) pg_dump$(X) $(BINDIR)/pg_dump$(X)
+ $(INSTALL) $(INSTL_EXE_OPTS) pg_restore$(X) $(BINDIR)/pg_restore$(X)
+ $(INSTALL) $(INSTL_EXE_OPTS) pg_dumpall $(BINDIR)/pg_dumpall
+ $(INSTALL) $(INSTL_EXE_OPTS) pg_upgrade $(BINDIR)/pg_upgrade
+
+depend dep:
+ $(CC) -MM $(CFLAGS) *.c >depend
+
+clean:
+ rm -f pg_dump$(X) pg_restore$(X) $(OBJS) pg_dump.o common.o pg_restore.o pg_dumpall
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif
Import Notes
Reply to msg id not found: PhilipWarnersmessageofSun16Jul2000204935+1000
From: Pavel.Janik@linux.cz (Pavel Jan�k ml.)
Date: Wed, 19 Jul 2000 11:11:05 +0200
Hi,
this patch applied, just untar the newest snapshot to src/bin/pg_dump
and you can continue with normal installation: configure && make &&
make install.
hmm. PG_VERSION is defined as 0 in version.h:
#define PG_VERSION "0"
but in CVS version the variable is defined in config.h:
#define PG_VERSION "7.1devel"
So if you compile the new pg_dump as I wrote above, you must use
--ignore-version:
SnowWhite:/home/pavel$ pg_dump db
Database version: Archiver(db)
PostgreSQL 7.0.2 on i486-pc-linux-gnu, compiled by gcc 2.7.2.3 version: 0
Aborting because of version mismatch.
Use --ignore-version if you think it's safe to proceed anyway.
SnowWhite:/home/pavel$
I think this is the correct (and smallest :-) patch:
Attachments:
pg_dump_141_702-version.difftext/x-patchDownload
diff -u pg_dump_141.orig/pg_backup_db.c pg_dump_141/pg_backup_db.c
--- pg_dump_141.orig/pg_backup_db.c Sun Jul 16 12:30:08 2000
+++ pg_dump_141/pg_backup_db.c Wed Jul 19 12:43:09 2000
@@ -101,7 +101,7 @@
double remoteversion;
PGconn *conn = AH->connection;
- myversion = strtod(PG_VERSION, NULL);
+ myversion = strtod(PG_VERSION_STR + 11, NULL);
res = PQexec(conn, "SELECT version()");
if (!res ||
PQresultStatus(res) != PGRES_TUPLES_OK ||
Import Notes
Reply to msg id not found: Pavel.Janik@linux.czsmessageofWed19Jul2000111105+0200