Re: connection problem

From: Andy Shellam <andy(at)andycc(dot)net>
To: Tuğberk Kara <tugberkkara(at)gmail(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: connection problem
Date: 2006-07-31 16:16:11
Message-ID: 44CE2CCB.10401@andycc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Try "host=172.16.11.2" at the start of your connection string. I
believe the parameter is "host" not "hostaddr".

Andy.

Tuğberk Kara wrote:
> 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 <http://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!'!!!
>
>
>
> !DSPAM:14,44ce2c59143296589895338!

--
Andy Shellam <mailto:andy(dot)shellam(at)mailnetwork(dot)co(dot)uk>,
the Mail Network <http://www.mailnetwork.co.uk/>

NetServe Support - we don't go the extra mile; we go the whole distance!

p: (+44) 0 845 838 0879 / +44 0 7818 000834
w: www.mailnetwork.co.uk <http://www.mailnetwork.co.uk/>
e: support(at)mailnetwork(dot)co(dot)uk <mailto:support(at)mailnetwork(dot)co(dot)uk>

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Volkan YAZICI 2006-08-01 06:02:52 Re: connection problem
Previous Message Michael Fuhr 2006-07-31 13:29:54 Re: SPI_getvalue fails