int pg_port
pg_Port() will return the port number that the given PostgreSQL connection identifier is connected to.