How to query a postgresql database to determine it's cluster and version (and port)? I can quickly query the database name with SELECT current_database(); but I've been searching for way to also query the cluster name and version with no luck - hoping someone can suggest a solution.
That would be

SELECT current_setting('cluster_name'), current_setting('server_version');


You can get all parameters that way. For automated processing, server_version_num is often better.