Re: Backup & Restore

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Gavin M(dot) Roy" <gmr(at)justsportsusa(dot)com>
Cc: "'Marcelo Pereira'" <gandalf(at)sum(dot)desktop(dot)com(dot)br>, pgsql-general(at)postgresql(dot)org
Subject: Re: Backup & Restore
Date: 2002-02-25 20:01:44
Message-ID: 200202252001.g1PK1im06883@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


From my reading of this code, it dumps each table in a separate
transaction, meaning it does not make a consistent backup. I recommend
pg_dump in -Fc mode and the use of pg_restore.

---------------------------------------------------------------------------

Gavin M. Roy wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Attached is a small backup script that I wrote. It requires command
> line PHP w/ PostgreSQL support. What it does is rip through all the
> databases, gets the table listings, makes a directory structure and
> dumps every table to its own .sql file using pg_dump. Then it backs
> it up to tape. With some minor modifications it may work for you :D
> The reason I wrote this is with the size of my database, single table
> restorations from on pg_dumpall file were horrendous, and since the
> database changes structure on a regular basis (new tables, etc) I
> didn't want to be limited to a shell script I had to hand configure
> every time I added/removed a table.
>
> Cheers,
>
> Gavin
>
> - -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Marcelo
> Pereira
> Sent: Monday, February 25, 2002 4:17 AM
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] Backup & Restore
>
>
> Hello All,
>
> Which is the simplest way to do a backup? My db is really small
> (about
> 4Mb), so I would like to make a backup to each day, save it in
> separated
> files, and restore it if necessary.
>
> So, which is the usual way to create the backup files? And how can I
> restore these backups?
>
> Thanks in advance,
>
> Marcelo Pereira
>
> - -- Remember that only God and Esc+:w saves.
> __
> (_.\ Marcelo Pereira |
> / / ___ |
> / (_/ _ \__ Matematica/99 - IMECC |
> _______\____/_\___)___Unicamp_______________/
>
>
>
> - ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
> majordomo(at)postgresql(dot)org
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
>
> iQA/AwUBPHpvKH9xeBXAlKqsEQIH/QCgkm6mqH/LjMeaFFE6UBZtC/825JcAoI7i
> ZyYUF2Y/Sr3Ni+AoIbSG1CZi
> =SIMe
> -----END PGP SIGNATURE-----
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-02-25 20:03:42 Re: [SQL] Sort problem
Previous Message Oliver Elphick 2002-02-25 20:01:10 Re: Sort problem