That gave me the impression that the library that handles the connection string is shared between postgresql and pgagent.
So my question is wether or not the use of pg_service.conf is somewhere on the roadmap of pgagent and, if not, it can be put on the roadmap. This would save the trouble of having to maintain 2 files with the same information.
It does use the same library to handle the connection, but pgAgent also needs to be able to parse and modify the connection string itself, for example, to connect to different databases. I don't think it would be feasible to use pg_service.conf, as pgAgent wouldn't be able to tell how to connect to a different database on the same server, unless we also add the ability for it to read and parse the pg_service.conf file itself.