Re: pgagent and pg_service.conf - Mailing list pgadmin-support

From Dave Page
Subject Re: pgagent and pg_service.conf
Date
Msg-id CA+OCxozGYRqOP-0dr-GPDQn5KRAMA6LwNKUkGxP30Qq+wJABwA@mail.gmail.com
Whole thread Raw
In response to pgagent and pg_service.conf  (Dirk-Jan Faber <dfaber@gmail.com>)
Responses Re: pgagent and pg_service.conf
List pgadmin-support


On Tue, Dec 16, 2014 at 10:17 AM, Dirk-Jan Faber <dfaber@gmail.com> wrote:
Hello,

I am just starting with pgagent. First thing I noticed was that it does not work with pg_service.conf. The installation documentation on http://www.pgadmin.org/docs/dev/pgagent-install.html refers to http://www.postgresql.org/docs/current/static/libpq.html#libpq-connect for more information on the connection string. 
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. 

$ pgagent_93 -f service=oaddev
ERROR: Primary connection string is not valid!
$ pgagent_93 -f hostaddr=pg-dev dbname=oad user=oaddev
ERROR: Could not find the table 'pgagent.pga_job'. Have you run pgagent.sql on this database?

(I know the last one gives an error right now, but at least it connects). 

I am using pgagent_93 on rhel6 (from http://yum.postgresql.org/9.3/redhat/rhel-6.6-x86_64/):
$ rpm -qf $(which pgagent_93)
pgagent_93-3.4.0-1.rhel6.x86_64


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.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgadmin-support by date:

Previous
From: David G Johnston
Date:
Subject: Re: pg_proc?
Next
From: Dirk-Jan Faber
Date:
Subject: Re: pgagent and pg_service.conf