Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YnW4e-0003o1-0I for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Apr 2015 17:47:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YnW4c-0008F2-Dg for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Apr 2015 17:47:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YnTcN-0002vS-80 for pgsql-bugs@postgresql.org; Wed, 29 Apr 2015 15:09:43 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YnTcG-0006u4-Aa for pgsql-bugs@postgresql.org; Wed, 29 Apr 2015 15:09:42 +0000 Received: by pacwv17 with SMTP id wv17so30494800pac.0 for ; Wed, 29 Apr 2015 08:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=SySPFqKJlId8FHybz4YHRNg9uzW3yRrGl7SdC1crd0M=; b=YDkCehYESO04dj8sdnMf4rDINmbxTS9GEfXeS+Sl5S+Qvmf7fPd9dgKYXb7r/NzDJX y4dZqOco5tiBFBEdbjodYQ8JJqqIvl1qLNuai0IG0u9RmUFpf5w5NT+pilB3Brh1cMth eMiuW/1rEhp0FpPKbHC/ShP1l3fyiuIoWsxVaMcngMjwcDDoO25MAP8QR8SofgJYfE// zXxXeSgvBpn4vHYoDq7+S+/e9XkM6W5JeaSpR6R2RlhcZgnotp5Q/lj53y0GpAshq/X3 kJ6PoF3PlG1Lii8OBWENkcNBYlwrpcZqbhDQ0c6fL/+NEjl68lWDoQb3n237ohSARqtS Z7Aw== X-Received: by 10.70.95.131 with SMTP id dk3mr43283233pdb.44.1430320174280; Wed, 29 Apr 2015 08:09:34 -0700 (PDT) Received: from [192.168.1.12] (198-48-196-219.cpe.pppoe.ca. [198.48.196.219]) by mx.google.com with ESMTPSA id o3sm18195416pds.1.2015.04.29.08.09.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 08:09:33 -0700 (PDT) Message-ID: <5540F428.8000605@gmail.com> Date: Wed, 29 Apr 2015 11:09:28 -0400 From: "bzb.dev001@gmail.com" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "David G. Johnston" CC: "pgsql-bugs@postgresql.org" Subject: Re: BUG #13188: .pgpass does not work References: <20150428181007.2546.64960@wrigleys.postgresql.org> In-Reply-To: Content-Type: multipart/alternative; boundary="------------070602000103000106080709" X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is a multi-part message in MIME format. --------------070602000103000106080709 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 2015-04-29 01:06 AM, David G. Johnston wrote: > On Tuesday, April 28, 2015, > wrote: > > The following bug has been logged on the website: > > Bug reference: 13188 > Logged by: wt > Email address: bzb.dev001@gmail.com > PostgreSQL version: 9.4.1 > Operating system: linux > Description: > > Tried to use ~/.pgpass file to automatically specify the password > when I use > the psql console app. according to the info from "PostgreSQL 9.4.0 > Documentation", Section 31.15. The Password File. > > Postgresql is configured to use md5 for login. > > > file: pg_hba.conf > ----------------- > local all all md5 > host all all 127.0.0.1/32 > md5 > host all all ::1/128 md5 > > > file: ~/.pgpass > --------------- > #hostname : port : database : username : password > * : 5432 : * : postgres : somepassword > > > When I exec psql without specifying the password, I cannot login... > > $ psql --host=localhost --port=5432 --username=postgres --no-password > psql: fe_sendauth: no password supplied > > > > Best guess you don't have the correct permissions set. > > http://www.postgresql.org/docs/devel/static/libpq-pgpass.html > > Last paragraph. > > I would also remove the padding white space. The syntax is documented > without and while the documentation is non-specific I've personally > always avoided it and have never had a problem. > > David J. The permission settings for .pgpass is correct. I have even changed the ownership of the file to postgres:postgres since I'm logged on as another user and .pgpass is located in this user's home directory. Yet it still does not work. $ ls -l .pgpass -rw------- 1 postgres postgres 79 Apr 29 10:24 .pgpass $ psql --host=localhost --port=5432 --username=postgres --no-password psql: fe_sendauth: no password supplied --------------070602000103000106080709 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 2015-04-29 01:06 AM, David G. Johnston wrote:
On Tuesday, April 28, 2015, <bzb.dev001@gmail.com> wrote:
The following bug has been logged on the website:

Bug reference:      13188
Logged by:          wt
Email address:      bzb.dev001@gmail.com
PostgreSQL version: 9.4.1
Operating system:   linux
Description:

Tried to use ~/.pgpass file to automatically specify the password when I use
the psql console app. according to the info from "PostgreSQL 9.4.0
Documentation", Section 31.15. The Password File.

Postgresql is configured to use md5 for login.


file: pg_hba.conf
-----------------
local   all             all                                     md5
host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5


file: ~/.pgpass
---------------
#hostname : port : database : username : password
* : 5432 : * : postgres : somepassword


When I exec psql without specifying the password, I cannot login...

$ psql --host=localhost --port=5432 --username=postgres --no-password
psql: fe_sendauth: no password supplied



Best guess you don't have the correct permissions set.


Last paragraph.

I would also remove the padding white space.  The syntax is documented without and while the documentation is non-specific I've personally always avoided it and have never had a problem.

David J.

The permission settings for .pgpass is correct.  I have even changed the ownership of the file to postgres:postgres since I'm logged on as another user and .pgpass is located in this user's home directory. Yet it still does not work.

$ ls -l .pgpass
-rw------- 1 postgres postgres 79 Apr 29 10:24 .pgpass

$ psql  --host=localhost --port=5432 --username=postgres --no-password
psql: fe_sendauth: no password supplied
--------------070602000103000106080709--