Allow to handle beta or rc version.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 9 Oct 2018 01:47:24 +0000 (10:47 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 9 Oct 2018 01:47:24 +0000 (10:47 +0900)
pgpool_setup failed to extract major version number if it includes non
numeric characters.

src/test/pgpool_setup

index 7baf456e97c568be018ca491bc47eb467483998a..36cd27cceffa238d7f9d6e9422829ab90ca7c6cb 100755 (executable)
@@ -97,7 +97,7 @@ PG_CTL=$PGBIN/pg_ctl
 PSQL=$PGBIN/psql
 
 # get PostgreSQL major version
-PGVERSION=`$INITDB -V|awk '{print $3}'|sed 's/\..*//'`
+PGVERSION=`$INITDB -V|awk '{print $3}'|sed 's/\..*//'|sed 's/\([0-9]*\)[a-zA-Z].*/\1/'`
 echo PostgreSQL major version: $PGVERSION
 
 # pgpool-II configuration file localtion.