I want to write a query which should result me the following details:
Like we get in the PgAdmin as shown in the below picture:

As per a_horse_with_no_name said in this answer gives me only port number.
SELECT CURRENT_USER usr
,inet_server_addr() host -- use inet_client_addr() to get address of the remote connection
,inet_server_port() port -- use inet_client_port() to get port of the remote connection
System Information Functions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With