Re: PQconnectdb question

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: pgsql-interfaces(at)postgresql(dot)org, valval(at)porta(dot)net
Subject: Re: PQconnectdb question
Date: 2003-09-15 13:54:14
Message-ID: 3F65C486.51EF6AF0@rodos.fzk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

>
> could somebody show me a little example on this function
> i have this parameters
> PQconn connection;
> char *user;
> char *passw;
> char *db;
> char *server;
> char *port;
>
> user="chrisvv";
> passw="mypass";
> db="sales";
> server="192.168.1.1";
> port="5432";
> is it right to do as follows
> connection=PQconnectdb(user,passw,db,server,port);
> .... how is the correct form of making a conection with user and
passwd
> parameters?
>
>
connection=
PQconnectdb("user=chrisvv password=mypass dbname=sales
hostaddr=192.168.1.1 port=5432");

should work.
You may want to refer to
$PGSQLD/doc/html/libpq-connect.html

Regards, Christoph

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2003-09-15 14:48:47 Re: ColumnName and ColumnNumber in libpq (C interface)
Previous Message Lester Godwin 2003-09-15 12:21:23 remove