On PostgreSQL 11 running on Windows 2012 server, I created a job with pgagent and pgAdmin4.
In the step, in connection string I used the password parameter and it works.
Instead, I would like to use passfile parameter with a pgpass.conf, located in C:\Users\POSTGIS\AppData\Roaming\postgresql\according to the doc
I tried many ways ton write the passfile unsuccessfully. For example I wrote :

host=localhost port=5432 user=POSTGIS passfile=C:\\Users\\POSTGIS\\AppData\\Roaming\\postgresql\\pgpass.conf dbname=xxxx

...with single or double backslashs or slashs.
But I always have a Please enter a valid connection string message.
I am out of ideas.

  • 2
    If you are running as the user 'POSTGIS', then you shouldn't need to specify the path to the file, it should pick it up automatically. If you are not running as the user POSTGIS, then you probably do not have access to that file. – jjanes Mar 14 '19 at 16:57
  • Found it. Indeed no need to use passfile...when pgpass.conf has the correct parameters as well so to speak POSTGIS entrance. – Leehan Mar 14 '19 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.