Re: Role based database access - Mailing list pgsql-admin

From Scott Marlowe
Subject Re: Role based database access
Date
Msg-id 4655D9FA.8010400@g2switchworks.com
Whole thread Raw
In response to Role based database access  (Thomas Mack <mack@ifis.cs.tu-bs.de>)
Responses Re: Role based database access  (Carol Walter <walterc@indiana.edu>)
Re: Role based database access  (mack@ips.cs.tu-bs.de)
List pgsql-admin
Thomas Mack wrote:
> Hello!
>
> I face a problem here with restricting access to databases to
> the owners of the database (Postgres 8.1.4).
>
> We would like any postgres user to have database access restricted
> to their own databases only. This is so, as we use postgres for
> educational purposes.
>
> I looked into pg_hba.conf, but unfortunately, when restricting
> database access in the database field, the NAME(!) of the database
> is concerned, which we do not restrict. Any user can create as
> many databases as needed, and the name may be choosen freely.
>
> The 'user' field does not help in this either.
>
> So is there any chance to achieve what we need without revoking
> the 'create database' permission and pre-creating the databases
> for all our users?
>
> Thanks,
> Thomas Mack
>
Does not the sameuser database name work for you in pg_hba.conf?  I.e.
you can only log into the database that bears your name.


pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Abnormal storage consumption with autovacuum enabled
Next
From: Carol Walter
Date:
Subject: Re: Role based database access