pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Volkan YAZICI <yazicivo@ttnet.net.tr>
To: Tuğberk Kara <tugberkkara@gmail.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: connection problem
Date: Tue, 1 Aug 2006 09:02:52 +0300
Message-ID: <20060801060252.GA1323@alamut.tdm.local> (raw)
In-Reply-To: <beadb2f80607310018s172bc4bm3b45add868b1c58f@mail.gmail.com>
References: <beadb2f80607310018s172bc4bm3b45add868b1c58f@mail.gmail.com>

On Jul 31 10:18, Tuğberk Kara wrote:
> 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");
> 
> }

You're using totally wrong functions. There's even doesn't exist a
function called PGconnectStart().

First of all, I'd suggest you to either reading libpq manual[1] in the
PostgreSQL documentation or "PostgreSQL ile Programlama"[2] (in Turkish)
book's C API related section.

[1] www.postgresql.org/docs/current/interactive/libpq.html
[2] http://www.students.itu.edu.tr/~yazicivo/doc/postgresql-ile-programlama-20060214.pdf


Regards.



view thread (3+ messages)

Message-ID: <20060801060252.GA1323@alamut.tdm.local>
Permalink:  ../20060801060252.GA1323@alamut.tdm.local/
Also on:    postgresql.org/message-id/20060801060252.GA1323@alamut.tdm.local

 · 

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: yazicivo@ttnet.net.tr, tugberkkara@gmail.com
  Subject: Re: connection problem
  In-Reply-To: <20060801060252.GA1323@alamut.tdm.local>

* 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