Re: error connecting to database

Lists: pgsql-general
From: Alexander Cohen <alex(at)toomuchspace(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: error connecting to database
Date: 2004-10-01 18:42:07
Message-ID: 9872D4BC-13D9-11D9-9530-000A95B947DC@toomuchspace.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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


From: sklassen(at)commandprompt(dot)com
To: Alexander Cohen <alex(at)toomuchspace(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: error connecting to database
Date: 2004-10-01 18:49:54
Message-ID: 20041001114954.A13387@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

* Alexander Cohen <alex(at)toomuchspace(dot)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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Cohen <alex(at)toomuchspace(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: error connecting to database
Date: 2004-10-01 19:06:15
Message-ID: 13652.1096657575@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Alexander Cohen <alex(at)toomuchspace(dot)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


From: Alexander Cohen <alex(at)toomuchspace(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: error connecting to database
Date: 2004-10-01 19:12:31
Message-ID: D7EDF15D-13DD-11D9-9530-000A95B947DC@toomuchspace.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


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

> Alexander Cohen <alex(at)toomuchspace(dot)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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Cohen <alex(at)toomuchspace(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: error connecting to database
Date: 2004-10-01 21:14:16
Message-ID: 15026.1096665256@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Alexander Cohen <alex(at)toomuchspace(dot)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


From: "Astha Raj" <astha(at)tryarc(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: ODBC for PostgreSQL 7.4
Date: 2004-10-01 23:24:41
Message-ID: 002b01c4a80d$d46c8720$6600a8c0@tryarcamritold
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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


From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: Astha Raj <astha(at)tryarc(dot)com>
Subject: Re: ODBC for PostgreSQL 7.4
Date: 2004-10-02 08:49:01
Message-ID: 415E6B7D.1030206@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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