pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem database access
8+ messages / 4 participants
[nested] [flat]

* Problem database access
@ 2009-03-11 13:02 Yann Collavoli <cyann@cict.fr>
  2009-03-12 09:51 ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
  0 siblings, 1 reply; 8+ messages in thread

From: Yann Collavoli @ 2009-03-11 13:02 UTC (permalink / raw)
  To: pgsql-admin

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




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Problem database access
  2009-03-11 13:02 Problem database access Yann Collavoli <cyann@cict.fr>
@ 2009-03-12 09:51 ` Yann Collavoli <cyann@cict.fr>
  2009-03-12 10:10   ` Re: Problem database access BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Yann Collavoli @ 2009-03-12 09:51 UTC (permalink / raw)
  To: Tommy Cheng <csckcac@gmail.com>; pgsql-admin; +Cc: Marielle BONNARD <bonnard@cict.fr>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello,,<br>
<br>
Thank you for your help but it doesn't work with the line :<br>
host    toto     toto 0.0.0.0 0.0.0.0 md5<br>
<br>
I've got the same error message :<br>
FATAL:  no pg_hba.conf entry for host "[local]", user "toto", database
"template1", SSL off<br>
<br>
Yann<br>
<br>
Tommy Cheng wrote:
<blockquote
 cite="mid:2267dd9e0903120226t66d02558pabc83cec2232a253@mail.gmail.com"
 type="cite">
  <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
Try this:<br>
host    toto     toto 0.0.0.0 0.0.0.0 md5<br>
  <br>
  <div>On Wed, Mar 11, 2009 at 9:02 PM, Yann Collavoli <span>&lt;<a
 moz-do-not-send="true" href="mailto:cyann@cict.fr">cyann@cict.fr</a>&gt;</span>
wrote:<br>
  <blockquote>Hello,<br>
    <br>
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.<br>
    <br>
I used these lines to create the user and his database :<br>
bash-3.2$ createuser toto -P -D -A<br>
Enter password FOR new role:<br>
Enter it again:<br>
Shall the new role be allowed TO CREATE more new roles? (y/n) n<br>
CREATE ROLE<br>
-bash-3.2$ createdb -O toto -E LATIN1 toto<br>
CREATE DATABASE<br>
    <br>
This is the contents of the file pg_hba.conf :<br>
# TYPE DATABASE USER CIDR-ADDRESS METHOD<br>
LOCAL sameuser ALL md5<br>
LOCAL ALL @admins md5<br>
    <br>
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 :<br>
    <br>
FATAL: no pg_hba.conf entry FOR host "[local]", user "toto", DATABASE
"template1", SSL off<br>
    <br>
Do you have any idea about why it doesn’t work and how to correct it?<br>
    <br>
Thanks in advance for your help<br>
    <br>
Regards<br>
    <br>
Yann<br>
    <br>
-- <br>
Yann Collavoli<br>
    <br>
Tél : 05 61 36 60 20<br>
    <br>
Université Paul Sabatier<br>
CICT<br>
118, route de Narbonne<br>
31062 Toulouse Cedex<br>
    <br>
    <br>
-- <br>
Sent via pgsql-admin mailing list (<a moz-do-not-send="true"
 href="mailto:pgsql-admin@postgresql.org">pgsql-admin@postgresql.org</a>)<br>
To make changes to your subscription:<br>
    <a moz-do-not-send="true"
 href="http://www.postgresql.org/mailpref/pgsql-admin">http://www.postgresql.org/mailpref/pgsql-admi...;
  </blockquote>
  </div>
  <br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Yann Collavoli

Tél : 05 61 36 60 20

Université Paul Sabatier
CICT
118, route de Narbonne
31062 Toulouse Cedex</pre>
</body>
</html>



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Problem database access
  2009-03-11 13:02 Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 09:51 ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
@ 2009-03-12 10:10   ` BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
  2009-03-12 11:22     ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
  0 siblings, 1 reply; 8+ messages in thread

From: BRAHMA PRAKASH TIWARI @ 2009-03-12 10:10 UTC (permalink / raw)
  To: Yann Collavoli <cyann@cict.fr>; +Cc: Tommy Cheng <csckcac@gmail.com>; pgsql-admin@postgresql.org, Marielle BONNARD <bonnard@cict.fr>

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> 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> 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)
> 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

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Problem database access
  2009-03-11 13:02 Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 09:51 ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 10:10   ` Re: Problem database access BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
@ 2009-03-12 11:22     ` Yann Collavoli <cyann@cict.fr>
  2009-03-12 11:28       ` Re: Problem database access Ashish Karalkar <ashishka@synechron.com>
  2009-03-12 11:31       ` Re: Problem database access BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
  0 siblings, 2 replies; 8+ messages in thread

From: Yann Collavoli @ 2009-03-12 11:22 UTC (permalink / raw)
  To: BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>; +Cc: Tommy Cheng <csckcac@gmail.com>; pgsql-admin@postgresql.org, Marielle BONNARD <bonnard@cict.fr>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi, <br>
<br>
If i add this line&nbsp; "local&nbsp;&nbsp; all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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
&#8220;toto&#8221; access only at the database named &#8220;toto&#8221;). I think it's possible
to do that but i don't understand how...<br>
<br>
Regards<br>
<br>
Yann<br>
<br>
BRAHMA PRAKASH TIWARI wrote:
<blockquote
 cite="mid:2acc2c820903120310w48f01252r1d00e4374293902c@mail.gmail.com"
 type="cite">
  <meta http-equiv="Context-Type"
 content="text/html; charset=windows-1252">
  <div>Hi you need to add following enty 100% it will resolve the
problem</div>
  <div>&nbsp;</div>
  <div>&nbsp;</div>
  <div># "local" is for Unix domain socket connections only<br>
&nbsp;local&nbsp;&nbsp; all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; trust<br>
  <br>
  <br>
  </div>
  <div>On Thu, Mar 12, 2009 at 3:21 PM, Yann Collavoli <span>&lt;<a
 moz-do-not-send="true" href="mailto:cyann@cict.fr">cyann@cict.fr</a>&gt;</span>
wrote:<br>
  <blockquote>
    <div>Hello,,<br>
    <br>
Thank you for your help but it doesn't work with the line :<br>
host&nbsp;&nbsp;&nbsp; toto &nbsp;&nbsp;&nbsp; toto 0.0.0.0 0.0.0.0 md5<br>
    <br>
I've got the same error message :<br>
FATAL:&nbsp; no pg_hba.conf entry for host "[local]", user "toto", database
"template1", SSL off<br>
    <br>
Yann<br>
    <br>
Tommy Cheng wrote:
    <blockquote type="cite">Try this:<br>
host&nbsp;&nbsp;&nbsp; toto &nbsp;&nbsp;&nbsp; toto 0.0.0.0 0.0.0.0 md5<br>
      <br>
      <div>On Wed, Mar 11, 2009 at 9:02 PM, Yann Collavoli <span>&lt;<a
 moz-do-not-send="true" href="mailto:cyann@cict.fr">cyann@cict.fr</a>&gt;</span>
wrote:<br>
      <blockquote>Hello,<br>
        <br>
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
&#8220;toto&#8221; access a database named &#8220;toto&#8221;, etc.<br>
        <br>
I used these lines to create the user and his database :<br>
bash-3.2$ createuser toto -P -D -A<br>
Enter password FOR new role:<br>
Enter it again:<br>
Shall the new role be allowed TO CREATE more new roles? (y/n) n<br>
CREATE ROLE<br>
-bash-3.2$ createdb -O toto -E LATIN1 toto<br>
CREATE DATABASE<br>
        <br>
This is the contents of the file pg_hba.conf :<br>
# TYPE DATABASE USER CIDR-ADDRESS METHOD<br>
LOCAL sameuser ALL md5<br>
LOCAL ALL @admins md5<br>
        <br>
The &#8220;postgres&#8221; user (so the administrator of the database) can log in
phpPgAdmin (without any problem). This user can see all databases. When
the user&#8221;toto&#8221; logs in phpPgAdmin, the connection failed and I get the
following error message in the postgres logs :<br>
        <br>
FATAL: no pg_hba.conf entry FOR host "[local]", user "toto", DATABASE
"template1", SSL off<br>
        <br>
Do you have any idea about why it doesn&#8217;t work and how to correct it?<br>
        <br>
Thanks in advance for your help<br>
        <br>
Regards<br>
        <br>
Yann<br>
        <br>
-- <br>
Yann Collavoli<br>
        <br>
T&eacute;l : 05 61 36 60 20<br>
        <br>
Universit&eacute; Paul Sabatier<br>
CICT<br>
118, route de Narbonne<br>
31062 Toulouse Cedex<br>
        <br>
        <br>
-- <br>
Sent via pgsql-admin mailing list (<a moz-do-not-send="true"
 href="mailto:pgsql-admin@postgresql.org">pgsql-admin@postgresql.org</a>)<br>
To make changes to your subscription:<br>
        <a moz-do-not-send="true"
 href="http://www.postgresql.org/mailpref/pgsql-admin">http://www.postgresql.org/mailpref/pgsql-admi...;
      </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
    <br>
    <pre>-- 
Yann Collavoli

T&eacute;l : 05 61 36 60 20

Universit&eacute; Paul Sabatier
CICT
118, route de Narbonne
31062 Toulouse Cedex</pre>
    </div>
  </blockquote>
  </div>
  <br>
  <br>
  <br>
-- <br>
Brahma Prakash Tiwari<br>
Database Administrator<br>
iBoss Tech Solution Noida<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Yann Collavoli

T&eacute;l : 05 61 36 60 20

Universit&eacute; Paul Sabatier
CICT
118, route de Narbonne
31062 Toulouse Cedex</pre>
</body>
</html>



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Problem database access
  2009-03-11 13:02 Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 09:51 ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 10:10   ` Re: Problem database access BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
  2009-03-12 11:22     ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
@ 2009-03-12 11:28       ` Ashish Karalkar <ashishka@synechron.com>
  1 sibling, 0 replies; 8+ messages in thread

From: Ashish Karalkar @ 2009-03-12 11:28 UTC (permalink / raw)
  To: Yann Collavoli <cyann@cict.fr>; +Cc: BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>; Tommy Cheng <csckcac@gmail.com>; pgsql-admin@postgresql.org, Marielle BONNARD <bonnard@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/
/
/







^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Problem database access
  2009-03-11 13:02 Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 09:51 ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 10:10   ` Re: Problem database access BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
  2009-03-12 11:22     ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
@ 2009-03-12 11:31       ` BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
  2009-03-12 14:44         ` Re: Problem database access Carol Walter <walterc@indiana.edu>
  1 sibling, 1 reply; 8+ messages in thread

From: BRAHMA PRAKASH TIWARI @ 2009-03-12 11:31 UTC (permalink / raw)
  To: Yann Collavoli <cyann@cict.fr>; +Cc: Tommy Cheng <csckcac@gmail.com>; pgsql-admin@postgresql.org, Marielle BONNARD <bonnard@cict.fr>

Hi Yann
For below given purpose you need to create roles  and assign them separately
to each database user or revoke the global permission from database and
givepermission to   concern user only and also You need to change the
password of global user.this is the best way by which You can achive your
requirement.none can see others database

On Thu, Mar 12, 2009 at 4:52 PM, Yann Collavoli <cyann@cict.fr> 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> 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> 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)
> 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
>
>


-- 
Brahma Prakash Tiwari
Database Administrator
iBoss Tech Solution Noida

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Problem database access
  2009-03-11 13:02 Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 09:51 ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 10:10   ` Re: Problem database access BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
  2009-03-12 11:22     ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 11:31       ` Re: Problem database access BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
@ 2009-03-12 14:44         ` Carol Walter <walterc@indiana.edu>
  2009-03-13 08:10           ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
  0 siblings, 1 reply; 8+ messages in thread

From: Carol Walter @ 2009-03-12 14:44 UTC (permalink / raw)
  To: ; +Cc: pgsql-admin

If your users are the database owners, you can set the "Only show  
owned databases?" option in the config.inc.php file for your PhpPgAdmin.

Carol

On Mar 12, 2009, at 7:31 AM, BRAHMA PRAKASH TIWARI wrote:

> Hi Yann
> For below given purpose you need to create roles  and assign them  
> separately to each database user or revoke the global permission  
> from database and givepermission to   concern user only and also You  
> need to change the password of global user.this is the best way by  
> which You can achive your requirement.none can see others database
>
> On Thu, Mar 12, 2009 at 4:52 PM, Yann Collavoli <cyann@cict.fr> 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>  
>> 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>  
>>> 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)
>>> 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
>
>
>
> -- 
> Brahma Prakash Tiwari
> Database Administrator
> iBoss Tech Solution Noida

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Problem database access
  2009-03-11 13:02 Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 09:51 ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 10:10   ` Re: Problem database access BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
  2009-03-12 11:22     ` Re: Problem database access Yann Collavoli <cyann@cict.fr>
  2009-03-12 11:31       ` Re: Problem database access BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
  2009-03-12 14:44         ` Re: Problem database access Carol Walter <walterc@indiana.edu>
@ 2009-03-13 08:10           ` Yann Collavoli <cyann@cict.fr>
  0 siblings, 0 replies; 8+ messages in thread

From: Yann Collavoli @ 2009-03-13 08:10 UTC (permalink / raw)
  To: Carol Walter <walterc@indiana.edu>; +Cc: pgsql-admin

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=windows-1252"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
Thank you very much, with this parameter it works like i want !!<br>
<br>
Yann<br>
<br>
<br>
Carol Walter wrote:
<blockquote cite="mid:E2CD6292-4B68-4D7B-BA10-CD99E9AABBAE@indiana.edu"
 type="cite">
  <meta http-equiv="Context-Type"
 content="text/html; charset=WINDOWS-1252">
If your users are the database owners, you can set the "Only show owned
databases?" option in the config.inc.php file for your PhpPgAdmin.
  <div><br>
  </div>
  <div>Carol</div>
  <div><br>
  <div>
  <div>On Mar 12, 2009, at 7:31 AM, BRAHMA PRAKASH TIWARI wrote:</div>
  <br>
  <blockquote type="cite">
    <div>Hi Yann</div>
    <div>For below given purpose you need to create roles  and assign
them separately to each database user or revoke the global permission
from database and givepermission to   concern user only and also You
need to change the password of global user.this is the best way by
which You can achive your requirement.none can see others database<br>
    <br>
    </div>
    <div>On Thu, Mar 12, 2009 at 4:52 PM, Yann Collavoli <span>&lt;<a
 moz-do-not-send="true" href="mailto:cyann@cict.fr">cyann@cict.fr</a>&gt;</span>
wrote:<br>
    <blockquote>
      <div>Hi, <br>
      <br>
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...<br>
      <br>
Regards<br>
      <br>
Yann
      <div>
      <div><br>
      <br>
BRAHMA PRAKASH TIWARI wrote:
      <blockquote type="cite">
        <div>Hi you need to add following enty 100% it will resolve the
problem</div>
        <div> </div>
        <div> </div>
        <div># "local" is for Unix domain socket connections only<br>
 local   all         all                               trust<br>
        <br>
        <br>
        </div>
        <div>On Thu, Mar 12, 2009 at 3:21 PM, Yann Collavoli <span>&lt;<a
 moz-do-not-send="true" href="mailto:cyann@cict.fr">cyann@cict.fr</a>&gt;</span>
wrote:<br>
        <blockquote>
          <div>Hello,,<br>
          <br>
Thank you for your help but it doesn't work with the line :<br>
host    toto     toto 0.0.0.0 0.0.0.0 md5<br>
          <br>
I've got the same error message :<br>
FATAL:  no pg_hba.conf entry for host "[local]", user "toto", database
"template1", SSL off<br>
          <br>
Yann<br>
          <br>
Tommy Cheng wrote:
          <blockquote type="cite">Try this:<br>
host    toto     toto 0.0.0.0 0.0.0.0 md5<br>
            <br>
            <div>On Wed, Mar 11, 2009 at 9:02 PM, Yann Collavoli <span>&lt;<a
 moz-do-not-send="true" href="mailto:cyann@cict.fr">cyann@cict.fr</a>&gt;</span>
wrote:<br>
            <blockquote>Hello,<br>
              <br>
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.<br>
              <br>
I used these lines to create the user and his database :<br>
bash-3.2$ createuser toto -P -D -A<br>
Enter password FOR new role:<br>
Enter it again:<br>
Shall the new role be allowed TO CREATE more new roles? (y/n) n<br>
CREATE ROLE<br>
-bash-3.2$ createdb -O toto -E LATIN1 toto<br>
CREATE DATABASE<br>
              <br>
This is the contents of the file pg_hba.conf :<br>
# TYPE DATABASE USER CIDR-ADDRESS METHOD<br>
LOCAL sameuser ALL md5<br>
LOCAL ALL @admins md5<br>
              <br>
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 :<br>
              <br>
FATAL: no pg_hba.conf entry FOR host "[local]", user "toto", DATABASE
"template1", SSL off<br>
              <br>
Do you have any idea about why it doesn’t work and how to correct it?<br>
              <br>
Thanks in advance for your help<br>
              <br>
Regards<br>
              <br>
Yann<br>
              <br>
-- <br>
Yann Collavoli<br>
              <br>
Tél : 05 61 36 60 20<br>
              <br>
Université Paul Sabatier<br>
CICT<br>
118, route de Narbonne<br>
31062 Toulouse Cedex<br>
              <br>
              <br>
-- <br>
Sent via pgsql-admin mailing list (<a moz-do-not-send="true"
 href="mailto:pgsql-admin@postgresql.org">pgsql-admin@postgresql.org</a>)<br>
To make changes to your subscription:<br>
              <a moz-do-not-send="true"
 href="http://www.postgresql.org/mailpref/pgsql-admin">http://www.postgresql.org/mailpref/pgsql-admi...;
            </blockquote>
            </div>
            <br>
          </blockquote>
          <br>
          <br>
          <pre>-- 
Yann Collavoli

Tél : 05 61 36 60 20

Université Paul Sabatier
CICT
118, route de Narbonne
31062 Toulouse Cedex</pre>
          </div>
        </blockquote>
        </div>
        <br>
        <br>
        <br>
-- <br>
Brahma Prakash Tiwari<br>
Database Administrator<br>
iBoss Tech Solution Noida<br>
      </blockquote>
      <br>
      <br>
      <pre>-- 
Yann Collavoli

Tél : 05 61 36 60 20

Université Paul Sabatier
CICT
118, route de Narbonne
31062 Toulouse Cedex</pre>
      </div>
      </div>
      </div>
    </blockquote>
    </div>
    <br>
    <br>
    <br>
-- <br>
Brahma Prakash Tiwari<br>
Database Administrator<br>
iBoss Tech Solution Noida<br>
  </blockquote>
  </div>
  <br>
  </div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Yann Collavoli

Tél : 05 61 36 60 20

Université Paul Sabatier
CICT
118, route de Narbonne
31062 Toulouse Cedex</pre>
</body>
</html>



^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2009-03-13 08:10 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-03-11 13:02 Problem database access Yann Collavoli <cyann@cict.fr>
2009-03-12 09:51 ` Yann Collavoli <cyann@cict.fr>
2009-03-12 10:10   ` BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
2009-03-12 11:22     ` Yann Collavoli <cyann@cict.fr>
2009-03-12 11:28       ` Ashish Karalkar <ashishka@synechron.com>
2009-03-12 11:31       ` BRAHMA PRAKASH TIWARI <prakashr2n5@gmail.com>
2009-03-12 14:44         ` Carol Walter <walterc@indiana.edu>
2009-03-13 08:10           ` Yann Collavoli <cyann@cict.fr>

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