Would it be less problematic if the function were called pg_gethostname()?
@Laetitia: why did you propose that name? maybe to avoid clashes with some extension out there?
I used that name to be kind of coherent with the inet_server_addr(), but I see now how it is a bad decision and can add confusion and wrong expectations. I think pg_gethostname() is better.