Re: Pgagent is not reading pgpass file either in Windows or Linux. - Mailing list pgsql-general

From George Neuner
Subject Re: Pgagent is not reading pgpass file either in Windows or Linux.
Date
Msg-id e4c0hdhkoflpsfvqdbel5q4ouh3lnuvme3@4ax.com
Whole thread Raw
In response to Pgagent is not reading pgpass file either in Windows or Linux.  (nageswara Bandla <nag.bandla@gmail.com>)
Responses Re: Pgagent is not reading pgpass file either in Windows or Linux.
List pgsql-general
On Thu, 31 May 2018 11:24:18 -0500, nageswara Bandla
<nag.bandla@gmail.com> wrote:

>On Wed, May 30, 2018 at 7:45 PM, George Neuner <gneuner2@comcast.net> wrote:
>
>> 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.
>>
>
>
>I am setting the PGPASSFILE in system environment variables. I am not
>setting it in user specific environmental variables.


It just occurred to me that you said PGPASSFILE was set to

    %APPDATA%/postgresql/pgpass.conf


The problem may be that when LocalSystem expands %APPDATA%, it is
finding its own directory, which might be any of:

   C:\Windows\ServiceProfiles\LocalService\appdata
   C:\Windows\System32\config\systemprofile\AppData 
   C:\Windows\SysWOW64\config\systemprofile\AppData

depending on your Windows version, policies (if any), and whether the
executable is 32 or 64 bit.


I wouldn't try messing with any of these directories. Instead try
setting PGPASSFILE to the full path to your file.


George



pgsql-general by date:

Previous
From: Federico Di Gregorio
Date:
Subject: R: Re: License Question
Next
From: "Ian Bell"
Date:
Subject: unable to write 'raise' messages to log file?