How does connect privilege works?

From: Shridhar Daithankar <ghodechhap(at)ghodechhap(dot)net>
To: pg-general <pgsql-general(at)postgresql(dot)org>
Subject: How does connect privilege works?
Date: 2012-08-07 03:51:05
Message-ID: 4884534.EvDx2JrGvE@bheem
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I am trying to setup a cluster for trac databases and want to isolate each db,
by assigning a specific user to a DB.

I followed the documentation but as shown in the following example, limiting
access by connect does not seem to be working.

What am I missing?

------------
shridhar(at)bheem ~$ createuser testuser1
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) y

shridhar(at)bheem ~$ createdb -O testuser1 testdb1

shridhar(at)bheem ~$ createdb testdb2

shridhar(at)bheem ~$ psql testdb2
psql (9.1.4)
Type "help" for help.

testdb2=# revoke connect ON database testdb2 FROM testuser1;
REVOKE
testdb2=# \q
shridhar(at)bheem ~$ psql -U testuser1 testdb2
psql (9.1.4)
Type "help" for help.

testdb2=> \q

shridhar(at)bheem ~$ psql test
psql (9.1.4)
Type "help" for help.

test=# select version();
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 9.1.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.7.0
20120505 (prerelease), 64-bit
(1 row)

------------
--
Regards
Shridhar

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar 2012-08-07 03:53:29 timestamp with timezone and time zone name
Previous Message Martijn van Oosterhout 2012-08-06 21:08:23 Re: How to analyze load average ?