Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 02:22 AM
Alexander Cohen
Guest
 
Posts: n/a
Default error connecting to database

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


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

  #2  
Old November 23rd, 2005, 02:22 AM
sklassen@commandprompt.com
Guest
 
Posts: n/a
Default Re: error connecting to database

* Alexander Cohen <alex@toomuchspace.com> [2004-10-01 14:42:07 -0400]:
[color=blue]
> 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.[/color]

Try 'netstat -ntpl' intead to see if it's listening.
[color=blue]
> What exctly does this error message mean? What permissions is this
> error talking about?[/color]

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

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

  #3  
Old November 23rd, 2005, 02:22 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: error connecting to database

Alexander Cohen <alex@toomuchspace.com> writes:[color=blue]
> Could not connect to server: permission denied.
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL.5432"[/color]
[color=blue]
> What exctly does this error message mean? What permissions is this
> error talking about?[/color]

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

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

  #4  
Old November 23rd, 2005, 02:22 AM
Alexander Cohen
Guest
 
Posts: n/a
Default Re: error connecting to database


On 1-Oct-04, at 3:06 PM, Tom Lane wrote:
[color=blue]
> Alexander Cohen <alex@toomuchspace.com> writes:[color=green]
>> Could not connect to server: permission denied.
>> Is the server running locally and accepting
>> connections on Unix domain socket "/tmp/.s.PGSQL.5432"[/color]
>[color=green]
>> What exctly does this error message mean? What permissions is this
>> error talking about?[/color]
>
> 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.[/color]

What kind of permissions does /tmp need?

Alex


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

  #5  
Old November 23rd, 2005, 02:22 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: error connecting to database

Alexander Cohen <alex@toomuchspace.com> writes:[color=blue]
> What kind of permissions does /tmp need?[/color]

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

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

  #6  
Old November 23rd, 2005, 02:23 AM
Astha Raj
Guest
 
Posts: n/a
Default 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


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

  #7  
Old November 23rd, 2005, 02:23 AM
Gaetano Mendola
Guest
 
Posts: n/a
Default Re: ODBC for PostgreSQL 7.4

Astha Raj wrote:[color=blue]
> 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.[/color]

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






Regards
Gaetano Mendola

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles