aboutsummaryrefslogtreecommitdiff
path: root/databases/postgresql91-server/files
diff options
context:
space:
mode:
Diffstat (limited to 'databases/postgresql91-server/files')
-rw-r--r--databases/postgresql91-server/files/502.pgsql130
-rw-r--r--databases/postgresql91-server/files/dot.cshrc.in2
-rw-r--r--databases/postgresql91-server/files/dot.profile.in3
-rw-r--r--databases/postgresql91-server/files/patch-src-interfaces-jdbc-build-xml14
-rw-r--r--databases/postgresql91-server/files/patch-src-interfaces-libpgtcl-Makefile11
-rw-r--r--databases/postgresql91-server/files/patch-src-makefiles-Makefile.freebsd17
-rw-r--r--databases/postgresql91-server/files/pkg-message.server37
-rw-r--r--databases/postgresql91-server/files/pkgIndex.tcl.in4
-rw-r--r--databases/postgresql91-server/files/post-install-notes62
9 files changed, 115 insertions, 165 deletions
diff --git a/databases/postgresql91-server/files/502.pgsql b/databases/postgresql91-server/files/502.pgsql
index 84cdb9b5ad45..a1cf9ba4f2ee 100644
--- a/databases/postgresql91-server/files/502.pgsql
+++ b/databases/postgresql91-server/files/502.pgsql
@@ -11,79 +11,87 @@
# In public domain, do what you like with it,
# and use it at your own risk... :)
#
-######################################################################
-#
-# If you like to tweak the settings of the variables PGBACKUPDIR and
-# PGDUMP_ARGS, you should preferably set them in ~pgsql/.profile.
-# If set there, that setting will override the defaults here.
+
+# Define these variables in either /etc/periodic.conf or
+# /etc/periodic.conf.local to override the default values.
#
-######################################################################
+# daily_pgsql_backup_enable="YES" # do backup
+# daily_pgsql_vacuum_enable="YES" # do vacuum
+
+daily_pgsql_vaccum_enable="NO"
+daily_pgsql_backup_enable="NO"
-DIR=`dirname $0`
-progname=`basename $0`
-PRG=`cd $DIR; pwd `/$progname
+daily_pgsql_vacuum_args="-z"
+daily_pgsql_pgdump_args="-b -F c"
+# backupdir is relative to ~pgsql home directory unless it begins with a slash:
+daily_pgsql_backupdir="~pgsql/backups"
+daily_pgsql_savedays="7"
-# Run as user pgsql
-if [ `id -un` != pgsql ]; then
- su -l pgsql -c ${PRG}
- exit $?
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+ . /etc/defaults/periodic.conf
+ source_periodic_confs
fi
-# arguments to pg_dump
-PGDUMP_ARGS=${PGDUMP_ARGS:-"-b -F c"}
+# allow '~´ in dir name
+eval backupdir=${daily_pgsql_backupdir}
-# The directory where the backups will reside.
-# ${HOME} is pgsql's home directory
-PGBACKUPDIR=${PGBACKUPDIR:-${HOME}/backups}
+rc=0
-# 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}
+case "$daily_pgsql_backup_enable" in
+ [Yy][Ee][Ss])
-# PGBACKUPDIR must be writeable by user pgsql
-# ~pgsql is just that under normal circumstances,
-# but this might not be where you want the backups...
-if [ ! -d ${PGBACKUPDIR} ] ; then
- echo Creating ${PGBACKUPDIR}
- mkdir ${PGBACKUPDIR}
- chmod 700 ${PGBACKUPDIR}
-fi
+ # daily_pgsql_backupdir must be writeable by user pgsql
+ # ~pgsql is just that under normal circumstances,
+ # but this might not be where you want the backups...
+ if [ ! -d ${backupdir} ] ; then
+ echo Creating ${backupdir}
+ mkdir ${backupdir}; chmod 700 ${backupdir}; chown pgsql ${backupdir}
+ fi
-echo
-echo "PostgreSQL maintenance"
+ echo
+ echo "PostgreSQL maintenance"
-# Protect the data
-umask 077
-dbnames=`psql -q -t -A -d template1 -c "SELECT datname FROM pg_database WHERE datname != 'template0'"`
-rc=$?
-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}_${now}
- pg_dump ${PGDUMP_ARGS} -f ${file} ${db}
- [ $? -gt 0 ] && rc=3
-done
+ # Protect the data
+ umask 077
+ dbnames=`su -l pgsql -c "psql -q -t -A -d template1 -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"`
+ rc=$?
+ now=`date "+%Y-%m-%dT%H:%M:%S"`
+ file=${daily_pgsql_backupdir}/pgglobals_${now}
+ su -l pgsql -c "pg_dumpall -g | gzip -9 > ${file}.gz"
+ for db in ${dbnames}; do
+ echo -n " $db"
+ file=${backupdir}/pgdump_${db}_${now}
+ su -l pgsql -c "pg_dump ${daily_pgsql_pgdump_args} -f ${file} ${db}"
+ [ $? -gt 0 ] && rc=3
+ done
-if [ $rc -gt 0 ]; then
- echo
- echo "Errors were reported during backup."
-fi
+ if [ $rc -gt 0 ]; then
+ echo
+ echo "Errors were reported during backup."
+ fi
-echo
-echo "vacuuming..."
-vacuumdb -a -z -q
-if [ $? -gt 0 ]
-then
- echo
- echo "Errors were reported during vacuum."
- rc=3
-fi
+ # cleaning up old data
+ find ${backupdir} \( -name 'pgdump_*' -o -name 'pgglobals_*' \) \
+ -a -mtime +${daily_pgsql_savedays} -delete
+ ;;
+esac
+
+case "$daily_pgsql_vacuum_enable" in
+ [Yy][Ee][Ss])
-# cleaning up old data
-find ${PGBACKUPDIR} \( -name 'pgdump_*' -o -name 'pgglobals_*' \) \
- -a -mtime +${PGBACKUP_SAVE_DAYS} -delete
+ echo
+ echo "vacuuming..."
+ su -l pgsql -c "vacuumdb -a -q ${daily_pgsql_vacuum_args}"
+ if [ $? -gt 0 ]
+ then
+ echo
+ echo "Errors were reported during vacuum."
+ rc=3
+ fi
+ ;;
+esac
exit $rc
diff --git a/databases/postgresql91-server/files/dot.cshrc.in b/databases/postgresql91-server/files/dot.cshrc.in
index 724212c70b23..4069398b376e 100644
--- a/databases/postgresql91-server/files/dot.cshrc.in
+++ b/databases/postgresql91-server/files/dot.cshrc.in
@@ -1,5 +1,3 @@
-set path = ( %%PREFIX%%/bin $path )
-
setenv PGLIB %%PREFIX%%/lib
# note: PGDATA can be overridden by the -D startup option
diff --git a/databases/postgresql91-server/files/dot.profile.in b/databases/postgresql91-server/files/dot.profile.in
index 6da911dfa6fa..954e22eae8f8 100644
--- a/databases/postgresql91-server/files/dot.profile.in
+++ b/databases/postgresql91-server/files/dot.profile.in
@@ -1,6 +1,3 @@
-# both new and old layout's paths, but new path first...
-PATH=%%PREFIX%%/bin:${PATH}
-
PGLIB=%%PREFIX%%/lib
# note: PGDATA can be overridden by the -D startup option
diff --git a/databases/postgresql91-server/files/patch-src-interfaces-jdbc-build-xml b/databases/postgresql91-server/files/patch-src-interfaces-jdbc-build-xml
new file mode 100644
index 000000000000..89806a159665
--- /dev/null
+++ b/databases/postgresql91-server/files/patch-src-interfaces-jdbc-build-xml
@@ -0,0 +1,14 @@
+--- src/interfaces/jdbc/build.xml.orig Thu Jun 24 11:51:44 2004
++++ src/interfaces/jdbc/build.xml Thu Sep 2 01:51:36 2004
+@@ -113,10 +113,7 @@
+
+ <target name="compile" depends="prepare,check_versions,driver">
+
+- <available classname="org.postgresql.Driver" property="old.driver.present" />
+- <fail message="Old driver was detected on classpath or in jre/lib/ext, please remove and try again." if="old.driver.present" />
+-
+- <javac classpath="${srcdir}" srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
++ <javac includeAntRuntime="no" classpath="${srcdir}" srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
+ <!-- This is the core of the driver. It is common for all three versions. -->
+ <include name="${package}/*.java" />
+ <include name="${package}/core/**" />
diff --git a/databases/postgresql91-server/files/patch-src-interfaces-libpgtcl-Makefile b/databases/postgresql91-server/files/patch-src-interfaces-libpgtcl-Makefile
new file mode 100644
index 000000000000..44c60a29157e
--- /dev/null
+++ b/databases/postgresql91-server/files/patch-src-interfaces-libpgtcl-Makefile
@@ -0,0 +1,11 @@
+--- src/interfaces/libpgtcl/Makefile.orig Tue Feb 10 08:26:48 2004
++++ src/interfaces/libpgtcl/Makefile Thu Mar 11 21:12:25 2004
+@@ -21,7 +21,7 @@
+ OBJS= pgtcl.o pgtclCmds.o pgtclId.o
+
+ SHLIB_LINK = $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) \
+- $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt, $(LIBS)) $(THREAD_LIBS)
++ $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -L% -ltcl83 -ltcl84, $(LIBS)) $(THREAD_LIBS)
+
+ all: submake-libpq all-lib
+
diff --git a/databases/postgresql91-server/files/patch-src-makefiles-Makefile.freebsd b/databases/postgresql91-server/files/patch-src-makefiles-Makefile.freebsd
new file mode 100644
index 000000000000..9b4571d5dc30
--- /dev/null
+++ b/databases/postgresql91-server/files/patch-src-makefiles-Makefile.freebsd
@@ -0,0 +1,17 @@
+--- src/makefiles/Makefile.freebsd.orig Wed Aug 29 21:14:40 2001
++++ src/makefiles/Makefile.freebsd Sat Jan 31 17:51:25 2004
+@@ -7,7 +7,7 @@
+ endif
+
+ DLSUFFIX = .so
+-CFLAGS_SL = -fpic -DPIC
++CFLAGS_SL = -fPIC -DPIC
+
+ %.so: %.o
+ ifdef ELF_SYSTEM
+@@ -23,3 +23,5 @@
+ endif
+
+ sqlmansect = 7
++
++allow_nonpic_in_shlib = yes
diff --git a/databases/postgresql91-server/files/pkg-message.server b/databases/postgresql91-server/files/pkg-message.server
deleted file mode 100644
index 69826681eb42..000000000000
--- a/databases/postgresql91-server/files/pkg-message.server
+++ /dev/null
@@ -1,37 +0,0 @@
-======================================================================
-
-To initialize the database, you should run initdb as the "pgsql" user
-(if you want to use your locale for collation, edit ~pgsql/.profile
-and set the locale to your preference first).
-
-Example:
-
- su -l pgsql -c initdb
-
-You can then start PostgreSQL by running:
-
- /usr/local/etc/rc.d/010.pgsql.sh start
-
-For postmaster settings, see ~pgsql/data/postgresql.conf
-
-NB. FreeBSD's PostgreSQL port now by default logs to syslog
- See ~pgsql/data/postgresql.conf for more info
-
-For more tips, read ~pgsql/post-install-notes
-======================================================================
-Specific for the 7.4.1 update:
-
- A dump/restore is *not* required for those running 7.4.
-
- If you want to install the fixes in the information schema you need to
- reload it into the database. This is either accomplished by
- initializing a new cluster by running "initdb", or by running the
- following sequence of SQL commands in each database (ideally including
- template1) as a superuser in psql, after installing the new release:
-DROP SCHEMA information_schema CASCADE;
-\i /usr/local/pgsql/share/information_schema.sql
-
- Fixes to the information schema (from HISTORY):
- * Fix information schema for bit data types (Peter)
- * Fix information schema view constraint_column_usage for foreign
- keys (Peter)
diff --git a/databases/postgresql91-server/files/pkgIndex.tcl.in b/databases/postgresql91-server/files/pkgIndex.tcl.in
new file mode 100644
index 000000000000..bd8329b15c69
--- /dev/null
+++ b/databases/postgresql91-server/files/pkgIndex.tcl.in
@@ -0,0 +1,4 @@
+# Package-index file for Pgtcl-package. Enables you to load PostgreSQL
+# interface functions right into you TCL-interpreter as simply as
+# package require Pgtcl
+package ifneeded Pgtcl 1.3 "load %%PREFIX%%/lib/libpgtcl.so"
diff --git a/databases/postgresql91-server/files/post-install-notes b/databases/postgresql91-server/files/post-install-notes
deleted file mode 100644
index d52b24121539..000000000000
--- a/databases/postgresql91-server/files/post-install-notes
+++ /dev/null
@@ -1,62 +0,0 @@
-The PostgreSQL port has a collection of "side orders":
-
-postgresql-doc
- For all of the html documentation
-
-p5-Pg
- A perl5 API for client access to PostgreSQL databases.
-
-postgresql-tcltk
- If you want tcl/tk client support.
-
-postgresql-jdbc
- For Java JDBC support.
-
-postgresql-odbc
- For client access from unix applications using ODBC as access
- method. Not needed to access unix PostgreSQL servers from Win32
- using ODBC. See below.
-
-ruby-postgres, py-PyGreSQL
- For client access to PostgreSQL databases using the ruby & python
- languages.
-
-p5-postgresql-plperl, postgresql-pltcl & postgresql-plruby
- For using perl5, tcl & ruby as procedural languages.
-
-postgresql-contrib
- Lots of contributed utilities, postgresql functions and
- datatypes. There you find autovacuum, pgcrypto and many other cool
- things.
-
-etc etc...
-
-For procedural languages and postgresql functions, please note that
-you might have to update them when updating the server. For example,
-the "elog" method disappeared in postgresql-7.4, so postgresql-contrib
-must be updated along with the server.
-
-If you have many tables and many clients running, consider raising
-kern.maxfiles using sysctl(8), or reconfigure your kernel
-appropriately.
-
-You should vacuum and backup your database regularly. There is a
-periodic script, /usr/local/share/postgresql/502.pgsql, that you may
-find useful.
-
-To allow many simultaneous connections to your PostgreSQL server, you
-should raise the SystemV shared memory limits in your kernel. Here are
-example values for allowing up to 180 clients (tinkering in
-postgresql.conf also needed, of course):
- options SYSVSHM
- options SYSVSEM
- options SYSVMSG
- options SHMMAXPGS=65536
- options SEMMNI=40
- options SEMMNS=240
- options SEMUME=40
- options SEMMNU=120
-
-If you plan to access your PostgreSQL server using ODBC, please
-consider running the SQL script /usr/local/share/postgresql/odbc.sql
-to get the functions required for ODBC compliance.