PostgreSQL/Postgre SQL/Inet Port
port of the local connection
postgres=# -- port of the local connection
postgres=# select inet_server_port();
inet_server_port
------------------
5432
(1 row)
postgres=#
Port of the remote connection
postgres=# -- port of the remote connection
postgres=# select inet_client_port() ;
inet_client_port
------------------
4996
(1 row)
postgres=#