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.

Search Discussions

  • Obe, Regina at Nov 3, 2008 at 12:05 pm
    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: [email protected]
    On Behalf Of A B
    Sent: Monday, November 03, 2008 5:05 AM
    To: [email protected]
    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 ([email protected])
    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.
  • Tom Lane at Nov 3, 2008 at 2:41 pm

    "A B" <[email protected]> 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedNov 3, '08 at 10:04a
activeNov 3, '08 at 2:41p
posts3
users3
websitepostgresql.org
irc#postgresql

3 users in discussion

A B: 1 post Obe, Regina: 1 post Tom Lane: 1 post

People

Translate

site design / logo © 2023 Grokbase