Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BA19F475DDC for ; Sun, 29 Dec 2002 21:44:50 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id DBCC2475BF9 for ; Sun, 29 Dec 2002 21:44:47 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id C43A743A911; Sun, 29 Dec 2002 21:44:47 -0500 (EST) From: ljb X-Newsgroups: comp.databases.postgresql.interfaces Subject: Shouldn't .pgpass work with anything which uses libpq? Date: Mon, 30 Dec 2002 02:44:47 +0000 (UTC) Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 12 Message-ID: X-Complaints-To: usenet@news.hub.org X-No-Archive: yes User-Agent: slrn/0.9.7.3 (Linux) To: pgsql-interfaces@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/79 X-Sequence-Number: 3492 (Using PostgreSQL-7.3.1) I noticed that the new ~/.pgpass password file works with psql but not with my pgtclsh scripts, and I'm wondering: shouldn't it work with anything built on top of libpq? Digging into it a bit, I think no conninfo-based connection method will use .pgpass, including libpq PQconnectDB() and libpgtcl "pg_connect -conninfo". I think it is happening because .pgpass is only read if the password argument to PQsetdbLogin() is NULL. But if no password is supplied in a conninfo string, then "DefaultPassword" is used - this is an empty string, not NULL. Am I right? Is this behavior wrong?