File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 32
32
# Check the catalog version
33
33
CATALOG_VERSION_NO=2016081311
34
34
MAJORVER=9.6
35
+ # catalog version upgrade supported from. Space-separated list
36
+ UPGRADABLE_CATVER=" 201608131"
35
37
if [ ! -f " ${PGDATA} /global/pg_control" -a -f " ${PGDATA} /postgresql.conf" ]; then
36
38
# looks like we have Debian with separate directory for configs
37
39
SAVE_PGDATA=" $PGDATA "
@@ -43,8 +45,19 @@ if [ ! -f "${PGDATA}/global/pg_control" -a -f "${PGDATA}/postgresql.conf" ]; the
43
45
exit 1
44
46
fi
45
47
fi
46
- CATVER=` ${PGBIN} pg_controldata| sed -n ' /Catalog version number:/s/^.*: *//p' `
48
+ CATVER=` " ${PGBIN} pg_controldata" | sed -n ' /Catalog version number:/s/^.*: *//p' `
47
49
if [ " $CATVER " != $CATALOG_VERSION_NO ]; then
50
+ for v in $UPGRADABLE_CATVER ; do
51
+ if [ " $CATVER " = " $v " ]; then
52
+ upgrade_possible=1
53
+ break
54
+ fi
55
+ done
56
+ if [ -z " $upgrade_possible " ]; then
57
+ echo " Upgrade of $PGDATA from catalog version '$CATVER ' is not supported" >&2
58
+ exit 2
59
+ fi
60
+
48
61
if [ -n " $check " ]; then
49
62
echo " Database needs upgrade"
50
63
exit 1
You can’t perform that action at this time.
0 commit comments