Sebastian Meyer <meyer(at)mevis(dot)de> writes:
> On Wed, 16 Sep 1998, Torsten Neuer wrote:
>> Clint wrote:
>>>> I think you're right, Tom. If I run the program on my Linux box as a
>>>> different user, I get the same error. Now, how do I set the username
>>>> from C/C++?? I can't figure it out from the docs ...
> Its in http://www.PostgreSQL.ORG/docs/postgres/libpq9374.htm
> Read the section on "PQsetdbLogin - Makes a new connection to a backend"
Ah, but Clint's real problem is that he's not calling libpq directly,
but via libpq++. And as far as I can see, libpq++ doesn't have any way
to open a connection except by calling plain old PQsetdb. This needs to
be fixed. (We should add an entry point to libpq++ that corresponds to
PQconnectdb, so that the connection parameters are passed through as a
single string and libpq++ doesn't have to know about each and every one
The short-term workaround is what you mention next:
> It's so easy... If you should want to set environment variables anyway:
> environ(5), getenv(3) and putenv(3) tell you how.
Setting PGUSER (and PGPASSWORD if needed) env. variables will provide a
way to pass these items to libpq despite the lack of any cooperation
regards, tom lane
pgsql-interfaces by date
|Next:||From: Thomas G. Lockhart||Date: 1998-09-16 16:05:46|
|Subject: Re: Integrated Source|
|Previous:||From: Life||Date: 1998-09-16 13:45:39|