pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ryan Rohde Hansen <rrha00@control.auc.dk>
To: pgsql-admin@postgresql.org
Subject: Problems between Mandrake and pg
Date: Wed, 21 Nov 2001 14:44:04 +0100
Message-ID: <3BFBAFA4.541ED1C2@control.auc.dk> (raw)

Hi

We are a group studying at Aalborg University. We are at the moment
developing a postgresql-db (7.1.3) on Mandrake 8.0, which we intend to
access via libpq. But at the moment we can't even connect to the db.
The connection is refused and we are asked if the -i option has been set
in the startup of postmaster:

    [01gr551@ika dbkode]$ ./test1
    Connection to host=localhost dbname=01gr551 failed, PQconnectPoll()
-- connect()
     failed: Connection refused
            Is the postmaster running (with -i) at 'localhost'
            and accepting connections on TCP/IP port '5432'?

The program we are running:

    #include <stdlib.h>
    #include <stdio.h>
    #include </usr/local/pgsql/include/libpq-fe.h>

    int main()
    {

       PGconn *conn;
       const char *connection_str = "host=localhost dbname=01gr551";

       conn = PQconnectdb(connection_str);
       if (PQstatus(conn) == CONNECTION_BAD) {
          fprintf(stderr, "Connection to %s failed, %s", connection_str,

          PQerrorMessage(conn));
       } else {
          printf("Connected OK\n");
       }
       PQfinish(conn);
       return EXIT_SUCCESS;
    }



view thread (4+ messages)  latest in thread

Message-ID: <3BFBAFA4.541ED1C2@control.auc.dk>
Permalink:  ../3BFBAFA4.541ED1C2@control.auc.dk/
Also on:    postgresql.org/message-id/3BFBAFA4.541ED1C2@control.auc.dk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: rrha00@control.auc.dk
  Subject: Re: Problems between Mandrake and pg
  In-Reply-To: <3BFBAFA4.541ED1C2@control.auc.dk>
  References: <3BFBAFA4.541ED1C2@control.auc.dk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox