Re: How does connect privilege works?

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Shridhar Daithankar <ghodechhap(at)ghodechhap(dot)net>
Cc: pg-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How does connect privilege works?
Date: 2012-08-07 08:07:01
Message-ID: 5020CCA5.4040005@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/07/2012 11:51 AM, Shridhar Daithankar wrote:

> testdb2=# revoke connect ON database testdb2 FROM testuser1;
>
> REVOKE

You can't revoke a permission that isn't set. PostgreSQL doesn't have
explicit deny rules, so you can only remove a grant.

The documentation on databases doesn't seem to cover that very well,
with no listing of the default permissions.

You probably want to:

REVOKE CONNECT ON DATABASE testdb2 FROM public;

which will leave only superusers and the database owner able to connect
to the DB. You can then:

GRANT CONNECT ON DATABASE testdb2 TO whoever;

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2012-08-07 08:20:13 JSON in 9.2: limitations
Previous Message Tom Lane 2012-08-07 04:21:04 Re: timestamp with timezone and time zone name