pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ashish Karalkar <ashishka@synechron.com>
To: Yann Collavoli <cyann@cict.fr>
Cc: BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
Cc: Tommy Cheng <csckcac@gmail.com>
Cc: pgsql-admin@postgresql.org, Marielle BONNARD <bonnard@cict.fr>
Subject: Re: Problem database access
Date: Thu, 12 Mar 2009 16:58:14 +0530
Message-ID: <49B8F1CE.9020605@synechron.com> (raw)
In-Reply-To: <49B8F083.4090204@cict.fr>
References: <49B7B65D.4090505@cict.fr>
	<2267dd9e0903120226t66d02558pabc83cec2232a253@mail.gmail.com>
	<49B8DB39.1010601@cict.fr>
	<2acc2c820903120310w48f01252r1d00e4374293902c@mail.gmail.com>
	<49B8F083.4090204@cict.fr>





Yann Collavoli wrote:
> Hi,
>
> If i add this line "local all all trust", the user "toto" can log in 
> phpPgAdmin but he can see the others databases. Or, I want each user 
> to access only its own database through phpPgAdmin (for example, user 
> “toto” access only at the database named “toto”). I think it's 
> possible to do that but i don't understand how...
>
> Regards
>
> Yann
>
> BRAHMA PRAKASH TIWARI wrote:
>> Hi you need to add following enty 100% it will resolve the problem
>> # "local" is for Unix domain socket connections only
>> local all all trust
>>
>>
>> On Thu, Mar 12, 2009 at 3:21 PM, Yann Collavoli <cyann@cict.fr 
>> <mailto:cyann@cict.fr>> wrote:
>>
>>     Hello,,
>>
>>     Thank you for your help but it doesn't work with the line :
>>     host toto toto 0.0.0.0 0.0.0.0 md5
>>
>>     I've got the same error message :
>>     FATAL: no pg_hba.conf entry for host "[local]", user "toto",
>>     database "template1", SSL off
>>
>>     Yann
>>
>>     Tommy Cheng wrote:
>>>     Try this:
>>>     host toto toto 0.0.0.0 0.0.0.0 md5
>>>
>>>     On Wed, Mar 11, 2009 at 9:02 PM, Yann Collavoli <cyann@cict.fr
>>>     <mailto:cyann@cict.fr>> wrote:
>>>
>>>         Hello,
>>>
>>>         I am trying to install a postgresql 8.1 shared server. I
>>>         want each user to access only its own database through
>>>         phpPgAdmin. For example, user “toto” access a database named
>>>         “toto”, etc.
>>>
>>>         I used these lines to create the user and his database :
>>>         bash-3.2$ createuser toto -P -D -A
>>>         Enter password FOR new role:
>>>         Enter it again:
>>>         Shall the new role be allowed TO CREATE more new roles? (y/n) n
>>>         CREATE ROLE
>>>         -bash-3.2$ createdb -O toto -E LATIN1 toto
>>>         CREATE DATABASE
>>>
>>>         This is the contents of the file pg_hba.conf :
>>>         # TYPE DATABASE USER CIDR-ADDRESS METHOD
>>>         LOCAL sameuser ALL md5
>>>         LOCAL ALL @admins md5
>>>
>>>         The “postgres” user (so the administrator of the database)
>>>         can log in phpPgAdmin (without any problem). This user can
>>>         see all databases. When the user”toto” logs in phpPgAdmin,
>>>         the connection failed and I get the following error message
>>>         in the postgres logs :
>>>
>>>         FATAL: no pg_hba.conf entry FOR host "[local]", user "toto",
>>>         DATABASE "template1", SSL off
>>>
>>>         Do you have any idea about why it doesn’t work and how to
>>>         correct it?
>>>
>>>         Thanks in advance for your help
>>>
>>>         Regards
>>>
>>>         Yann
>>>
>>>         -- 
>>>         Yann Collavoli
>>>
>>>         Tél : 05 61 36 60 20
>>>
>>>         Université Paul Sabatier
>>>         CICT
>>>         118, route de Narbonne
>>>         31062 Toulouse Cedex
>>>
>>>
>>>         -- 
>>>         Sent via pgsql-admin mailing list
>>>         (pgsql-admin@postgresql.org <mailto:pgsql-admin@postgresql.org>)
>>>         To make changes to your subscription:
>>>         http://www.postgresql.org/mailpref/pgsql-admin
>>>
>>>
>>
>>
>>     -- 
>>     Yann Collavoli
>>
>>     Tél : 05 61 36 60 20
>>
>>     Université Paul Sabatier
>>     CICT
>>     118, route de Narbonne
>>     31062 Toulouse Cedex
>>
>>
>>
>>
>> -- 
>> Brahma Prakash Tiwari
>> Database Administrator
>> iBoss Tech Solution Noida
>
>
> -- 
> Yann Collavoli
>
> Tél : 05 61 36 60 20
>
> Université Paul Sabatier
> CICT
> 118, route de Narbonne
> 31062 Toulouse Cedex

Look at pg_hba what it says.

This will help you

local      /database/  /user/  /auth-method

so 

local	toto toto trust
local 	toto1 toto1 trust
local 	toto2	toto2 trust


PS. Don't top post/
/
/







view thread (8+ messages)  latest in thread

Message-ID: <49B8F1CE.9020605@synechron.com>
Permalink:  ../49B8F1CE.9020605@synechron.com/
Also on:    postgresql.org/message-id/49B8F1CE.9020605@synechron.com

 · 

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: ashishka@synechron.com, cyann@cict.fr, prakashr2n5@gmail.com, csckcac@gmail.com, bonnard@cict.fr
  Subject: Re: Problem database access
  In-Reply-To: <49B8F1CE.9020605@synechron.com>

* 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