@subhash-DBA
Thank you for the question and for using Microsoft Q&A platform.
As per my understanding you are trying to get the Postgre SQL server's name using a query.
Can you please let me know what application are you trying to run? This would help me to understand the query better.
The above queries are used to fetch the database name, server's IP address and port number, which can help identify the server and also the version of the server. Hope this helps.