Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: connection problem



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.



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group