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 LAA22297 for ; Sat, 15 Aug 1998 11:00:34 -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 LAA10032; Sat, 15 Aug 1998 11:00:24 -0400 (EDT) To: secret cc: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] C API - Authentication Question In-reply-to: Your message of Fri, 14 Aug 1998 22:43:36 -0400 <35D4F5D8.A1A06901@kearneydev.com> Date: Sat, 15 Aug 1998 11:00:24 -0400 Message-ID: <10030.903193224@sss.pgh.pa.us> From: Tom Lane secret writes: > ... How do I tell PostgreSQL what > username:password to use to authenticate myself to the database? PQsetdbLogin() or PQconnectdb(). Alternatively you can pass them in as values of environment variables PGUSER and PGPASSWORD. I don't much like keeping a password in an environment variable on security grounds, but this would work if you want to use some client program that offers no convenient way to enter id/password. It looks like the documentation is seriously lacking in this area: the current libpq man page doesn't describe PQconnectdb() at all, and the possibility to pass in a password via PGPASSWORD isn't mentioned there either. You'll get along with PostgreSQL a lot better if you don't mind looking at code when you can't find something in the docs :-( BTW you should also consider Kerberos authentication --- much more secure than passing cleartext or trivially-encrypted passwords around the net. regards, tom lane