Re: Stop connections to a specific database

From: Rex Mabry <rexmabry(at)yahoo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Stop connections to a specific database
Date: 2008-07-18 18:40:47
Message-ID: 410024.86522.qm@web35908.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

You can update your pg_hba.conf file.  Change the database column to list the one database.
 
# DATABASE can be "all", "sameuser", "samerole", a database name, or
# a comma-separated list thereof.
 
Assuming you database is called "mydb and you enter the connecting from IP, it should look like this.

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
host         mydb            all            10.0.0.0/32                  md5
 
After that, do a pg_ctl reload

--- On Fri, 7/18/08, Scott Whitney <swhitney(at)journyx(dot)com> wrote:

From: Scott Whitney <swhitney(at)journyx(dot)com>
Subject: [ADMIN] Stop connections to a specific database
To: pgsql-admin(at)postgresql(dot)org
Date: Friday, July 18, 2008, 10:07 AM

I'm migrating a pg server (v 8.1.4) this weekend, and I have 2 dbs left on
it. One cannot be shut down until tomorrow. The last remaining one, I can
migrate today.

However, the software that talks to it is somewhat "hinky" and has
several
places that connect -- there is no overall consolidated connection
information.

To ensure this is working properly, I want to disable connections to that db
on the old server while using the new one for testing, to ensure everything
is properly working. Given the fact that the other db must remain live on
this old server during that time, I just want to stop connections to this
one particular database.

Is there a simple, preferred method for doing so?

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message chris 2008-07-18 19:48:06 Re: answer my question, please!!!
Previous Message Chris Hoover 2008-07-18 17:05:03 Questions on pg_dump