Le jeu. 3 août 2023, 11:31, Matthias van de Meent < boekewurm+postg...@gmail.com> a écrit :
> On Thu, 3 Aug 2023 at 10:37, Laetitia Avrot <laetitia.av...@gmail.com> > wrote: > > > > Dear Hackers, > > > > One of my customers suggested creating a function that could return the > server's hostname. > > Mostly for my curiosity: What would be their use case? > Thank you for showing interest in that patch. > 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. I see also another use case: being able to identify postgres metrics on a monitoring tool. Look at the hack pg_staviz uses here: https://github.com/vyruss/pg_statviz/blob/7cd0c694cea40f780fb8b76275c6097b5d210de6/src/pg_statviz/libs/info.py#L30 Those are the use cases I can think of. I only see limited usability, considering that the local user's > hostname can be very different from the hostname used in the url that > connects to that PostgreSQL instance. > Agreed, depending on how hosts and dns are set, it can be useless. But normally, companies have host making standards to avoid that. Have a nice day, Lætitia > Kind regards, > > Matthias van de Meent > Neon (https://neon.tech) >