pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tuðberk Kara <tugberkkara@gmail.com>
To: pgsql-interfaces@postgresql.org
Subject: connection problem
Date: Mon, 31 Jul 2006 10:18:18 +0300
Message-ID: <beadb2f80607310018s172bc4bm3b45add868b1c58f@mail.gmail.com> (raw)

I have a postgresql installed on a remote machine. I want to connect to it
with libpq but the connection is not successful.
I have this piece of code for connection in my c file:

PGconn *conn=NULL;
char  *conn_str="hostaddr=172.16.11.2 port=5432 dbname=postgres
user=postgres password=654321 reqiressl=0";
conn=PGconnectStart(conn_str);
if(PGstatus(conn)=CONNECTION_BAD){

  PGerrorMessage(conn);
}
else{

printf("connected");

}

But I can not connect. It exits from the program. I tried also PGconnectdb
but it also did not connect to the databse. But I can connect to it thorough
pgAdmin with the same credentials. Can you help me please urgently!'!!!

view thread (3+ messages)  latest in thread

Message-ID: <beadb2f80607310018s172bc4bm3b45add868b1c58f@mail.gmail.com>
Permalink:  ../beadb2f80607310018s172bc4bm3b45add868b1c58f@mail.gmail.com/
Also on:    postgresql.org/message-id/beadb2f80607310018s172bc4bm3b45add868b1c58f@mail.gmail.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tugberkkara@gmail.com
  Subject: Re: connection problem
  In-Reply-To: <beadb2f80607310018s172bc4bm3b45add868b1c58f@mail.gmail.com>

* 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