Re: .pgpass being ignored

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Rebecca Clarke <r(dot)clarke83(at)gmail(dot)com>
Cc: Ziggy Skalski <zskalski(at)afilias(dot)info>, pgsql-general(at)postgresql(dot)org
Subject: Re: .pgpass being ignored
Date: 2013-06-24 15:03:02
Message-ID: 51C85FA6.4080004@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/24/13 10:24, Rebecca Clarke wrote:
> I could be wrong, but shouldn't the owner of .pgpass be postgres?

The owner of ~/.pgpass is whoever owns ~ (the home directory of that user).

And ~/.pgpass must have permissions 0600 in order for libpq to actually
use it.

Jan

>
>
> On Mon, Jun 24, 2013 at 3:17 PM, Ziggy Skalski <zskalski(at)afilias(dot)info
> <mailto:zskalski(at)afilias(dot)info>> wrote:
>
> On 13-06-21 06:19 PM, Stephen Rasku wrote:
>
> I am trying to write a script that will create and populate a
> database. I don't want to enter a password every time so I want to
> use a .pgpass file. It has the correct permissions:
>
> $ ls -l $PGPASSFILE
> -rw------- 1 Stephen staff 43 21 Jun 14:48
> /Users/Stephen/.pgpass
>
> However, when I call createdb, it fails:
>
> $ createdb -h 192.168.1.4 -U postgres --no-password JobSearch
> createdb: could not connect to database postgres:
> fe_sendauth: no
> password supplied
>
> This is the contents of my .pgpass file:
>
>
> 192.168.1.4:5432:DatabaseName:__postgres:__thisIsTheCorrectPassword
>
> If I omit the --no-password option it will prompt me for a password
> and the command will succeed. I am using 9.0.10 from MacPorts.
>
> What am I doing wrong?
>
> ...Stephen
>
>
>
> Hi,
>
> Just going from a personal experience, have you tried to open the
> .pgpass file in vi and made sure there's no trailing spaces in your
> pgpass entry? That bit me once before :)
>
> Ziggy
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org
> <mailto:pgsql-general(at)postgresql(dot)org>)
> To make changes to your subscription:
> http://www.postgresql.org/__mailpref/pgsql-general
> <http://www.postgresql.org/mailpref/pgsql-general>
>
>

--
Anyone who trades liberty for security deserves neither
liberty nor security. -- Benjamin Franklin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2013-06-24 15:15:16 Re: Re: Index scan and bitmap index scan - hard to understand how planner chooses
Previous Message David Johnston 2013-06-24 14:44:00 Re: postgresql query