Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009
    Posts
    2

    Unhappy Unanswered: Connection to database failed: could not connect to server: No such file or directory

    Hi all,
    I am having a problem with postgresql database connectivity with C program.
    I am using the libpq for connectivity. But whenever I execute my c program I am getting this error.

    "Connection to database failed: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?"


    I have tried and looked that no other service is using the port. Some one please help me..It is very very urent for me.

    Thanks in advance
    Krisveejay!

  2. #2
    Join Date
    Oct 2002
    Location
    Baghdad, Iraq
    Posts
    697
    Quote Originally Posted by krisveejay.83 View Post
    Hi all,
    I am having a problem with postgresql database connectivity with C program.
    I am using the libpq for connectivity. But whenever I execute my c program I am getting this error.
    Ooh... a C problem.

    Post your connection code, and your connection parameters, and the server's configuration. Oh, and the output for:

    Code:
    gcc -v; uname -a;
    If you run psql, what do you specify to connect with that?

    I have tried and looked that no other service is using the port.
    From the error message, your client code is trying to connect via a Unix socket. But you looked for a port; are you expecting to connect via TCP/IP?

    Some one please help me..It is very very urent for me.
    Please don't beg for help, it's undignified.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •