Use the same logic we've got in eg_db_config for build-db.sh to determine
PostgreSQL version installed on server.
Signed-off-by: Ben Shum <ben@evergreener.net>
Signed-off-by: Jason Stephenson <jason@sigio.com>
# ---------------------------------------------------------------------------
# Lookup the database version from the PostgreSQL server.
# ---------------------------------------------------------------------------
-DB_VERSION=`psql -qtc 'show server_version;' | xargs | cut -c1,3`
+DB_VERSION=`psql -qtc 'show server_version;' | xargs | cut -d. -f 1,2 | tr -d '.'`
if [ -z "$DB_VERSION" ] || [ `echo $DB_VERSION | grep -c '[^0-9]'` != 0 ]; then
cat <<EOM
********************************************************************************