In article <414F2471.9050104 (AT) insys-corp (DOT) com.mx>, Eduardo Vázquez
Rodríguez <evazquez (AT) insys-corp (DOT) com.mx> wrote:
Quote:
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