Re: Backups

From: Neacal <deb(at)mac(dot)ppc>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Backups
Date: 2004-09-21 13:37:34
Message-ID: 210920042337144874%deb@mac.ppc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

In article <414F2471(dot)9050104(at)insys-corp(dot)com(dot)mx>, Eduardo Vázquez
Rodríguez <evazquez(at)insys-corp(dot)com(dot)mx> wrote:

> Hello everybody out there using Postgres!!!
>
> I have a couple of questions
>
> 1. If I am not wrong (using default values) Postgresql allocate all the
> database tables under /usr/local/data. is that correct?
>
> 2. How do I make a backup of a database in a different partition?, for
> instance /home/postgres
>
> Thanks in advanced
>

Hola Eduardo

I'm using the MacOSX package, which suggests your q1 should be revised
to /usr/local/pgsql/data.

I'm still a novice to postgresql, but as I have just researched the
backup issue in the O'Reilly book, I'll have a go at answering q2.

pg_dump will do this for you; you don't have to be in the pgsql
directory, pg_dump can even be run from another server.

My best guess is to run the command from the other partition. So it
would be something like:

# pathto/usr/local/bin/pg_dump --file=youdata.sql --format=p yourdata

you have a choice of formats: c=gzip, t=tar, p=plain text

If you wanted to backup the entire filesystem, stop the server and make
a copy, something like this (compressed):

# cd /usr/local/pgsql
# /usr/local/bin/pg_ctl stop
# tar czf pgsql.bak.tar.gz data/

then you can

# mv pgsql.bak.tar.gz /path/to/where/you/want

or cp to be safe!

Well, that's my solution. I did try out various options myself on a
testdb, with no problems. So I hope I'm not misleading you.

Buena suerte

Neacal

In response to

  • Backups at 2004-09-20 18:41:53 from Eduardo Vázquez Rodríguez

Browse pgsql-novice by date

  From Date Subject
Next Message Jonathon Batson 2004-09-22 03:17:07 Multi Database queries
Previous Message Martin Atukunda 2004-09-21 12:05:51 Re: ECPG threads