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

Re: [GENERAL] libq++ and security help

From: Peter Mount <pgsqlgen(at)retep(dot)org(dot)uk>
To: Bruce Tong <zztong(at)laxmi(dot)ev(dot)net>
Cc: Monica Rogati <mrogati(at)unm(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] libq++ and security help
Date: 1998-06-16 05:50:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Mon, 15 Jun 1998, Bruce Tong wrote:

> > 	I'm using libq++ for a C++ frontend; the problem is I need to have 
> > many users who don't have accounts on the server. I tried to find 
> > information on connecting to the database specifying the username and 
> > password, but it looks like the libq++ functions rely on the environment 
> > variables. 
> This seems to be the same for LIBPQ. (The non-C++ version of the library.)
> Thus, I'm curious what the answer is in this case as well.

I'm not sure about libq++, but for libpq, you can do this by using
PQconnectdb(). The easiest way, is to look at the source to psql, which
uses libpq itself.

PGconn *db = PQconnectdb("host=myhost user=myuser password=mypassword port=myport");

Peter T Mount peter(at)retep(dot)org(dot)uk or petermount(at)earthling(dot)net
Main Homepage:
************ Someday I may rebuild this signature completely ;-) ************
Work Homepage: Work EMail: peter(at)maidstone(dot)gov(dot)uk


pgsql-general by date

Next:From: Jose' Soares Da SilvaDate: 1998-06-16 11:18:16
Subject: Re: [HACKERS] pg_dump error
Previous:From: Bruce MomjianDate: 1998-06-16 03:19:07
Subject: Re: [HACKERS] pg_dump error

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group