snippetsqlMinor
How to query a postgresql database to determine it's cluster and version (and port)?
Viewed 0 times
postgresqlversionquerydatabasedeterminehowandportcluster
Problem
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.Solution
That would be
You can get all parameters that way. For automated processing,
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.Code Snippets
SELECT current_setting('cluster_name'), current_setting('server_version');Context
StackExchange Database Administrators Q#242433, answer score: 8
Revisions (0)
No revisions yet.