Thread: Postgresql data backup

Postgresql data backup

From
Rajkumar Selvaraj
Date:
To whomsoever it may concern,

Iam involved with a team that is developing a java
based application on RedHat Linux 6.2 version.We are
using PostgreSQL
version 7.0.2 as the database.At present Iam
developing a backup & restore module with a GUI  for
the user to interact.
       I have a problem.I need to take a backup only
after ensuring that all clients connected to my
database are disconnected.
Modifying the access control privileges using the file
pg_hba.conf only restricts new connections or sessions
to my database.
Please mail me ur replies on the following :
1).I would like to know how to stop users who have
already opened up sessions with my database without
stopping the postmaster
service.
2).I would also like to know whether the command
pg_dump prevents any user from writing or modifying my
database until
th process is completed. If not,will it ensure
transactional integrity until the backup process is
completed ?

      I request a solution at the earliest.
     Thanks.




____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

Re: Postgresql data backup

From
Stephan Szabo
Date:
On Thu, 13 Sep 2001, [iso-8859-1] Rajkumar Selvaraj wrote:

> Please mail me ur replies on the following :
> 1).I would like to know how to stop users who have
> already opened up sessions with my database without
> stopping the postmaster
> service.
Well, the problem is that if you stop them, any modifications
done by those users in a transaction will be lost, but you
could probably kill the postgres processes opened for each
user.

> 2).I would also like to know whether the command
> pg_dump prevents any user from writing or modifying my
> database until
> th process is completed. If not,will it ensure
> transactional integrity until the backup process is
> completed ?
No it doesn't, but IIRC, pg_dump is going to run as one
transaction meaning that it should see a consistant state
of the database which wouldn't include any non-committed
transactions at the start of the dump.