title: PostgreSQL 9.3: Query to get hostname,port number and username
body: <p>I want to write a query which should result me the following details:</p>
  
  <ol>
  <li>Host,</li>
  <li>Port, </li>
  <li>Username.</li>
  </ol>
  
  <p>Like we get in the PgAdmin as shown in the below picture:</p>
  
  <p><a href="https://i.stack.imgur.com/cwKqm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cwKqm.jpg" alt="enter image description here"></a></p>
  
  <p>As per a_horse_with_no_name said in <a href="https://stackoverflow.com/questions/5598517/find-the-host-name-and-port-using-psql-commands">this answer</a> gives me only port number.</p>