From: George Neuner <gneuner2@comcast.net>
To: pgsql-general@postgresql.org
Subject: Re: Pgagent is not reading pgpass file either in Windows or Linux.
Date: Wed, 30 May 2018 20:45:27 -0400
Message-ID: <ppfugdp0kau1a9178injuk52b0eqg29i3o@4ax.com> (raw)
References: <CADJadRDCoHALsJQv8ySQiO2QdgWnfqVL+iX-v72QxA6pFtgYtg@mail.gmail.com>
<5595335e-32e8-80da-9c65-8d79fce554a7@aklaver.com>
On Tue, 29 May 2018 13:32:46 -0700, Adrian Klaver
<adrian.klaver@aklaver.com> wrote:
>On 05/29/2018 12:14 PM, nageswara Bandla wrote:
>
>> As per the link-
>> (https://www.postgresql.org/docs/9.6/static/libpq-pgpass.html) I set
>> PGPASSFILE environment variable to point to pgpass.conf location. Even
>> then, it’s throwing same above error message. I have found out that
>> pgagent is not reading pgpass.conf file when configured under
>> LocalSystem account.
>>
>> When I change the properties of the pgagent service to run under my
>> login user account. Then, it’s reading pgpass.conf file under
>> %APPDATA%/postgresql/pgpass.conf.
>>
>> I am clueless, why pgagent is not honoring PGPASSFILE env variable.
>
>My guess because the LocalSystem user does not have permissions on your:
>
>%APPDATA%/postgresql/pgpass.conf
>
>file. This seems to be confirmed by it working when you run pgagent as
>the login user.
LocalSystem has administrator permissions to virtually everything.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684190(v=vs.85).aspx
It should be able to read files belonging to any user.
But the LocalSystem account can see only *global* environment
variables ... it can't see any user specific ones. I would check if
the PGPASSFILE variable is set globally or only in the user account.
I don't know anything specifically about running pgagent on Windows,
so I can't say why it is giving an error if the docs say it should
not.
George
>passfile
>
> Specifies the name of the file used to store passwords (see Section
>33.15). Defaults to ~/.pgpass, or %APPDATA%\postgresql\pgpass.conf on
>Microsoft Windows. (No error is reported if this file does not exist.)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: gneuner2@comcast.net
Subject: Re: Pgagent is not reading pgpass file either in Windows or Linux.
In-Reply-To: <ppfugdp0kau1a9178injuk52b0eqg29i3o@4ax.com>
References: <CADJadRDCoHALsJQv8ySQiO2QdgWnfqVL+iX-v72QxA6pFtgYtg@mail.gmail.com> <5595335e-32e8-80da-9c65-8d79fce554a7@aklaver.com> <ppfugdp0kau1a9178injuk52b0eqg29i3o@4ax.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox