postgres user can connect but no one else

Lists: pgsql-novice
From: "A B" <gentosaker(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: postgres user can connect but no one else
Date: 2008-11-03 10:04:42
Message-ID: dbbf25900811030204y784693bj658d2a9510f5ef1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

I can do

# su - postgres
$ psql

and run sql commands, but running
psql
as the user I just created with the command

createuser -s -d -E -P -e myself

fails with
psql: could not connect to server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"

I run psql as the "myself" user. and even psql -U myself template1
fails. (template1 was the database that always is there, right?)

pg_hba.conf says

local all all trust
host all all 127.0.0.1/32 password
host all all ::1/128 password

I'm not sure why I cant connect.


From: "Obe, Regina" <robe(dot)dnd(at)cityofboston(dot)gov>
To: "A B" <gentosaker(at)gmail(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: postgres user can connect but no one else
Date: 2008-11-03 12:05:37
Message-ID: 53F9CF533E1AA14EA1F8C5C08ABC08D204F4BCE7@ZDND.DND.boston.cob
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

This is a common problem.

You should add a line at the end something like (you make want to limit
the ip range)

host all all 0.0.0.0/0 md5

You should also make sure your postgresql.conf file listen setting is
set to

listen_addresses = '*' # what IP address(es) to listen on;

and not
#listen_addresses = 'localhost' # what IP address(es) to listen
on;

Hope this helps,
Regina

-----Original Message-----
From: pgsql-novice-owner(at)postgresql(dot)org
[mailto:pgsql-novice-owner(at)postgresql(dot)org] On Behalf Of A B
Sent: Monday, November 03, 2008 5:05 AM
To: pgsql-novice(at)postgresql(dot)org
Subject: [NOVICE] postgres user can connect but no one else

I can do

# su - postgres
$ psql

and run sql commands, but running
psql
as the user I just created with the command

createuser -s -d -E -P -e myself

fails with
psql: could not connect to server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket
"/var/run/postgresql/.s.PGSQL.5432"

I run psql as the "myself" user. and even psql -U myself template1
fails. (template1 was the database that always is there, right?)

pg_hba.conf says

local all all trust
host all all 127.0.0.1/32 password
host all all ::1/128 password

I'm not sure why I cant connect.

--
Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "A B" <gentosaker(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: postgres user can connect but no one else
Date: 2008-11-03 14:41:17
Message-ID: 26064.1225723277@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

"A B" <gentosaker(at)gmail(dot)com> writes:
> psql: could not connect to server: Permission denied
> Is the server running locally and accepting
> connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"

Did you actually put the socket file there? If so, the problem is
probably lack of world read permission for /var/run/postgresql/.

regards, tom lane