From: Bo Peng Date: Thu, 1 Aug 2024 17:25:49 +0000 (+0900) Subject: Use "psql -V" instead of "initdb -V" in sample scripts. X-Git-Tag: V4_4_8~7 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=97485f68240a9da771c8725709c6a62aff97aa49;p=pgpool2.git Use "psql -V" instead of "initdb -V" in sample scripts. Use "psql -V" instead of "initdb -V" in the sample scripts bacause in some cases postgresqlxx-server may not be installed. --- diff --git a/src/sample/scripts/follow_primary.sh.sample b/src/sample/scripts/follow_primary.sh.sample index 67b9c5793..575304194 100755 --- a/src/sample/scripts/follow_primary.sh.sample +++ b/src/sample/scripts/follow_primary.sh.sample @@ -60,7 +60,7 @@ if [ $? -ne 0 ]; then fi # Get PostgreSQL major version -PGVERSION=`${PGHOME}/bin/initdb -V | awk '{print $3}' | sed 's/\..*//' | sed 's/\([0-9]*\)[a-zA-Z].*/\1/'` +PGVERSION=`${PGHOME}/bin/psql -V | awk '{print $3}' | sed 's/\..*//' | sed 's/\([0-9]*\)[a-zA-Z].*/\1/'` if [ $PGVERSION -ge 12 ]; then RECOVERYCONF=${NODE_PGDATA}/myrecovery.conf diff --git a/src/sample/scripts/recovery_1st_stage.sample b/src/sample/scripts/recovery_1st_stage.sample index 27862af81..68e17d2ef 100755 --- a/src/sample/scripts/recovery_1st_stage.sample +++ b/src/sample/scripts/recovery_1st_stage.sample @@ -30,7 +30,7 @@ if [ $? -ne 0 ]; then fi ## Get PostgreSQL major version -PGVERSION=`${PGHOME}/bin/initdb -V | awk '{print $3}' | sed 's/\..*//' | sed 's/\([0-9]*\)[a-zA-Z].*/\1/'` +PGVERSION=`${PGHOME}/bin/psql -V | awk '{print $3}' | sed 's/\..*//' | sed 's/\([0-9]*\)[a-zA-Z].*/\1/'` if [ $PGVERSION -ge 12 ]; then RECOVERYCONF=${DEST_NODE_PGDATA}/myrecovery.conf else diff --git a/src/sample/scripts/replication_mode_recovery_1st_stage.sample b/src/sample/scripts/replication_mode_recovery_1st_stage.sample index 300c30395..3db554a4a 100755 --- a/src/sample/scripts/replication_mode_recovery_1st_stage.sample +++ b/src/sample/scripts/replication_mode_recovery_1st_stage.sample @@ -30,7 +30,7 @@ if [ $? -ne 0 ]; then fi ## Get PostgreSQL major version -PGVERSION=`${PGHOME}/bin/initdb -V | awk '{print $3}' | sed 's/\..*//' | sed 's/\([0-9]*\)[a-zA-Z].*/\1/'` +PGVERSION=`${PGHOME}/bin/psql -V | awk '{print $3}' | sed 's/\..*//' | sed 's/\([0-9]*\)[a-zA-Z].*/\1/'` if [ $PGVERSION -ge 12 ]; then RECOVERYCONF=${DEST_NODE_PGDATA}/myrecovery.conf else