Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YnZtm-0007hp-L6 for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Apr 2015 21:52:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YnZtm-0005mY-5E for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Apr 2015 21:52:06 +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 1YnZhi-0002xU-HM for pgsql-bugs@postgresql.org; Wed, 29 Apr 2015 21:39:38 +0000 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YnZhg-0006Ff-5t for pgsql-bugs@postgresql.org; Wed, 29 Apr 2015 21:39:37 +0000 Received: by pabsx10 with SMTP id sx10so39216761pab.3 for ; Wed, 29 Apr 2015 14:39: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=n9hATWMeQ6w1FYz25a26IBAzowBrD/rS4AXL16lOYQM=; b=JE835l3as/Fj5sVX0Oybtmby7nPTyAAWWyFjop+zAN42iZfhEHDjJUycwDD7g+2haY tdBgHUD0CQn0d0W5+AssxSrrr5g3wKL3AapMtDS6BeUrDAccamH+pg3wXdQ1nubSecae FNcn+ssXRqRNMsay3OpL/g6Jd/wFw0i1+1EascEVrIjjTScVFzFf0hzy6u4aURs+I6Cl YPYjW7T81QRVz4za5aHNlWaLOj1UJy2wc6LSat3P397qWwwOc5mNHyxKcHlKf+jj/LHK i8d7Ss3F9Ft40RccvCfvExw9vhT1laHMGIHXchakVDm7mSZUtTpydJ2nIIGC07YOxi4z V3TA== X-Received: by 10.66.55.98 with SMTP id r2mr2129120pap.22.1430343574571; Wed, 29 Apr 2015 14:39: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 i16sm134192pbq.79.2015.04.29.14.39.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 14:39:34 -0700 (PDT) Message-ID: <55414F92.5030901@gmail.com> Date: Wed, 29 Apr 2015 17:39:30 -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: Jeff Janes CC: "David G. Johnston" , "pgsql-bugs@postgresql.org" Subject: Re: BUG #13188: .pgpass does not work References: <20150428181007.2546.64960@wrigleys.postgresql.org> <5540F428.8000605@gmail.com> <554121A9.3050207@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------030205040800000909080408" 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. --------------030205040800000909080408 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 2015-04-29 04:41 PM, Jeff Janes wrote: > On Wed, Apr 29, 2015 at 11:23 AM, bzb.dev001@gmail.com > > wrote: > >> > I've changed back the owner of .pgpass to the account that I've > logged in as. This is the account that I'm using to run psql. > All the spaces in .pgpass is removed. > Checked that the permission settings of .pgpass is ok. > restarted the server... > > $ sudo service postgresql restart > > Unfortunately, it is still not working. > > $ psql --host=localhost --port=5432 --username=postgres --no-password > psql: fe_sendauth: no password supplied > > > I wonder if it is even finding the file in the first place. > > strace psql --host=localhost --port=5432 --username=postgres > --no-password 2>&1 | fgrep pgpass > > This is what I get: > > stat("/home/jjanes/.pgpass", {st_mode=S_IFREG|0600, st_size=196, ...}) = 0 > open("/home/jjanes/.pgpass", O_RDONLY) = 3 > > For me it found the file and opened it successfully. > > Cheers, > > Jeff I finally figured out why it didn't work. the port# specified in my .pgpass was incorrect. My stupidity. Thanks to all for the help. --------------030205040800000909080408 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 2015-04-29 04:41 PM, Jeff Janes wrote:
On Wed, Apr 29, 2015 at 11:23 AM, bzb.dev001@gmail.com <bzb.dev001@gmail.com> wrote:

I've changed back the owner of .pgpass to the account that I've logged in as.  This is the account that I'm using to run psql.
All the spaces in .pgpass is removed.
Checked that the permission settings of .pgpass is ok.
restarted the server...

$ sudo service postgresql restart

Unfortunately, it is still not working.

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


I wonder if it is even finding the file in the first place.

strace psql  --host=localhost --port=5432 --username=postgres --no-password 2>&1 | fgrep pgpass

This is what I get:

stat("/home/jjanes/.pgpass", {st_mode=S_IFREG|0600, st_size=196, ...}) = 0
open("/home/jjanes/.pgpass", O_RDONLY)  = 3

For me it found the file and opened it successfully.

Cheers,

Jeff

I finally figured out why it didn't work. the port# specified in my .pgpass was incorrect.
My stupidity.
Thanks to all for the help.
--------------030205040800000909080408--