Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YnZsL-0007ft-EW for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Apr 2015 21:50:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YnZsK-0003rL-FC for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Apr 2015 21:50:36 +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 1YnYp3-0000cc-Sk for pgsql-bugs@postgresql.org; Wed, 29 Apr 2015 20:43:10 +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 1YnYox-0005AZ-23 for pgsql-bugs@postgresql.org; Wed, 29 Apr 2015 20:43:08 +0000 Received: by pabtp1 with SMTP id tp1so38069640pab.2 for ; Wed, 29 Apr 2015 13:43:01 -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=plgUGIjJrr+6zssOBgJNdrnDd+nLjQfwSyaX4rbjE4Y=; b=r8PhZ8CSJ+uqtMXnubjBFN+8lnxIhyJT3VHE62idqRlSs4UXosBkrqwY14FORbMv26 MOshlyR5+g+w4LQDiszW3FTRmP2RT4CmIigYp5S+pqD8OIn6jwnPk3D9Zhnf+vw9F71e uOIAdgdBNluJ9NQgS4e9tp2aFt1uTk1q5ZrXcB91+c+L2Q1+ISmMMXWs+9hjv6vNmtGx FipD2s7sHitSY5vpbumzmUSs7r5UAGQLc1V/xQ/So0QE04ZVzxQl20/b9jSBTauAFAQ9 W4NwBZQIxYxDWBzyeWXfF0up2r0Y0fTULVLR+T1Lex1J7D+fJynuFXOqONsQD+++0lni ETHQ== X-Received: by 10.67.1.98 with SMTP id bf2mr1654316pad.33.1430340181637; Wed, 29 Apr 2015 13:43:01 -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 ae9sm82297pac.25.2015.04.29.13.42.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 13:43:01 -0700 (PDT) Message-ID: <55414251.90205@gmail.com> Date: Wed, 29 Apr 2015 16:42:57 -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> <5540F428.8000605@gmail.com> <554121A9.3050207@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------030302060908070901070905" 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. --------------030302060908070901070905 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 2015-04-29 03:32 PM, David G. Johnston wrote: > On Wed, Apr 29, 2015 at 11:23 AM, bzb.dev001@gmail.com > >wrote: > > On 2015-04-29 12:04 PM, David G. Johnston wrote: >> >> On Wed, Apr 29, 2015 at 8:09 AM, bzb.dev001@gmail.com >> > > wrote: >> 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 >> >> >> ​ Sorry, I missed this the first time reading. This is your >> problem. The "postgres" Linux user and the "postgres" PostgreSQL >> user are not related to each other - particularly when using md5 >> authentication. The permissions on the .pgpass file must be of >> the user executing "psql" - which you've indicated is not "postgres". >> >> So, likely your first attempt failed because you had whitespace. >> You changed the permissions and now have two problems. You then >> fix the whitespace and are back to a single problem. Change the >> permissions back and it should now work. >> > 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 > > Incidentally, the postgresql server is running as 'postgres' user. > > > ​I am out of ideas. I am not currently running 9.4.x but if the > problem was a bug within PostgreSQL there would be more than a single > report. > > David J. No problem. Thanks for you help. --------------030302060908070901070905 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 2015-04-29 03:32 PM, David G. Johnston wrote:
On Wed, Apr 29, 2015 at 11:23 AM, bzb.dev001@gmail.com <bzb.dev001@gmail.com> wrote:
On 2015-04-29 12:04 PM, David G. Johnston wrote:

On Wed, Apr 29, 2015 at 8:09 AM, bzb.dev001@gmail.com <bzb.dev001@gmail.com> wrote:
 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

​ Sorry, I missed this the first time reading.  This is your problem.  The "postgres" Linux user and the "postgres" PostgreSQL user are not related to each other - particularly when using md5 authentication.  The permissions on the .pgpass file must be of the user executing "psql" - which you've indicated is not "postgres".

So, likely your first attempt failed because you had whitespace.  You changed the permissions and now have two problems.  You then fix the whitespace and are back to a single problem.  Change the permissions back and it should now work.

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

Incidentally, the postgresql server is running as 'postgres' user.


​I am out of ideas.  I am not currently running 9.4.x but if the problem was a bug within PostgreSQL there would be more than a single report.

David J.

No problem.
Thanks for you help.
--------------030302060908070901070905--