Running psql commands from a remote location & pg_hba.conf?

Поиск
Список
Период
Сортировка
От Birchall, Austen
Тема Running psql commands from a remote location & pg_hba.conf?
Дата
Msg-id 4E154FB60786D74BB4DFDC97BF991CAC07602A@EXXCMPD1DAG2.cmpd1.metoffice.gov.uk
обсуждение исходный текст
Ответы Re: Running psql commands from a remote location & pg_hba.conf?  (Luca Ferrari <fluca1978@infinito.it>)
Список pgsql-novice
I have a monitor user that does a SSH from a remote location onto a database's host then runs commands  of the form:

/usr/bin/psql -c "SELECT COUNT(*) FROM pg_stat_activity; ;" -U monitor -d db1 -q -A -t

The current pg_hba.conf  is


# IPv4 local connections:
host    all         all         123.0.0.1/32          trust
which is far from ideal!

Am I right to presume that I have to change pg_hba.conf to

host    db1    monitor        123.0.0.1/32    trust
host     db1    user1        123.0.0.1/32    ident
host    db1    user2        123.0.0.1/32    ident

then continue this format with individual entries for all the users in db1?

Or is there a 'better' way of running psql commands from a remote location?

Thanks

Austen

Austen Birchall  Senior Database Administrator, Met Office


В списке pgsql-novice по дате отправления:

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: Re: General 'big data' advice....
Следующее
От: Luca Ferrari
Дата:
Сообщение: Re: Running psql commands from a remote location & pg_hba.conf?