File: postgresql.config

package info (click to toggle)
postgresql-common 282
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,528 kB
  • sloc: perl: 4,170; sh: 1,572; makefile: 327; sql: 13; ansic: 10
file content (29 lines) | stat: -rw-r--r-- 753 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

set -e

# version information maintained by debian/rules
NEWVERSION=17

. /usr/share/debconf/confmodule

try_upgrade () {
    # look for the newest "main" cluster
    OLDVERSION=$(pg_lsclusters -h | grep -E '^[0-9.]+ +main ' | tail -n1)
    [ "$OLDVERSION" ] || return 0 # no cluster found
    OLDVERSION=${OLDVERSION%% *}

    # check if that's older than the newest version
    dpkg --compare-versions $OLDVERSION lt $NEWVERSION || return 0

    # ask if the user wants to upgrade
    db_fset postgresql/auto_upgrade seen false
    db_subst postgresql/auto_upgrade oldversion $OLDVERSION
    db_subst postgresql/auto_upgrade newversion $NEWVERSION
    db_input high postgresql/auto_upgrade || true
    db_go || true
}

try_upgrade

db_stop