Re: Adding a pg_servername() function

Поиск
Список
Период
Сортировка
От GF
Тема Re: Adding a pg_servername() function
Дата
Msg-id CAFePLY2BG3vqqetsH5QxaYrWRcW2YhyF_O=fU5f_Yu=2V_Z9EA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Adding a pg_servername() function  (Peter Eisentraut <peter@eisentraut.org>)
Ответы Re: Adding a pg_servername() function  (Christoph Moench-Tegeder <cmt@burggraben.net>)
Список pgsql-hackers
Hi everybody,

On 09.08.23 08:42, Laetitia Avrot wrote:
> I agree that the feature I'm suggesting could be done with a few tricks.
> I meant to simplify the life of the user by providing a simple new
> feature. (Also, I might have trust issues with DNS due to several past
> production disasters.)

Just my contribution on why this function could be useful, since we had a use case that fits exactly this.
In the past I needed such a pg_servername() function because in a project I was engaged on they needed to distribute "requests" directed to a in-house management service running on network servers, and each one had a DB, so we went with pglogical to be used as a (transactional) messaging middleware. The requests were targeted to specific hostnames, thus on the replication downstream we wanted to filter with a before-insert trigger on the hostname.
At that point, we had to do some contortions to get the hostname the DB was running on, sometimes really nasty like: on linux servers we could go with a python function; but on windows ones (where there was no python available) we had to resort to a function that read the OS "hostname" command into a temporary table via the pg "copy", which is both tricky and inefficient.

So, from me +1 to Laetitia's proposal.

On Wed, 9 Aug 2023 at 10:26, Peter Eisentraut <peter@eisentraut.org> wrote:
(*) But we should think about access control for this.
 
And +1 also to Peter's note on enforcing the access control. BTW that's exactly what we needed with plpythonu, and also with "copy from program".

Best,
Giovanni

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: [PoC] Reducing planning time when tables have many partitions
Следующее
От: Christoph Berg
Дата:
Сообщение: Re: A failure in 031_recovery_conflict.pl on Debian/s390x