Re: [9.1] pg_stat_get_backend_server_addr

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: [9.1] pg_stat_get_backend_server_addr
Дата
Msg-id 1279775549.23350.9.camel@jdavis
обсуждение исходный текст
Ответ на Re: [9.1] pg_stat_get_backend_server_addr  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: [9.1] pg_stat_get_backend_server_addr  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On Fri, 2010-05-28 at 18:01 +0300, Peter Eisentraut wrote:
> Yes, I would like to know who is connecting to what IP address.  It's
> useful if you have HA setups and you need to check which way your
> connections are going.

A few comments on this patch:

The two functions aren't perfectly symmetric, because 
pg_stat_get_backend_server_port() returns -1 if it's a unix socket, and
pg_stat_get_backend_server_addr() returns NULL (which is also overloaded
to mean that you don't have permissions). So, perhaps it's better to
just have pg_stat_get_backend_server_addr(), which is the one you want,
anyway.

Also, for the permission check I'm inclined to throw an error rather
than return NULL. If the function is being called from a view, it's
understandable that we don't want to throw an error; but this function
isn't being called from a view. Based on your use-case, I'm more worried
about the HA system getting confused with a NULL result, and then
failing mysteriously with no error message.

Regards,Jeff Davis



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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: Preliminary review of Synchronous Replication patches
Следующее
От: Fujii Masao
Дата:
Сообщение: little mistakes in HS/SR