Finding the host name of the database

Finding the host name of the database

Is there a view or function in edb that will give you the host name of the database? Like not just the database name but the server host and not my local host but the actual server host the database resides on?  I have tried what I have found but nothing giving me what I need.  

Accepted Solutions (0)

Answers (1)

Answers (1)

Level 2 Adventurer

Hi sheila1372 ,

 

To get host info from remote server you can use below functions .

 

select inet_server_addr();

 

         Or

 

[postgres@master ~]$ psql -d postgres -h slave
psql (10.7, server 10.6)
Type "help" for help.

postgres=# \conninfo
You are connected to database "postgres" as user "postgres" on host "slave" at port "5432".

Archived Discussions


Effective March 31st, we will no longer engage on PostgresRocks.


How to engage with us further?


  • Thought Leadership: EDB Blogs

  • Tips and Tricks: Postgres Tutorials

  • Customer Support: Create a Case Please note: Only customers with an active EDB support subscription and support portal authorization can create support ticket

  • Engage on Stackoverflow While engaging on Stackoverflow tag the question with EDB or EnterpriseDB.

© 2019 EnterpriseDB Corporation. All rights reserved.   |   Privacy Policy   |  Terms of Use   |   Trademarks