Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 167EA4762EE for ; Fri, 22 Nov 2002 14:40:38 -0500 (EST) Received: from THOR.goeci.com (thor.goeci.com [66.28.220.99]) by postgresql.org (Postfix) with ESMTP id 4D5954767FC for ; Fri, 22 Nov 2002 14:40:26 -0500 (EST) Received: by THOR.goeci.com with Internet Mail Service (5.5.2653.19) id ; Fri, 22 Nov 2002 14:40:26 -0500 Message-ID: <2D92FEBFD3BE1346A6C397223A8DD3FC0920A8@THOR.goeci.com> From: Murthy Kambhampaty To: 'dima' <_pppp@mail.ru>, Colin Stearman Cc: pgsql-admin@postgresql.org Subject: Re: Database backup and restore Date: Fri, 22 Nov 2002 14:40:26 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/205 X-Sequence-Number: 6393 In bash, I use: ========== script fragment ========== ~!/bin/bash $BackupDir= $LogFile= for db_name in $(/usr/local/pgsql/bin/psql -U postgres -d template1 -n -t -c "select datname from pg_database where datistemplate='f';"); do /usr/local/pgsql/bin/pg_dump -U postgres -Fc -Z1 -b "$db_name" -f "$BackupDir/$db_name.pgdump" 2>> $LogFile.err && \ echo "$(date +%c): Successfully dumped database $db_name" >> $LogFile done ========== script fragment ========== Cheers, Murthy -----Original Message----- From: dima [mailto:_pppp@mail.ru] Sent: Friday, November 22, 2002 11:07 To: Colin Stearman Cc: pgsql-admin@postgresql.org Subject: Re: [ADMIN] Database backup and restore > Am I missing something? There seems to be no way to dump all databases > and then restore them (as you'd have to do on a version change) if the > databases contain blobs. > > pg_dump supports dumping of blobs with the -b -Ft switch, but using > pg_dumpall with those switches doesn't seem to work. And in any case, > pg_restore seems to be missing its equivalent pg_restoreall. Other than > (painfully) manually pg_dumping and pg_restoring each database, how else > could it be done? > > I would search the mailing lists but the site's search engine is down. i wrote a script in perl which dumps all the DBs but template* i can mail it to you if you wish ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org