Re: backup - Mailing list pgsql-novice

From Tom Lane
Subject Re: backup
Date
Msg-id 17744.978968293@sss.pgh.pa.us
Whole thread Raw
In response to backup  ("dubois"<dubois@bol.com.br>)
Responses Re: backup
List pgsql-novice
"dubois"<dubois@bol.com.br> writes:
>   I want to make a backup copy of a
> database...
> What I have to do?

pg_dumpall is the recommended answer.

>   Do I have just to copy the directory
> at
> /var/lib/pgsql/base ?

This is NOT sufficient.

Copying the entire $PGDATA directory (not only the base/ subdirectory)
is sufficient, if and only if the database is completely idle while you
do it --- I'd recommend stopping the postmaster to be sure.  Otherwise
you will get inconsistent files.  In particular, you WILL have problems
if $PGDATA/pg_log is out of sync with any table data file.

            regards, tom lane

pgsql-novice by date:

Previous
From: "dubois"
Date:
Subject: backup
Next
From: "Robert B. Easter"
Date:
Subject: Re: Re: I think I know what I'm doing wrong, but....