Use "psql -V" instead of "initdb -V" in sample scripts.
authorBo Peng <pengbo@sraoss.co.jp>
Thu, 1 Aug 2024 17:25:49 +0000 (02:25 +0900)
committerBo Peng <pengbo@sraoss.co.jp>
Thu, 1 Aug 2024 17:25:49 +0000 (02:25 +0900)
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
src/sample/scripts/recovery_1st_stage.sample
src/sample/scripts/replication_mode_recovery_1st_stage.sample

index 342530cb64eda7c826794a1e576cf5ad47786aed..49c58cfcfa5fd09466d26d85893392f1105b09e1 100755 (executable)
@@ -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
index d5cd1f22ab0c32d2a0793e31efd64996f3900ef0..390158aded357fc57ace3b4f689440902374f4b7 100755 (executable)
@@ -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
index e83f0e504450c8b52c9d81bcc261a5e9a04e6fd8..17021a03e01ef132adee9d46e6f6a4186371f553 100755 (executable)
@@ -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