summaryrefslogtreecommitdiff
path: root/databases/postgresql73-server/files
diff options
context:
space:
mode:
Diffstat (limited to 'databases/postgresql73-server/files')
-rw-r--r--databases/postgresql73-server/files/502.pgsql130
-rw-r--r--databases/postgresql73-server/files/dot.cshrc.in2
-rw-r--r--databases/postgresql73-server/files/patch-src-interfaces-jdbc-build-xml11
-rw-r--r--databases/postgresql73-server/files/patch-src-interfaces-libpgtcl-Makefile11
-rw-r--r--databases/postgresql73-server/files/patch-src-makefiles-Makefile.freebsd17
-rw-r--r--databases/postgresql73-server/files/patch-src:backend:utils:misc:postgresql.conf.sample24
-rw-r--r--databases/postgresql73-server/files/pkg-message.server17
-rw-r--r--databases/postgresql73-server/files/pkgIndex.tcl.in4
-rw-r--r--databases/postgresql73-server/files/post-install-notes57
9 files changed, 136 insertions, 137 deletions
diff --git a/databases/postgresql73-server/files/502.pgsql b/databases/postgresql73-server/files/502.pgsql
index 84cdb9b5ad45..a1cf9ba4f2ee 100644
--- a/databases/postgresql73-server/files/502.pgsql
+++ b/databases/postgresql73-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/postgresql73-server/files/dot.cshrc.in b/databases/postgresql73-server/files/dot.cshrc.in
index 724212c70b23..4069398b376e 100644
--- a/databases/postgresql73-server/files/dot.cshrc.in
+++ b/databases/postgresql73-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/postgresql73-server/files/patch-src-interfaces-jdbc-build-xml b/databases/postgresql73-server/files/patch-src-interfaces-jdbc-build-xml
new file mode 100644
index 000000000000..44a6e7960a2c
--- /dev/null
+++ b/databases/postgresql73-server/files/patch-src-interfaces-jdbc-build-xml
@@ -0,0 +1,11 @@
+--- src/interfaces/jdbc/build.xml.orig Fri Mar 28 09:55:21 2003
++++ src/interfaces/jdbc/build.xml Fri Mar 28 09:57:29 2003
+@@ -101,7 +101,7 @@
+
+ <!-- This is the core of the driver. It is common for all three versions. -->
+ <target name="compile" depends="prepare,check_versions,driver">
+- <javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
++ <javac includeAntRuntime="no" srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
+ <include name="${package}/**" />
+
+ <exclude name="${package}/jdbc1/**" unless="jdbc1"/>
diff --git a/databases/postgresql73-server/files/patch-src-interfaces-libpgtcl-Makefile b/databases/postgresql73-server/files/patch-src-interfaces-libpgtcl-Makefile
new file mode 100644
index 000000000000..318deac9d737
--- /dev/null
+++ b/databases/postgresql73-server/files/patch-src-interfaces-libpgtcl-Makefile
@@ -0,0 +1,11 @@
+--- src/interfaces/libpgtcl/Makefile.orig Wed Dec 11 05:08:05 2002
++++ src/interfaces/libpgtcl/Makefile Sat Oct 23 17:37:20 2004
+@@ -25,7 +25,7 @@
+ # If crypt is a separate library, rather than part of libc, it may need
+ # to be referenced separately to keep (broken) linkers happy. (This is
+ # braindead; users of libpq should not need to know what it depends on.)
+-SHLIB_LINK+= $(filter -L%, $(LDFLAGS)) $(filter -lcrypt, $(LIBS))
++SHLIB_LINK+= $(filter -L%, $(LDFLAGS)) $(filter -lcrypt -ltcl83 -ltcl84, $(LIBS))
+
+ all: submake-libpq all-lib
+
diff --git a/databases/postgresql73-server/files/patch-src-makefiles-Makefile.freebsd b/databases/postgresql73-server/files/patch-src-makefiles-Makefile.freebsd
new file mode 100644
index 000000000000..9b4571d5dc30
--- /dev/null
+++ b/databases/postgresql73-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/postgresql73-server/files/patch-src:backend:utils:misc:postgresql.conf.sample b/databases/postgresql73-server/files/patch-src:backend:utils:misc:postgresql.conf.sample
new file mode 100644
index 000000000000..e9ad9322157e
--- /dev/null
+++ b/databases/postgresql73-server/files/patch-src:backend:utils:misc:postgresql.conf.sample
@@ -0,0 +1,24 @@
+--- src/backend/utils/misc/postgresql.conf.sample.orig Sun Mar 30 23:38:13 2003
++++ src/backend/utils/misc/postgresql.conf.sample Thu Oct 28 05:24:07 2004
+@@ -119,7 +119,7 @@
+ #client_min_messages = notice # Values, in order of decreasing detail:
+ # debug5, debug4, debug3, debug2, debug1,
+ # log, info, notice, warning, error
+-#silent_mode = false
++silent_mode = true
+
+ #log_connections = false
+ #log_pid = false
+@@ -145,9 +145,9 @@
+ #
+ # Syslog
+ #
+-#syslog = 0 # range 0-2
+-#syslog_facility = 'LOCAL0'
+-#syslog_ident = 'postgres'
++syslog = 2 # range 0-2
++syslog_facility = 'LOCAL0'
++syslog_ident = 'postgres'
+
+
+ #
diff --git a/databases/postgresql73-server/files/pkg-message.server b/databases/postgresql73-server/files/pkg-message.server
deleted file mode 100644
index 6027012da44c..000000000000
--- a/databases/postgresql73-server/files/pkg-message.server
+++ /dev/null
@@ -1,17 +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
-For more tips, read ~pgsql/post-install-notes
-======================================================================
diff --git a/databases/postgresql73-server/files/pkgIndex.tcl.in b/databases/postgresql73-server/files/pkgIndex.tcl.in
new file mode 100644
index 000000000000..bd8329b15c69
--- /dev/null
+++ b/databases/postgresql73-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/postgresql73-server/files/post-install-notes b/databases/postgresql73-server/files/post-install-notes
deleted file mode 100644
index 037eec446deb..000000000000
--- a/databases/postgresql73-server/files/post-install-notes
+++ /dev/null
@@ -1,57 +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. You get a neat GUI, pgaccess, as
- a bonus!
-
-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.
-
-etc etc...
-
-Note that many files have moved around compared to previous versions
-of PostgreSQL. For example, plpgsql.so and all other language modules
-are now in /usr/local/lib/postgresql.
-
-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.