Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C52131336971 for ; Thu, 25 Nov 2010 03:37:37 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 98048-06 for ; Thu, 25 Nov 2010 07:37:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id DD63A133655C for ; Thu, 25 Nov 2010 03:37:29 -0400 (AST) Received: from [192.168.10.2] (ASte-Genev-Bois-153-1-85-80.w81-48.abo.wanadoo.fr [81.48.35.80]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id 1CF513B8F5; Thu, 25 Nov 2010 08:37:29 +0100 (CET) Message-ID: <4CEE1238.8060808@lelarge.info> Date: Thu, 25 Nov 2010 08:37:28 +0100 From: Guillaume Lelarge User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); fr; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: tomislavb CC: pgsql-admin@postgresql.org Subject: Re: managing access to database References: <1290515065600-3276689.post@n5.nabble.com> In-Reply-To: <1290515065600-3276689.post@n5.nabble.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.778 tagged_above=-10 required=5 tests=BAYES_00=-1.9, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201011/220 X-Sequence-Number: 36186 Le 23/11/2010 13:24, tomislavb a écrit : > [...] > i've seen this is a popular topic but haven't found any concrete answers so > far. > So my scenario is this : > > - created a new user with : > sudo -u postgres createuser -D -A -P john > > - created a new database with : > sudo -u postgres createdb -E 'UTF8' -O john test > > - added plpgsql > sudo -u postgres createlang plpgsql test > > After that i wanted to allow "external" access to the "test" database. > So i tried configuring the pg_hba.conf file. > In my first attempt i added this line to pg_hba.conf: > host all john 0.0.0.0/0 md5 > And john had connect access to access to all databases and admin access to > his "test" database. > > After that i wanted give john admin access to his "test" db, and absolutely > no access to other databases. > host test john 0.0.0.0/0 md5 > > It doesnt work. Can't login through pg_admin. > I've played with revoking access to other databases, but to no avail. > > I'm quite positive i'm not the first one with this issue. > There is a similar > http://postgresql.1045698.n5.nabble.com/Extended-security-restriction-to-any-role-with-login-access-td2089118.html#a2089128 > thread on the matter.. > > Any help would be very appreciated. > Your help to resolve your issue would be very appreciated, for example by giving us the error message you have when you try to connect :) Anyway, we can try and guess that you forgot to change listen_addresses. If this postgresql.conf parameter is 'localhost', then you should change it to be '*'. After that, you restart PostgreSQL, and you should be able to connect from pgAdmin. If it doesn't work, give us the error message and your full pg_hba.conf file (mind you, the lines order are important). -- Guillaume http://www.postgresql.fr http://dalibo.com