Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [206.210.65.6]) by hub.org (8.8.8/8.7.5) with ESMTP id KAA15365 for ; Tue, 4 Aug 1998 10:56:26 -0400 (EDT) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id KAA29364; Tue, 4 Aug 1998 10:56:04 -0400 (EDT) To: Mariano Herrero cc: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] About connecting to a database In-reply-to: Your message of Tue, 04 Aug 1998 16:00:56 +0200 <35C71418.BB5F356@uni-paderborn.de> Date: Tue, 04 Aug 1998 10:56:04 -0400 Message-ID: <29362.902242564@sss.pgh.pa.us> From: Tom Lane Mariano Herrero 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