Re: [INTERFACES] About connecting to a database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mariano Herrero <mariano(at)uni-paderborn(dot)de>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] About connecting to a database
Date: 1998-08-04 14:56:04
Message-ID: 29362.902242564@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Mariano Herrero <mariano(at)uni-paderborn(dot)de> writes:
> I have the following problem. When I execute my application to query a
> PostgresSQL database, the PGsetdb function gives me the following error:
> FATAL: PQsetdb: Unable to determine a Postgres username!

libpq looks for an environment variable PGUSER. If that's not found,
it either tries Kerberos (if compiled to use Kerberos) or tries
getpwuid(geteuid());
to get your userID from the Unix system.

Perhaps you have a malfunctioning Kerberos environment?
Or maybe getpwuid is failing, but that ought to have stopped you
from even logging in...

Anyway, you can override all this by setting PGUSER, or by calling
PQsetdbLogin so you can pass an explicit username. But it might
be better to figure out why plain PQsetdb isn't working.

regards, tom lane

Browse pgsql-interfaces by date

  From Date Subject
Next Message Sergey V. Kryaczevskih 1998-08-04 15:35:05 How translate KOI-8 to Win1251 whith PsqlODBC
Previous Message Mariano Herrero 1998-08-04 14:00:56 About connecting to a database