O'Reilly logo
  • Kai Thadden thinks this is interesting:

postgres=# conninfo

From

Cover of PostgreSQL Administration Cookbook, 9.5/9.6 Edition

Note

postgres=# \conninfo with a preceding backslash works