From 97485f68240a9da771c8725709c6a62aff97aa49 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Fri, 2 Aug 2024 02:25:49 +0900 Subject: [PATCH] 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. --- src/sample/scripts/follow_primary.sh.sample | 2 +- src/sample/scripts/recovery_1st_stage.sample | 2 +- src/sample/scripts/replication_mode_recovery_1st_stage.sample | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.39.5