Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id C5690633A38 for ; Fri, 22 May 2009 10:03:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 18961-02 for ; Fri, 22 May 2009 10:03:32 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f166.google.com (mail-gx0-f166.google.com [209.85.217.166]) by mail.postgresql.org (Postfix) with ESMTP id 9AB36633837 for ; Fri, 22 May 2009 10:03:27 -0300 (ADT) Received: by gxk10 with SMTP id 10so3451740gxk.19 for ; Fri, 22 May 2009 06:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=wfLddP54GuDn8qoR0GU+bkZYCA3SSvKq8JTbL839J+Q=; b=J4G3oo/KjBuIINWm559QanR0W8IFt6KTl/HlVFziFaBRD93r7eDZcymRXx/h3Y0jBZ GUdv3ZKa4ULu6/2k37IbuIISHm29JO8qk4eVX8O9kiabSjYpUp6qfp/rhIDGJ5BlmYNY uaN/vAntTfrtSxOdI0EoNVEObpbigX/xn45p0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=NnY1s4A/0xD90seERRahl7CMlvDCPuGKXyaNNtP8wvGtNPTR5QJ8JJJFxILGYcanFH CcqBdkMzOPr00l0nFUB6xU1E9cFd5ZIg84kTRH0++VNlQsgAGViell94zUwlyoo7u2m7 F0Lnfm0/ZA6y5H3O+6fnddXQuW+KZDq34AbtI= MIME-Version: 1.0 Received: by 10.150.136.15 with SMTP id j15mr7572141ybd.257.1242997381661; Fri, 22 May 2009 06:03:01 -0700 (PDT) In-Reply-To: References: Date: Fri, 22 May 2009 09:03:01 -0400 Message-ID: Subject: Re: help with pg_hba.conf From: Isaac Dover To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=000e0cd5d054640420046a7fe110 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001 X-Spam-Level: X-Archive-Number: 200905/92 X-Sequence-Number: 32584 --000e0cd5d054640420046a7fe110 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit possibly this answers my question, and what i am doing is indeed the most appropriate? "Databases are physically separated and access control is managed at the connection level." from 8.3 docs, section 20.1 thanks, Isaac On Fri, May 22, 2009 at 2:37 AM, Isaac Dover wrote: > Hello, to this point i've been working with pg_hba.conf authentication > defaults as installed with PostgreSQL 8.3. I'm trying to better understand > "best practice" for managing connections to databases (I've grown accustomed > to the MSSQL EM method of assigning user privileges). As far as i can tell, > pg_hba.conf is the only manner in which to prevent users from connecting to > other users' databases. I've restricted roles to connecting only using > sameuser: > > host sameuser all 192.168.168.0/24 md5 > > this works fine until a user connects and creates a new database. Pg shows > that the owner of the database is the currently connected user, but the user > can't connect to it, as the hba.conf file has the sameuser restriction. I > was hoping that (somehow, magically) the owner of the database could always > connect to the databases he/she owns. > > Is hba.conf the only way to restrict users connections to specific > databases? Are there privileges I can grant without having to maintain this > file? > > I've spent quite some time researching this, even with the documentation, > but I'm wondering what I'm missing. > > Thanks, > Isaac > --000e0cd5d054640420046a7fe110 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable possibly this answers my question, and what i am doing is indeed the most a= ppropriate?

"Databases are physically separated and access c= ontrol is managed at the connection level."

from 8.3 docs, s= ection 20.1

thanks,
Isaac

On Fri, May 22, 2009= at 2:37 AM, Isaac Dover <isaacdover@gmail.com> wrote:
Hello,=A0to this point i've been working with pg_hba.conf authenti= cation defaults as installed with PostgreSQL 8.3. I'm trying to better = understand "best practice" for managing connections to databases = (I've grown accustomed to the MSSQL EM method of assigning user privile= ges). As far as i can tell, pg_hba.conf is the only manner in which to prev= ent users from connecting to other users' databases. I've restricte= d roles to connecting only using sameuser:
=A0
host sameuser all 192.168.168.0/24 md5
=A0
this works fine until a user connects and creates a new database. Pg s= hows that the owner of the database is the currently connected user, but th= e user can't connect to it, as the hba.conf file has the sameuser restr= iction. I was hoping that (somehow, magically) the owner of the database co= uld always connect to the databases he/she owns.
=A0
Is hba.conf the only way to restrict users connections to specific dat= abases? Are there privileges I can grant without having to maintain this fi= le?
=A0
I've spent quite some time researching this, even with the documen= tation, but I'm wondering what I'm missing.
=A0
Thanks,
Isaac

--000e0cd5d054640420046a7fe110--