Skip to content

Commit 44101db

Browse files
authored
Merge pull request #119 from nigredo-tori/patch-2
Update PG_OLD_VERSION command for Postgres 10
2 parents fca2dee + f9a89f0 commit 44101db

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

runtime/functions

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22
set -e
3+
shopt -s extglob
34
source ${PG_APP_HOME}/env-defaults
45

56
PG_CONF=${PG_DATADIR}/postgresql.conf
@@ -185,7 +186,7 @@ initialize_database() {
185186
;;
186187
*)
187188
echo "Initializing database..."
188-
PG_OLD_VERSION=$(find ${PG_HOME}/[0-9].[0-9]/main -maxdepth 1 -name PG_VERSION 2>/dev/null | grep -v $PG_VERSION | sort -r | head -n1 | cut -d'/' -f5)
189+
PG_OLD_VERSION=$(find ${PG_HOME}/+([0-9])?(.[0-9])/main -maxdepth 1 -name PG_VERSION 2>/dev/null | grep -v $PG_VERSION | sort -r | head -n1 | cut -d'/' -f5)
189190
if [[ -n ${PG_OLD_VERSION} ]]; then
190191
echo "‣ Migrating PostgreSQL ${PG_OLD_VERSION} data to ${PG_VERSION}..."
191192

0 commit comments

Comments
 (0)