Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 5838347545C for ; Wed, 21 Aug 2002 12:59:26 -0400 (EDT) Received: from usmailrelay.beasys.com (unknown [63.96.163.34]) by postgresql.org (Postfix) with ESMTP id 901EF474E4E for ; Wed, 21 Aug 2002 12:59:25 -0400 (EDT) Received: from boulder.beasys.com (boulder.bea.com [10.36.32.10]) by usmailrelay.beasys.com (Switch-2.2.2/Switch-2.2.0) with ESMTP id g7LGxJB03286 for ; Wed, 21 Aug 2002 09:59:20 -0700 (PDT) Received: from xigole.com ([10.36.35.132]) by boulder.beasys.com (8.9.3+Sun/8.9.1) with ESMTP id KAA18606 for ; Wed, 21 Aug 2002 10:59:35 -0600 (MDT) Message-ID: <3D63C6E7.2030106@xigole.com> Date: Wed, 21 Aug 2002 10:59:19 -0600 From: Scott Dunbar Organization: Xigole Systems, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1b) Gecko/20020721 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Newbie confused about pg_hba/md5 and password field in PQsetdbLogin Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/61 X-Sequence-Number: 3023 Hello, I'm pretty new to PostgreSQL in general and even newer to libpq. I am trying to get a C program working (the authpgsql module in courier-imap) that uses PQsetdbLogin(). I've got 7.2.1 installed and running and have had no problem accessing it via JDBC. I have encrypted passwords in pg_shadow and have "md5" set for the AUTH_TYPE in pg_hba.conf. However, when using PQsetdbLogin the only way I could get a login to work was to use unencrypted passwords in pg_shadow and change pg_hba.conf to use "password" instead of "md5" for the database I want access to through authpgsql. Why is this? Do I somehow have to md5 the clear text password before calling PQsetdbLogin()? Does PQconnectdb() handle this and I should update the code? I feel that the client code should be unaware of the over the wire encryption method used and the encryption method of the password in pg_shadow but I may be way off base on the underlying issue. Thanks in advance for any information.