PostgreSQL query to find the host name

subhash-DBA 105 Reputation points
2025-01-10T03:46:57.2766667+00:00

HI Team,

I am looking for a PostgreSQL command/query (not Azure CLI )that i can run in Azure PostgreSQL flexible server to get the server name.

currently i can get this info using the below psql command "\conninfo", but this command works only in the PSQL prompt and not part of stored procedures/code that runs from applications.

Azure Database for PostgreSQL
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.