summaryrefslogtreecommitdiff
path: root/databases/postgresql7/files
diff options
context:
space:
mode:
authorSean Chittenden <seanc@FreeBSD.org>2003-01-04 01:10:15 +0000
committerSean Chittenden <seanc@FreeBSD.org>2003-01-04 01:10:15 +0000
commit62e1bb44328db7be12796334d8be63e24d48df05 (patch)
tree3a0c0b58f7ea4a90c14173ab0245e14436624053 /databases/postgresql7/files
parentI get the stupid award for this port. It NOW installs in the RIGHT place. (diff)
Update PostgreSQL to 7.3.1[1]. Fixes builds for spac64. Many speed,
security, and feature additions. Reduce diffs between postgresql-devel port. Re-initdb required when upgrading from previous release. See release notes for details. Schemas added are system catalogs updated. ::braces for impact:: http://developer.postgresql.org/docs/postgres/release.html#RELEASE-7-3-1 PR: ports/46701 Submitted by: girgen@pingpong.net
Notes
Notes: svn path=/head/; revision=72481
Diffstat (limited to 'databases/postgresql7/files')
-rw-r--r--databases/postgresql7/files/502.pgsql16
-rw-r--r--databases/postgresql7/files/dot.profile.in7
-rw-r--r--databases/postgresql7/files/patch-aj118
-rw-r--r--databases/postgresql7/files/patch-src::include::port::freebsd.h10
-rw-r--r--databases/postgresql7/files/pgsql.sh.tmpl25
-rw-r--r--databases/postgresql7/files/post-install-notes2
6 files changed, 46 insertions, 132 deletions
diff --git a/databases/postgresql7/files/502.pgsql b/databases/postgresql7/files/502.pgsql
index c372163f7407..84cdb9b5ad45 100644
--- a/databases/postgresql7/files/502.pgsql
+++ b/databases/postgresql7/files/502.pgsql
@@ -6,7 +6,7 @@
# Put this in /usr/local/etc/periodic/daily, and it will be run
# every night
#
-# Written by Palle Girgensohn <girgen@partitur.se>
+# Written by Palle Girgensohn <girgen@pingpong.net>
#
# In public domain, do what you like with it,
# and use it at your own risk... :)
@@ -34,9 +34,13 @@ PGDUMP_ARGS=${PGDUMP_ARGS:-"-b -F c"}
# The directory where the backups will reside.
# ${HOME} is pgsql's home directory
-#
PGBACKUPDIR=${PGBACKUPDIR:-${HOME}/backups}
+# If you want to keep a history of database backups, set
+# PGBACKUP_SAVE_DAYS in ~pgsql/.profile to the number of days. This is
+# used as "find ... -mtime +${PGBACKUP_SAVE_DAYS} -delete", see below
+PGBACKUP_SAVE_DAYS=${PGBACKUP_SAVE_DAYS:-7}
+
# PGBACKUPDIR must be writeable by user pgsql
# ~pgsql is just that under normal circumstances,
# but this might not be where you want the backups...
@@ -53,11 +57,12 @@ echo "PostgreSQL maintenance"
umask 077
dbnames=`psql -q -t -A -d template1 -c "SELECT datname FROM pg_database WHERE datname != 'template0'"`
rc=$?
-file=${PGBACKUPDIR}/pgglobals_`date "+%Y%m%d"`
+now=`date "+%Y-%m-%dT%H:%M:%S"`
+file=${PGBACKUPDIR}/pgglobals_${now}
pg_dumpall -g | gzip -9 > ${file}.gz
for db in ${dbnames}; do
echo -n " $db"
- file=${PGBACKUPDIR}/pgdump_${db}_`date "+%Y%m%d"`
+ file=${PGBACKUPDIR}/pgdump_${db}_${now}
pg_dump ${PGDUMP_ARGS} -f ${file} ${db}
[ $? -gt 0 ] && rc=3
done
@@ -78,6 +83,7 @@ then
fi
# cleaning up old data
-find ${PGBACKUPDIR} -name 'pgdump_*' -a -atime +7 -delete
+find ${PGBACKUPDIR} \( -name 'pgdump_*' -o -name 'pgglobals_*' \) \
+ -a -mtime +${PGBACKUP_SAVE_DAYS} -delete
exit $rc
diff --git a/databases/postgresql7/files/dot.profile.in b/databases/postgresql7/files/dot.profile.in
index 96344d533921..6da911dfa6fa 100644
--- a/databases/postgresql7/files/dot.profile.in
+++ b/databases/postgresql7/files/dot.profile.in
@@ -8,6 +8,13 @@ PGDATA=${HOME}/data
export PATH PGLIB PGDATA
+# if you use the periodic script from share/postgresql/502.pgsql, you
+# can set these
+#PGDUMP_ARGS="-b -F c"
+#PGBACKUPDIR=${HOME}/backups
+#PGBACKUP_SAVE_DAYS=7
+#export PGBACKUPDIR PGDUMP_ARGS PGBACKUP_SAVE_DAYS
+
#You might want to set some locale stuff here
#PGDATESTYLE=ISO
#LC_ALL=sv_SE.ISO_8859-1
diff --git a/databases/postgresql7/files/patch-aj b/databases/postgresql7/files/patch-aj
deleted file mode 100644
index 94c0d6d79991..000000000000
--- a/databases/postgresql7/files/patch-aj
+++ /dev/null
@@ -1,118 +0,0 @@
---- src/bin/pg_passwd/pg_passwd.c.orig Sat Mar 24 01:54:55 2001
-+++ src/bin/pg_passwd/pg_passwd.c Wed Apr 18 04:54:14 2001
-@@ -7,6 +7,12 @@
- #include <errno.h>
- #include <time.h>
- #include <ctype.h>
-+
-+#if defined(__FreeBSD__)
-+#include <pwd.h> /* defines _PASSWORD_LEN, max # of characters in a password */
-+#include <sys/time.h> /* gettimeofday for password salt */
-+#endif
-+
- #define issaltchar(c) (isalnum((unsigned char) (c)) || (c) == '.' || (c) == '/')
-
- #ifdef HAVE_TERMIOS_H
-@@ -23,18 +29,31 @@
- * We assume that the output of crypt(3) is always 13 characters,
- * and that at most 8 characters can usefully be sent to it.
- *
-+ * For FreeBSD, take these values from /usr/include/pwd.h
- * Postgres usernames are assumed to be less than NAMEDATALEN chars long.
- */
-+#if defined(__FreeBSD__)
-+#define CLEAR_PASSWD_LEN _PASSWORD_LEN
-+#define CRYPTED_PASSWD_LEN _PASSWORD_LEN /* max length, not containing NULL */
-+#define SALT_LEN 10
-+#else
- #define CLEAR_PASSWD_LEN 8 /* not including null */
- #define CRYPTED_PASSWD_LEN 13 /* not including null */
-+#define SALT_LEN 3
-+#endif
-+
-+static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
-+ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
-+
-
- const char *progname;
-
- static void usage(void);
-+static void to64(char *s, long v, int n);
- static void read_pwd_file(char *filename);
- static void write_pwd_file(char *filename, char *bkname);
- static void encrypt_pwd(char key[CLEAR_PASSWD_LEN + 1],
-- char salt[3],
-+ char salt[SALT_LEN],
- char passwd[CRYPTED_PASSWD_LEN + 1]);
- static void prompt_for_username(char *username);
- static void prompt_for_password(char *prompt, char *password);
-@@ -47,6 +66,15 @@
- printf("Report bugs to <pgsql-bugs@postgresql.org>.\n");
- }
-
-+static void
-+to64(char *s, long v, int n)
-+{
-+ while (--n >= 0) {
-+ *s++ = itoa64[v&0x3f];
-+ v >>= 6;
-+ }
-+}
-+
- typedef struct
- {
- char *uname;
-@@ -154,7 +182,7 @@
- if (q != NULL)
- *(q++) = '\0';
-
-- if (strlen(p) != CRYPTED_PASSWD_LEN && strcmp(p, "+") != 0)
-+ if (strlen(p) > CRYPTED_PASSWD_LEN && strcmp(p, "+") != 0)
- {
- fprintf(stderr, "%s:%d: warning: invalid password length\n",
- filename, npwds + 1);
-@@ -221,15 +249,25 @@
-
- static void
- encrypt_pwd(char key[CLEAR_PASSWD_LEN + 1],
-- char salt[3],
-+ char salt[SALT_LEN],
- char passwd[CRYPTED_PASSWD_LEN + 1])
- {
-+#if !defined(__FreeBSD__)
- int n;
--
-+#endif
- /* select a salt, if not already given */
- if (salt[0] == '\0')
- {
-+#if defined(__FreeBSD__)
-+ struct timeval tv;
-+ srandomdev();
-+ gettimeofday(&tv,0);
-+ to64(&salt[0], random(), 3);
-+ to64(&salt[3], tv.tv_usec, 3);
-+ to64(&salt[6], tv.tv_sec, 2);
-+ salt[8] = '\0';
- srand(time(NULL));
-+#else
- do
- {
- n = rand() % 256;
-@@ -241,6 +279,7 @@
- } while (!issaltchar(n));
- salt[1] = n;
- salt[2] = '\0';
-+#endif
- }
-
- /* get encrypted password */
-@@ -335,7 +374,7 @@
- char *filename;
- char bkname[MAXPGPATH];
- char username[NAMEDATALEN];
-- char salt[3];
-+ char salt[SALT_LEN];
- char key[CLEAR_PASSWD_LEN + 1],
- key2[CLEAR_PASSWD_LEN + 1];
- char e_passwd[CRYPTED_PASSWD_LEN + 1];
diff --git a/databases/postgresql7/files/patch-src::include::port::freebsd.h b/databases/postgresql7/files/patch-src::include::port::freebsd.h
new file mode 100644
index 000000000000..01891af61d0e
--- /dev/null
+++ b/databases/postgresql7/files/patch-src::include::port::freebsd.h
@@ -0,0 +1,10 @@
+--- src/include/port/freebsd.h.orig Wed Jan 1 16:43:31 2003
++++ src/include/port/freebsd.h Wed Jan 1 16:43:39 2003
+@@ -7,6 +7,7 @@
+ #if defined(__sparc__)
+ #define NEED_SPARC_TAS_ASM
+ #define HAS_TEST_AND_SET
++typedef unsigned char slock_t;
+ #endif
+
+ #if defined(__alpha__)
diff --git a/databases/postgresql7/files/pgsql.sh.tmpl b/databases/postgresql7/files/pgsql.sh.tmpl
index d67d9b642f1b..98311c868ac3 100644
--- a/databases/postgresql7/files/pgsql.sh.tmpl
+++ b/databases/postgresql7/files/pgsql.sh.tmpl
@@ -3,38 +3,47 @@
# $FreeBSD$
#
# For postmaster startup options, edit $PGDATA/postgresql.conf
+#
+# Note that PGDATA is set in ~pgsql/.profile, don't try to manipulate it here!
+#
PREFIX=%%PREFIX%%
PGBIN=${PREFIX}/bin
+logfile=/var/log/pgsql
case $1 in
start)
- [ -d ${PREFIX}/lib ] && /sbin/ldconfig -m ${PREFIX}/lib
- touch /var/log/pgsql
- chmod 600 /var/log/pgsql
- chown pgsql:pgsql /var/log/pgsql
+ touch ${logfile}
+ chmod 600 ${logfile}
+ chown pgsql:pgsql ${logfile}
[ -x ${PGBIN}/pg_ctl ] && {
su -l pgsql -c \
- '[ -d ${PGDATA} ] && exec %%PREFIX%%/bin/pg_ctl start -s -w -l /var/log/pgsql'
+ "[ -d \${PGDATA} ] && exec ${PREFIX}/bin/pg_ctl start -s -w -l ${logfile}"
echo -n ' pgsql'
}
;;
stop)
[ -x ${PGBIN}/pg_ctl ] && {
- su -l pgsql -c 'exec %%PREFIX%%/bin/pg_ctl stop -s -m fast'
+ su -l pgsql -c "exec ${PREFIX}/bin/pg_ctl stop -s -m fast"
echo -n ' pgsql'
}
;;
+restart)
+ [ -x ${PGBIN}/pg_ctl ] && {
+ exec su -l pgsql -c "exec ${PREFIX}/bin/pg_ctl restart -s -m fast"
+ }
+ ;;
+
status)
[ -x ${PGBIN}/pg_ctl ] && {
- exec su -l pgsql -c 'exec %%PREFIX%%/bin/pg_ctl status'
+ exec su -l pgsql -c "exec ${PREFIX}/bin/pg_ctl status"
}
;;
*)
- echo "usage: `basename $0` {start|stop|status}" >&2
+ echo "usage: `basename $0` {start|stop|restart|status}" >&2
exit 64
;;
esac
diff --git a/databases/postgresql7/files/post-install-notes b/databases/postgresql7/files/post-install-notes
index cdf343002074..037eec446deb 100644
--- a/databases/postgresql7/files/post-install-notes
+++ b/databases/postgresql7/files/post-install-notes
@@ -22,7 +22,7 @@ ruby-postgres, py-PyGreSQL
For client access to PostgreSQL databases using the ruby & python
languages.
-postgresql-plperl, postgresql-pltcl & postgresql-plruby
+p5-postgresql-plperl, postgresql-pltcl & postgresql-plruby
For using perl5, tcl & ruby as procedural languages.
etc etc...