Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 0138664FCCB for ; Mon, 15 Sep 2008 19:02:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 45428-09 for ; Mon, 15 Sep 2008 19:02:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 83C3264FCC6 for ; Mon, 15 Sep 2008 19:02:06 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m8FM24bN020310; Mon, 15 Sep 2008 18:02:04 -0400 (EDT) To: Trent Pingenot cc: pgsql-admin@postgresql.org Subject: Re: Permissions Scenerio In-reply-to: References: Comments: In-reply-to Trent Pingenot message dated "Mon, 15 Sep 2008 15:07:22 -0600" Date: Mon, 15 Sep 2008 18:02:04 -0400 Message-ID: <20309.1221516124@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/150 X-Sequence-Number: 30243 Trent Pingenot writes: > I've been a PostGres user for a while, but am just now having to implement some security for a project. The hope is that we can create an environment through Roles that would allow users the ability to create a database(s) and have access to their database(s) but not have access to others' databases. I've been able to get part of the way there to create a user with createDB privileges and recording them in the pg_hba.conf file. However, when my test user creates a new database, they are the owner of that database but can't use it. Is there a way to avoid having to add user /database entry in > the pg_hba.conf file every time a user creates a new database? Don't try to enforce per-database connect permissions in pg_hba.conf; at least, not any such permissions you don't want to have to edit that file to change. Instead use GRANT/REVOKE CONNECT ON DATABASE. regards, tom lane