Re: 9.1.2: Preventing connections / syncing a database

From: Rob Sargentg <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: 9.1.2: Preventing connections / syncing a database
Date: 2012-01-01 22:59:56
Message-ID: 4F00E56C.3060007@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/01/2012 11:51 AM, Jay Levitt wrote:
>
> revoke connect on database rails_dev from public;
> select pg_terminate_backend(procpid) from pg_stat_activity where
> datname='rails_dev';
>
> Still, the app can reconnect. (So can psql.)
>
> So...
>
> 1. How can I prevent (or redirect, or timeout, or anything) new
> connections? I think superuser roles might be exempt from connection
> limits and privileges. I could repeatedly terminate backends until
> I'm able to rename the database, but... ick.
>
> 2. What's a better way to slave to a master database without being a
> read-only slave? In other words, we want to use the production
> database as a starting point each morning, but we'll be creating test
> rows and tables that we wouldn't want to propagate to production. Can
> I do this while the database is live through some existing replication
> tool? The production database is on Ubuntu but the workstations are
> Macs, FWIW.
>
> Jay
More along the lines of what Greg has said. Not clear to me why an
individual dev box needs to be that current data-wise. Of course
stopping and starting your app should be easy, especially for the
developers so maybe that's a better place to start. Then dev can do it
when and how often suits dev best (even cronning shutdown app; reload
db; to happen 3am Sundays)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2012-01-02 08:51:38 Re: Large Objects and and Vacuum
Previous Message Greg Sabino Mullane 2012-01-01 19:51:15 Re: 9.1.2: Preventing connections / syncing a database