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:30:26 +0000 (02:30 +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 67b9c5793097a9fd22ab8f818eff660696720222..575304194fddfe97f7232f9cf450fee6d17ed7e9 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 27862af811c485da78d83f7bf1e3954ac4f3acab..68e17d2ef961aebd7d33a8af71aef77fadba3271 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 300c30395f9bb51bd15948e3af177d59fb9142fc..3db554a4a6851e5a205d67f0fd3ba018e970feb5 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