Skip site navigation (1) Skip section navigation (2)

Revoke Public Database Connect

From: Alan Gutierrez <alan(at)prettyrobots(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Revoke Public Database Connect
Date: 2011-05-27 17:55:18
Message-ID: 4DDFE586.1050104@prettyrobots.com (view raw or flat)
Thread:
Lists: pgsql-novice
I'm configuring a multi-tenant PostgreSQL server. When I create a new 
database, anyone can connect to it. For me, that is bad.

I run:

REVOKE CONNECT ON DATABASE d FROM public;

Now I'm only able to connect to the database as postgres.

I tired putting the create and revoke in a transaction, but create 
database cannot be put in a transaction. How do I create a database so 
there is not that nanosecond window where someone could connect to the 
database publiclly?

--
Alan Gutierrez - http://twitter.com/bigeasy - http://github.com/bigeasy

Responses

pgsql-novice by date

Next:From: Francisco LeoveyDate: 2011-05-27 23:05:20
Subject: Re: Revoke Public Database Connect
Previous:From: Chetan SuttrawayDate: 2011-05-27 09:58:18
Subject: Re: How to recover from base

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group