pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
About connecting to a database
2+ messages / 2 participants
[nested] [flat]

* About connecting to a database
@ 1998-08-04 14:00 Mariano Herrero <mariano@uni-paderborn.de>
  1998-08-04 14:56 ` Re: [INTERFACES] About connecting to a database Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Mariano Herrero @ 1998-08-04 14:00 UTC (permalink / raw)
  To: pgsql-interfaces

Hello everybody,

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!

and the application can't connect to the database.


Could anyone say me what the reason can be ? Thanks in advance !!

Regards,

	Mariano

 -------------------------------------------------------------------
 Mariano Herrero                   office: F2.315
 University of  Paderborn          voice:  +49 5251 60-6693
 Dept. of Computer Science         fax:    +49 5251 60-6697
 Fuerstenallee 11                  mailto:mariano@uni-paderborn.de
 33102 Paderborn, Germany         
 
 http://www.uni-paderborn.de/fachbereich/AG/monien/PERSONAL/MARIANO/
 -------------------------------------------------------------------



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [INTERFACES] About connecting to a database
  1998-08-04 14:00 About connecting to a database Mariano Herrero <mariano@uni-paderborn.de>
@ 1998-08-04 14:56 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 1998-08-04 14:56 UTC (permalink / raw)
  To: Mariano Herrero <mariano@uni-paderborn.de>; +Cc: pgsql-interfaces

Mariano Herrero <mariano@uni-paderborn.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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1998-08-04 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-08-04 14:00 About connecting to a database Mariano Herrero <mariano@uni-paderborn.de>
1998-08-04 14:56 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox