Обсуждение: pgAgent and pgpass

Поиск
Список
Период
Сортировка

pgAgent and pgpass

От
Barry Schatz
Дата:
I didn't receive a copy of my post from yesterday so I'm having to write this as if it were a new post rather than a
follow-up(keeping same subject line).<br /><br />FYI: I overcame the problem of pgAgent not reading .pgpass by
eliminatingthe host address from the arguments, thus:<br /><br />DAEMON_ARGS="-l 1 -s /var/log/postgresql/pgagent.log
port=6543dbname=postgres user=postgres"<br /><br />Why did this work? I'm not sure. It would be helpful if someone more
knowledgeablecould chime in and correct my discovery that, apparently, .pgpass works only in a UNIX socket context.
Surelythat is wrong, but when I deleted the host address argument pgAgent could use .pgpass via login by UNIX sockets,
withthe following line set in pg_hba.conf:<br /><br />local   all         postgres             ident<br /><br />I
testedthis by commenting out this line and restarting postgresql and pgagent, whose log then recorded:<br /><br
/>WARNING:Couldn't create connection: FATAL:  no pg_hba.conf entry for host "[local]", user "postgres", database
"postgres",SSL off<br /> WARNING: Couldn't create connection: could not connect to server: No such file or directory<br
/>       Is the server running locally and accepting<br />        connections on Unix domain socket
"/var/run/postgresql/.s.PGSQL.6543"?<br/><br />But as to why .pgpass was not read by pgAgent when I first tried to use
anIPv4 host address I don't know.<br /><br />Many will ask why I wasn't using 127.0.0.1 and it's because this
configurationis on a virtual server where localhost and 127.0.0.1 are not available, leaving only the assigned IP
address.And... pgAgent doesn't see the .pgpass file when I used that option.<br /><br />Can anybody shed more light on
thisdiscovery?<br /><br />BTW I also deleted the pidfile option from the Debian init script, but if anyone has a more
expertDebian init script for pgAgent than my woeful example, please post it. Thanks.<br /> 

Re: pgAgent and pgpass

От
Dave Page
Дата:
On Tue, Apr 27, 2010 at 4:19 PM, Barry Schatz <barry.schatz@gmail.com> wrote:
> I didn't receive a copy of my post from yesterday so I'm having to write
> this as if it were a new post rather than a follow-up (keeping same subject
> line).

Gmail hides it for you.

> FYI: I overcame the problem of pgAgent not reading .pgpass by eliminating
> the host address from the arguments, thus:
>
> DAEMON_ARGS="-l 1 -s /var/log/postgresql/pgagent.log port=6543
> dbname=postgres user=postgres"
>
> Why did this work? I'm not sure. It would be helpful if someone more
> knowledgeable could chime in and correct my discovery that, apparently,
> .pgpass works only in a UNIX socket context. Surely that is wrong, but when
> I deleted the host address argument pgAgent could use .pgpass via login by
> UNIX sockets, with the following line set in pg_hba.conf:

From: http://www.postgresql.org/docs/8.4/static/libpq-connect.html

"Also, host rather than hostaddr is used to identify the connection in
~/.pgpass (see Section 30.14)."


-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company