summaryrefslogtreecommitdiff
path: root/databases/postgresql82-server/files
diff options
context:
space:
mode:
authorPalle Girgensohn <girgen@FreeBSD.org>2011-10-18 09:03:33 +0000
committerPalle Girgensohn <girgen@FreeBSD.org>2011-10-18 09:03:33 +0000
commitd9a60ff20fdef5ff2634ff38096cc7c163b9eca3 (patch)
treebd78806842ec28ab44892af2bfb4d697751facd0 /databases/postgresql82-server/files
parentmail/exim: upgrade to 4.77 (diff)
The PostgreSQL Global Development Group today released minor version updates
for all active branches of the PostgreSQL object-relational database system, including versions 9.1.1, 9.0.5, 8.4.9, 8.3.16 and 8.2.22. All users are strongly urged to update their installations at the next scheduled downtime. URL: http://www.postgresql.org/about/news.1355 Cleanup ports. Better handling of the knob PG_USER. Also add uuid to 9.0 and 9.1 contrib ports.
Notes
Notes: svn path=/head/; revision=283757
Diffstat (limited to 'databases/postgresql82-server/files')
-rw-r--r--databases/postgresql82-server/files/502.pgsql.in (renamed from databases/postgresql82-server/files/502.pgsql)25
-rw-r--r--databases/postgresql82-server/files/patch-src-plperl-plperl28
2 files changed, 14 insertions, 39 deletions
diff --git a/databases/postgresql82-server/files/502.pgsql b/databases/postgresql82-server/files/502.pgsql.in
index 281189a59c46..69bfff4cef12 100644
--- a/databases/postgresql82-server/files/502.pgsql
+++ b/databases/postgresql82-server/files/502.pgsql.in
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $FreeBSD$
+# $FreeBSD: /tmp/pcvs/ports/databases/postgresql82-server/files/Attic/502.pgsql.in,v 1.1 2011-10-18 09:03:31 girgen Exp $
#
# Maintenance shell script to vacuum and backup database
# Put this in /usr/local/etc/periodic/daily, and it will be run
@@ -19,10 +19,12 @@
# daily_pgsql_backup_enable="foo bar db1 db2" # only do backup of a limited selection of databases
# daily_pgsql_vacuum_enable="YES" # do vacuum
-daily_pgsql_vacuum_args="-z"
-daily_pgsql_pgdump_args="-b -F c"
+daily_pgsql_user=%%PG_USER%%
+daily_pgsql_vacuum_args="-U ${daily_pgsql_user} -qaz"
+daily_pgsql_pgdump_args="-U ${daily_pgsql_user} -bF c"
+daily_pgsql_pgdumpall_globals_args="-U ${daily_pgsql_user}"
# backupdir is relative to ~pgsql home directory unless it begins with a slash:
-daily_pgsql_backupdir="~pgsql/backups"
+daily_pgsql_backupdir="~${daily_pgsql_user}/backups"
daily_pgsql_savedays="7"
# If there is a global system configuration file, suck it in.
@@ -39,12 +41,12 @@ eval backupdir=${daily_pgsql_backupdir}
rc=0
pgsql_backup() {
- # daily_pgsql_backupdir must be writeable by user pgsql
- # ~pgsql is just that under normal circumstances,
+ # daily_pgsql_backupdir must be writeable by user %%PG_USER%%
+ # ~%%PG_USER%% is just that under normal circumstances,
# but this might not be where you want the backups...
if [ ! -d ${backupdir} ] ; then
echo Creating ${backupdir}
- mkdir -m 700 ${backupdir}; chown pgsql ${backupdir}
+ mkdir -m 700 ${backupdir}; chown ${daily_pgsql_user} ${backupdir}
fi
echo
@@ -55,13 +57,14 @@ pgsql_backup() {
rc=$?
now=`date "+%Y-%m-%dT%H:%M:%S"`
file=${daily_pgsql_backupdir}/pgglobals_${now}
- su -l pgsql -c "umask 077; pg_dumpall -g | gzip -9 > ${file}.gz"
+ su -l ${daily_pgsql_user} -c \
+ "umask 077; pg_dumpall -g ${daily_pgsql_pgdumpall_globals_args} | gzip -9 > ${file}.gz"
db=$1
while shift; do
echo -n " $db"
file=${backupdir}/pgdump_${db}_${now}
- su -l pgsql -c "umask 077; pg_dump ${daily_pgsql_pgdump_args} -f ${file} ${db}"
+ su -l ${daily_pgsql_user} -c "umask 077; pg_dump ${daily_pgsql_pgdump_args} -f ${file} ${db}"
[ $? -gt 0 ] && rc=3
db=$1
done
@@ -79,7 +82,7 @@ pgsql_backup() {
case "$daily_pgsql_backup_enable" in
[Yy][Ee][Ss])
- dbnames=`su -l pgsql -c "umask 077; psql -q -t -A -d template1 -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"`
+ dbnames=`su -l %%PG_USER%% -c "umask 077; psql -q -t -A -d template1 -U %%PG_USER%% -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"`
pgsql_backup $dbnames
;;
@@ -99,7 +102,7 @@ case "$daily_pgsql_vacuum_enable" in
echo
echo "PostgreSQL vacuum"
- su -l pgsql -c "vacuumdb -a -q ${daily_pgsql_vacuum_args}"
+ su -l ${daily_pgsql_user} -c "vacuumdb ${daily_pgsql_vacuum_args}"
if [ $? -gt 0 ]
then
echo
diff --git a/databases/postgresql82-server/files/patch-src-plperl-plperl b/databases/postgresql82-server/files/patch-src-plperl-plperl
deleted file mode 100644
index 4edb469a73d4..000000000000
--- a/databases/postgresql82-server/files/patch-src-plperl-plperl
+++ /dev/null
@@ -1,28 +0,0 @@
-Obtained from: http://archives.postgresql.org/pgsql-hackers/2011-04/msg01283.php
-Reference: http://search.cpan.org/~jesse/perl-5.14.0/pod/perldelta.pod#GvCV()_and_GvGP()_are_no_longer_lvalues
-
---- src/pl/plperl/plperl.c.orig 2011-04-15 11:15:53.000000000 +0800
-+++ src/pl/plperl/plperl.c 2011-05-19 20:39:34.126713700 +0800
-@@ -687,7 +687,7 @@
- if (!isGV_with_GP(sv) || !GvCV(sv))
- continue;
- SvREFCNT_dec(GvCV(sv)); /* free the CV */
-- GvCV(sv) = NULL; /* prevent call via GV */
-+ GvCV_set(sv, NULL); /* prevent call via GV */
- }
- hv_clear(stash);
-
---- src/pl/plperl/plperl.h.orig 2011-04-15 11:15:53.000000000 +0800
-+++ src/pl/plperl/plperl.h 2011-05-19 20:39:34.127713548 +0800
-@@ -43,6 +43,11 @@
- #undef bool
- #endif
-
-+/* supply GvCV_set if it's missing - ppport.h doesn't supply it, unfortunately */
-+#ifndef GvCV_set
-+#define GvCV_set(gv, cv) (GvCV(gv) = cv)
-+#endif
-+
- /* routines from spi_internal.c */
- int spi_DEBUG(void);
- int spi_LOG(void);