summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBo Peng2024-08-01 17:25:49 +0000
committerBo Peng2024-08-01 17:25:49 +0000
commit562f4330cbb25496c482129eb21e44a4761b6ec9 (patch)
tree6780b275613e65572dcd5a76725992b47210d0cb /src
parentb8c57c7f5cf2c1ec7582f4d8346585034edd8566 (diff)
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.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/sample/scripts/follow_primary.sh.sample2
-rwxr-xr-xsrc/sample/scripts/recovery_1st_stage.sample2
-rwxr-xr-xsrc/sample/scripts/replication_mode_recovery_1st_stage.sample2
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 342530cb6..49c58cfcf 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 d5cd1f22a..390158ade 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 e83f0e504..17021a03e 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