Re: Adding a pg_servername() function

Поиск
Список
Период
Сортировка
От Christoph Moench-Tegeder
Тема Re: Adding a pg_servername() function
Дата
Msg-id ZMuo2ix8PqnDEe4/@squirrel.exwg.net
обсуждение исходный текст
Ответ на Re: Adding a pg_servername() function  (Laetitia Avrot <laetitia.avrot@gmail.com>)
Ответы Re: Adding a pg_servername() function  (Laetitia Avrot <laetitia.avrot@gmail.com>)
Список pgsql-hackers
## Laetitia Avrot (laetitia.avrot@gmail.com):

> For my customer,  their use case is to be able from an SQL client to double
> check they're on the right host before doing things that could become a
> production disaster.

Why not use cluster_name for that? Even if it may not be relevant
for their setup, there might be multiple clusters on the same host
(multiple clusters with the same hostname) or you database could be
hiding behind some failover/loadbalancer mechanism (multiple hostnames
in one cluster), thus using the hostname to identify the cluster is
totally not universal (the same goes for the monitoring/metrics
stuff). And there's of course inet_server_addr(), if you really
need to double-check if you're connected to the right machine.

Regards,
Christoph

-- 
Spare Space.



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

Предыдущее
От: Chapman Flack
Дата:
Сообщение: Re: Extract numeric filed in JSONB more effectively
Следующее
От: Andy Fan
Дата:
Сообщение: Re: Extract numeric filed in JSONB more effectively