Re: Killing active users - Mailing list pgsql-general

From Glyn Astill
Subject Re: Killing active users
Date
Msg-id 704365.39853.qm@web25806.mail.ukl.yahoo.com
Whole thread Raw
In response to Killing active users  ("Gauthier, Dave" <dave.gauthier@intel.com>)
List pgsql-general
> The problem is that sometimes the rename fails because
> there are active
> users on the available DB... DBD::Pg::db do failed: ERROR:
> database
> "maindb" is being accessed by other users .
> Because the reload takes
> place in the wee hours, I feel it's OK to kill any
> existing user
> connections in order to prevent this if I have to.
>

You could change ph_hba whilst you rename the databases.

I have a similar case here, where I restore a backup of our main servers onto a "restore" machine that can be used by
thedevelopers as a staging environment, but those developers can still be connected.  

What I do is have a pg_hba.deny.conf and before I reload the database I rename pg_hba.conf to bg_hba.normal.conf, and
pg_hba.deny.confto pg_hba.conf and restart the server, do my work then put them back and restart the server again.  Not
surebut you could perhaps even do this with a reload rather than a restart. 

Glyn

Send instant messages to your online friends http://uk.messenger.yahoo.com

pgsql-general by date:

Previous
From: William Garrison
Date:
Subject: Changing between ORDER BY DESC and ORDER BY ASC
Next
From: "c k"
Date:
Subject: plpgsql functions