error connecting to database

Started by Alexander Cohenover 21 years ago7 messagesgeneral
Jump to latest
#1Alexander Cohen
alex@toomuchspace.com

Im trying to connect locally to a database on a running postgres
cluster. If i connect with psql, everything is fine and i can transact.
I i try and connect in my own app, i get this error:

Could not connect to server: permission denied.
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"

I know for a fact postgres is running, i can see with <ps> and also
<top> in the terminal on Mac OSX 10.3.5.

What exctly does this error message mean? What permissions is this
error talking about?

Alex

#2Steven Klassen
sklassen@commandprompt.com
In reply to: Alexander Cohen (#1)
Re: error connecting to database

* Alexander Cohen <alex@toomuchspace.com> [2004-10-01 14:42:07 -0400]:

Im trying to connect locally to a database on a running postgres
cluster. If i connect with psql, everything is fine and i can transact.
I i try and connect in my own app, i get this error:

Could not connect to server: permission denied.
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"

I know for a fact postgres is running, i can see with <ps> and also
<top> in the terminal on Mac OSX 10.3.5.

Try 'netstat -ntpl' intead to see if it's listening.

What exctly does this error message mean? What permissions is this
error talking about?

That typically means that you're connecting via the local unix socket
instead of the tcp port. If your application is trying to do the
latter you'll want to uncomment the tcp_socket setting in
postgresql.conf and restart.

--
Steven Klassen - Lead Programmer
Command Prompt, Inc. - http://www.commandprompt.com/
PostgreSQL Replication & Support Services, (503) 667-4564

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alexander Cohen (#1)
Re: error connecting to database

Alexander Cohen <alex@toomuchspace.com> writes:

Could not connect to server: permission denied.
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"

What exctly does this error message mean? What permissions is this
error talking about?

The permissions on the socket file /tmp/.s.PGSQL.5432.

Ordinarily the postmaster will create the socket as world-writable,
but evidently not this time. Perhaps you have set a nonstandard value
for "unix_socket_permissions"? Another possibility is that it's not
the socket file itself, but /tmp that is mis-permissioned.

regards, tom lane

#4Alexander Cohen
alex@toomuchspace.com
In reply to: Tom Lane (#3)
Re: error connecting to database

On 1-Oct-04, at 3:06 PM, Tom Lane wrote:

Alexander Cohen <alex@toomuchspace.com> writes:

Could not connect to server: permission denied.
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"

What exctly does this error message mean? What permissions is this
error talking about?

The permissions on the socket file /tmp/.s.PGSQL.5432.

Ordinarily the postmaster will create the socket as world-writable,
but evidently not this time. Perhaps you have set a nonstandard value
for "unix_socket_permissions"? Another possibility is that it's not
the socket file itself, but /tmp that is mis-permissioned.

What kind of permissions does /tmp need?

Alex

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alexander Cohen (#4)
Re: error connecting to database

Alexander Cohen <alex@toomuchspace.com> writes:

What kind of permissions does /tmp need?

Generally it's 777 (ie, wide open), plus stickybit if your system
supports that (so people can't delete each others' temp files).

regards, tom lane

#6Astha Raj
astha@tryarc.com
In reply to: Tom Lane (#5)
ODBC for PostgreSQL 7.4

Hi All,

I want to connect to PostgreSQL 7.4 from my Windows machine. What ODBC
version is needed? Is there any other important settings required? I am very
new to this database.

Thanks,
Astha

#7Gaetano Mendola
mendola@bigfoot.com
In reply to: Astha Raj (#6)
Re: ODBC for PostgreSQL 7.4

Astha Raj wrote:

Hi All,

I want to connect to PostgreSQL 7.4 from my Windows machine. What ODBC
version is needed? Is there any other important settings required? I am very
new to this database.

Search on google: "odbc postgresql" and I'm feeling lucky.

Regards
Gaetano Mendola