Re: connection problem - Mailing list pgsql-interfaces

From Volkan YAZICI
Subject Re: connection problem
Date
Msg-id 20060801060252.GA1323@alamut.tdm.local
Whole thread Raw
In response to connection problem  ("Tuğberk Kara" <tugberkkara@gmail.com>)
List pgsql-interfaces
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.


pgsql-interfaces by date:

Previous
From: Andy Shellam
Date:
Subject: Re: connection problem
Next
From: Joachim Wieland
Date:
Subject: Re: Using FETCH ALL with descriptor areas