aboutsummaryrefslogtreecommitdiffstats
path: root/main/postgresql
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-08-12 15:58:33 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-08-12 15:58:33 +0000
commitb52f84fe568749a09eaabe3ccbb5f6fe0c60f157 (patch)
treef6eafa46ed059fcd409a7037ac56108d52e5f753 /main/postgresql
parentbe9bc29b4ec785ab1da8c53557802de550de2639 (diff)
downloadaports-b52f84fe568749a09eaabe3ccbb5f6fe0c60f157.tar.bz2
aports-b52f84fe568749a09eaabe3ccbb5f6fe0c60f157.tar.xz
main/postgresql: upgrade to 8.4
Need to manually upgrade the database
Diffstat (limited to 'main/postgresql')
-rw-r--r--main/postgresql/APKBUILD11
-rw-r--r--main/postgresql/postgresql.confd2
-rw-r--r--main/postgresql/postgresql.pre-upgrade30
3 files changed, 38 insertions, 5 deletions
diff --git a/main/postgresql/APKBUILD b/main/postgresql/APKBUILD
index a2d921ed14..205c3f89c5 100644
--- a/main/postgresql/APKBUILD
+++ b/main/postgresql/APKBUILD
@@ -1,16 +1,18 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=postgresql
-pkgver=8.3.7
-pkgrel=3
+pkgver=8.4.0
+pkgrel=0
pkgdesc="A sophisticated object-relational DBMS"
url="http://www.postgresql.org/"
license="BSD"
depends="bbsuid"
+install="$pkgname.pre-upgrade"
makedepends="readline-dev openssl-dev zlib-dev"
subpackages="$pkgname-dev $pkgname-doc libpq $pkgname-client"
source="ftp://ftp.$pkgname.org/pub/source/v$pkgver/$pkgname-$pkgver.tar.bz2
$pkgname.initd
$pkgname.confd
+ $install
"
build() {
@@ -45,6 +47,7 @@ client() {
}
-md5sums="7b7e91a2221e55fe1b167e663217a96d postgresql-8.3.7.tar.bz2
+md5sums="1f172d5f60326e972837f58fa5acd130 postgresql-8.4.0.tar.bz2
6dd7bd7c97252312357a255237115b38 postgresql.initd
-ea3320c56a22f5c305199886c2766387 postgresql.confd"
+6218755fde294b7d17b77d280a9c9106 postgresql.confd
+a5c671b718f7adc9735b1ed89a5c26e1 postgresql.pre-upgrade"
diff --git a/main/postgresql/postgresql.confd b/main/postgresql/postgresql.confd
index 56561b0c40..22ff61cd37 100644
--- a/main/postgresql/postgresql.confd
+++ b/main/postgresql/postgresql.confd
@@ -1,5 +1,5 @@
# PostgreSQL's Database Directory
-PGDATA="/var/lib/postgresql/8.3/data"
+PGDATA="/var/lib/postgresql/8.4/data"
# PostgreSQL User
PGUSER="postgres"
diff --git a/main/postgresql/postgresql.pre-upgrade b/main/postgresql/postgresql.pre-upgrade
new file mode 100644
index 0000000000..358e9986b4
--- /dev/null
+++ b/main/postgresql/postgresql.pre-upgrade
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+
+current="$1"
+compare=$(apk version -t $current 8.4)
+
+# check if we upgrade from earlier than 8.4 and if it is running
+if [ "$compare" != "<" ] || ! /etc/init.d/postgresql --quiet status; then
+ exit 0
+fi
+
+if [ -f /etc/conf.d/postgresql ]; then
+ . /etc/conf.d/postgresql
+fi
+
+cat <<EOF
+* You are upgrading to postgres 8.4 wich is not compatible with the running
+* See: http://www.postgresql.org/docs/8.4/interactive/install-upgrading.html
+*
+* The corresponding steps for Alpine Linux is:
+*
+* pg_dumpall -U ${PGUSER:-postgres} > dumpfile
+* /etc/init.d/postgresql stop
+* apk add -u postgresql
+* /etc/init.d/postgresql setup
+* /etc/init.d/postgresl start
+* psql -U ${PGUSER:-postgres} -f dumpfile
+*
+EOF
+exit 1