We do this in the following way in our DBA environment, though we are all running on Debian, so it's considerably easier:
-
Get the version from cluster_info. This could also be done with SHOW server_version; Our specific script that gives us this is clusterinfo-vars payments_a --version. Refer to https://git.enova.com/cfengine/postgres/blob/master/DBA-Tools/clusterinfo-vars for this script.
-
Find the path of the binary using the version, i.e.
#!/bin/bash
set -eu
destination_cluster=$1
eval "$(clusterinfo-vars $destination_cluster version)"
echo "/usr/lib/postgresql/$version/bin"
We do this in the following way in our DBA environment, though we are all running on Debian, so it's considerably easier:
Get the version from cluster_info. This could also be done with
SHOW server_version;Our specific script that gives us this isclusterinfo-vars payments_a --version. Refer to https://git.enova.com/cfengine/postgres/blob/master/DBA-Tools/clusterinfo-vars for this script.Find the path of the binary using the version, i.e.