diff options
| author | Palle Girgensohn <girgen@FreeBSD.org> | 2011-04-18 23:34:27 +0000 |
|---|---|---|
| committer | Palle Girgensohn <girgen@FreeBSD.org> | 2011-04-18 23:34:27 +0000 |
| commit | 73c856222edb8c22377bf9a1c81a724065e3a31c (patch) | |
| tree | 2a77e52eec6ad4963a7f80ea0b338e506c5e9a85 /databases/postgresql90-server/files/pkg-install-server.in | |
| parent | - Fix category (diff) | |
Update PostgreSQL to 9.0.4, 8.4.8, 8.3.15 and 8.2.21.
This update contains a critical fix to the pg_upgrade utility
which prevents significant downtime issues. Do not use
pg_upgrade without installing this update first.
The issue with pg_upgrade and the fix are detailed on the PostgreSQL
wiki: http://wiki.postgresql.org/wiki/20110408pg_upgrade_fix
Users who have already used pg_upgrade should run the database repair
script given on that page on their databases as soon as possible.
See the release notes for each version at
http://www.postgresql.org/docs/current/static/release.html for a full
list of changes with details.
Allow the username of the postgresql user to configurable for 8.4 and 9.0.
Largely inspired by the work of Jason Helfman [153668, 153136].
Change PGUSER knob to PG_USER not to clash with PGUSER environment.
PR: 153668, 153136, 155493, 155137
Notes
Notes:
svn path=/head/; revision=272900
Diffstat (limited to 'databases/postgresql90-server/files/pkg-install-server.in')
| -rw-r--r-- | databases/postgresql90-server/files/pkg-install-server.in | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/databases/postgresql90-server/files/pkg-install-server.in b/databases/postgresql90-server/files/pkg-install-server.in new file mode 100644 index 000000000000..a225290b6a67 --- /dev/null +++ b/databases/postgresql90-server/files/pkg-install-server.in @@ -0,0 +1,66 @@ +#! /bin/sh + +# $FreeBSD$ + +PATH=/bin:/usr/bin:/usr/sbin +PG_USER=%%PG_USER%% +PG_GROUP=%%PG_GROUP%% +PG_UID=%%PG_UID%% + +backupwarning() { echo " + + =========== BACKUP YOUR DATA! ============= + As always, backup your data before + upgrading. If the upgrade leads to a higher + minor revision (e.g. 7.3.x -> 7.4), a dump + and restore of all databases is + required. This is *NOT* done by the port! + + Press ctrl-C *now* if you need to pg_dump. + =========================================== +" + sleep 5 +} + +case $2 in +PRE-INSTALL) + backupwarning + PGUSER=${PGUSER:-${PG_USER}} + PGGROUP=${PGGROUP:-${PG_GROUP}} + DB_DIR=${PKG_PREFIX}/${PGUSER} + UID=${PG_UID} + GID=${PG_UID} + + if pw group show "${PGGROUP}" 2>/dev/null; then + echo "You already have a group \"${PGGROUP}\", so I will use it." + else + if pw groupadd ${PGGROUP} -g ${GID}; then + echo "Added group \"${PGGROUP}\"." + else + echo "Adding group \"${PGGROUP}\" failed..." + exit 1 + fi + fi + + if pw user show "${PGUSER}" 2>/dev/null; then + echo "You already have a user \"${PGUSER}\", so I will use it." + else + if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \ + -d ${DB_DIR} -c "PostgreSQL Daemon" + then + echo "Added user \"${PGUSER}\"." + else + echo "Adding user \"${PGUSER}\" failed..." + exit 1 + fi + fi + + if ! [ -x ~${PGUSER} ] ; then + install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR} + fi + ;; + +BACKUPWARNING) + backupwarning + ;; +esac |
