470,614 Members | 1,400 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

Manage PostgreSQL Connections

Is there any way to close the connections of other users in PostgreSQL.
I wish to run an automatic pg_dump and pg_restore and I guess users must bedisconnected first.
Is that right?
________________________
Nagy Károly Gabriel
R&D Manager
Expert Software Group
410066 Oradea, Al. Gojdu 2
Tel. +4 0259 230 776
http://www.expert-software.ro
Nov 11 '05 #1
3 5526
Thank you for the information.
the easy way to do that is to create an alternate pg_hba.conf in the
$PGDATA directory that only allows the postgresql superuser to attach and
then restart postgresql with that pg_hba.conf in place. By that you mean to have a pg_hba.conf file in $PGDATA directory named for
example pg_hba.conf.dump and when
I want to perform the backup/restore to rename it to pg_hba.conf and make a
/etc/init.d/postgresql reload?
and by doing that users will not lose their data between the dump and
restore?
I think by doing /etc/init.d/postgresql reload with the new pg_hba.conf
users will be cut of brutaly, or am I wrong?

Thank you again,
On Thu, 14 Aug 2003, Nagy Karoly wrote:
Is there any way to close the connections of other users in PostgreSQL.
I wish to run an automatic pg_dump and pg_restore and I guess users must be disconnected first. Is that right?


Actually, for a pg_dump, no, you don't need to disconnect people. pg_dump
creates a single snapshot backup that is consistent across the database
you are backing up (not the whole cluster of databases, just the one
you're pointing pg_dump at at the moment.)

It really depends on what you are doing. If you're gonna pg_dump / drop
database / create database pg_restore it might be a good idea to
disconnect people so they don't lost data between the dump and restore.

the easy way to do that is to create an alternate pg_hba.conf in the
$PGDATA directory that only allows the postgresql superuser to attach and
then restart postgresql with that pg_hba.conf in place.

--
________________________
Nagy Károly Gabriel
R&D Manager
Expert Software Group
410066 Oradea, Al. Gojdu 2
Tel. +4 0259 230 776
http://www.expert-software.ro
""Nagy Karoly"" <na********@expert-software.ro> wrote in message
news:000801c3626c$cda8fd20$0301a8c0@karaszexpert.. .
Is there any way to close the connections of other users in PostgreSQL.
I wish to run an automatic pg_dump and pg_restore and I guess users must be
disconnected first.
Is that right?
________________________
Nagy Károly Gabriel
R&D Manager
Expert Software Group
410066 Oradea, Al. Gojdu 2
Tel. +4 0259 230 776
http://www.expert-software.ro
Nov 11 '05 #2
On Thu, 14 Aug 2003, Nagy Karoly wrote:
Is there any way to close the connections of other users in PostgreSQL.
I wish to run an automatic pg_dump and pg_restore and I guess users must be disconnected first.
Is that right?


Actually, for a pg_dump, no, you don't need to disconnect people. pg_dump
creates a single snapshot backup that is consistent across the database
you are backing up (not the whole cluster of databases, just the one
you're pointing pg_dump at at the moment.)

It really depends on what you are doing. If you're gonna pg_dump / drop
database / create database pg_restore it might be a good idea to
disconnect people so they don't lost data between the dump and restore.

the easy way to do that is to create an alternate pg_hba.conf in the
$PGDATA directory that only allows the postgresql superuser to attach and
then restart postgresql with that pg_hba.conf in place.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 11 '05 #3
The only thing you want to be aware of is autovacuuming or vacuuming off of a chron script in the middle of dumping.

scott.marlowe wrote:
On Thu, 14 Aug 2003, Nagy Karoly wrote:

Is there any way to close the connections of other users in PostgreSQL.
I wish to run an automatic pg_dump and pg_restore and I guess users must be disconnected first.
Is that right?

Actually, for a pg_dump, no, you don't need to disconnect people. pg_dump
creates a single snapshot backup that is consistent across the database
you are backing up (not the whole cluster of databases, just the one
you're pointing pg_dump at at the moment.)

It really depends on what you are doing. If you're gonna pg_dump / drop
database / create database pg_restore it might be a good idea to
disconnect people so they don't lost data between the dump and restore.

the easy way to do that is to create an alternate pg_hba.conf in the
$PGDATA directory that only allows the postgresql superuser to attach and
then restart postgresql with that pg_hba.conf in place.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Carlos Moreno | last post: by
19 posts views Thread by Alex Madon | last post: by
2 posts views Thread by Postgresql | last post: by
reply views Thread by Steve Wolfe | last post: by
14 posts views Thread by jptpjs via AccessMonster.com | last post: by
1 post views Thread by nampet | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.