pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Thomas Mack <mack@ifis.cs.tu-bs.de>
Cc: pgsql-admin@postgresql.org
Subject: Re: Role based database access
Date: Thu, 24 May 2007 09:57:04 -0400
Message-ID: <20070524135704.GA4320@alvh.no-ip.org> (raw)
In-Reply-To: <200705241042.40007.mack@ifis.cs.tu-bs.de>
References: <200705241042.40007.mack@ifis.cs.tu-bs.de>

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.

In the database name you can specify "@file", which points to a file
containing a list of database names that the pg_hba.conf lines applies
to.  One idea is to have the database creation routine put a line into
that file (which would be specific to each user).

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (7+ messages)  latest in thread

Message-ID: <20070524135704.GA4320@alvh.no-ip.org>
Permalink:  ../20070524135704.GA4320@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20070524135704.GA4320@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: alvherre@commandprompt.com, mack@ifis.cs.tu-bs.de
  Subject: Re: Role based database access
  In-Reply-To: <20070524135704.GA4320@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox