Adding a pg_servername() function

Поиск
Список
Период
Сортировка
От Laetitia Avrot
Тема Adding a pg_servername() function
Дата
Msg-id CAB_COdj9eGCOy_=WcPZ8SCVtTH1eRr=QMJ18UAeOttroFrVbtQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Adding a pg_servername() function
Список pgsql-hackers
Dear Hackers,

One of my customers suggested creating a function that could return the server's hostname.

After a quick search, we found [this Wiki page](https://wiki.postgresql.org/wiki/Pg_gethostname) referring to [that extension](https://github.com/theory/pg-hostname/) from David E. Wheeler.

I used shamelessly the idea and created a working proof of concept:

- the function takes no argument and returns the hostname or a null value if any error occurs
- the function was added to the network.c file because it makes sense to me to have that near the inet_server_addr() and inet_server_port() functions.
- I didn't add any test as the inet functions are not tested either.

If you think my design is good enough, I'll go ahead and port/test that function for Windows.

Have a nice day,

Lætitia
Вложения

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

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Inquiry about Functionality Availability in PostgreSQL
Следующее
От: Amit Langote
Дата:
Сообщение: Re: generic plans and "initial" pruning