summaryrefslogtreecommitdiff
path: root/databases/postgresql93-server/files
diff options
context:
space:
mode:
authoradam <adam>2013-09-10 15:32:32 +0000
committeradam <adam>2013-09-10 15:32:32 +0000
commitf4ba615cc9bf448ebac9a6a749435c6fe07e46f1 (patch)
treeef2c53e491faea05c5ea8ccb8ccdfd9b86064cde /databases/postgresql93-server/files
parentb6607d44afc0d926b5bd519b8999c4817c00481d (diff)
downloadpkgsrc-f4ba615cc9bf448ebac9a6a749435c6fe07e46f1.tar.gz
Major enhancements in PostgreSQL 9.3 include:
* Add materialized views * Make simple views auto-updatable * Add many features for the JSON data type, including operators and functions to extract elements from JSON values * Implement SQL-standard LATERAL option for FROM-clause subqueries and function calls * Allow foreign data wrappers to support writes (inserts/updates/deletes) on foreign tables * Add a Postgres foreign data wrapper to allow access to other Postgres servers * Add support for event triggers * Add optional ability to checksum data pages and report corruption * Prevent non-key-field row updates from blocking foreign key checks * Greatly reduce System V shared memory requirements
Diffstat (limited to 'databases/postgresql93-server/files')
-rw-r--r--databases/postgresql93-server/files/pgsql.sh130
1 files changed, 130 insertions, 0 deletions
diff --git a/databases/postgresql93-server/files/pgsql.sh b/databases/postgresql93-server/files/pgsql.sh
new file mode 100644
index 00000000000..c502401e8f0
--- /dev/null
+++ b/databases/postgresql93-server/files/pgsql.sh
@@ -0,0 +1,130 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: pgsql.sh,v 1.1 2013/09/10 15:32:33 adam Exp $
+#
+# PostgreSQL database rc.d control script
+#
+# PROVIDE: pgsql
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# You will need to set some variables in /etc/rc.conf to start PostgreSQL:
+#
+# pgsql=YES
+#
+# Optionally, "pgsql_flags" contains options for the PostgreSQL postmaster, e.g.
+# pgsql_flags="-i" # allows TCP/IP connections
+# pgsql_flags="-i -l" # enables SSL connections
+# pgsql_home="/path/to/home" # path to pgsql database directory
+# See postmaster(1) for possible options.
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="pgsql"
+rcvar=${name}
+command="@PREFIX@/bin/pg_ctl"
+procname="@PREFIX@/bin/postgres"
+: ${pgsql_user:=@PGUSER@}
+: ${pgsql_group:=@PGGROUP@}
+: ${pgsql_home:=@PGHOME@}
+
+extra_commands="initdb reload"
+initdb_cmd="pgsql_initdb"
+start_precmd="pgsql_precmd"
+start_cmd="pgsql_start"
+restart_precmd="pgsql_precmd"
+restart_cmd="pgsql_restart"
+stop_cmd="pgsql_stop"
+reload_cmd="pgsql_reload"
+
+if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
+ load_rc_config $name
+elif [ -f /etc/rc.conf ]; then
+ . /etc/rc.conf
+fi
+
+command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog"
+if [ -n "${pgsql_flags}" ]; then
+ command_args="${command_args} -o \\\"${pgsql_flags}\\\""
+fi
+
+pgsql_precmd()
+{
+ ulimit -n 4096
+ if [ ! -d ${pgsql_home}/data/base ]; then
+ pgsql_initdb
+ fi
+}
+
+pgsql_initdb()
+{
+ if [ -d ${pgsql_home}/data/base ]; then
+ @ECHO@ "The PostgreSQL template databases have already been initialized."
+ @ECHO@ "Skipping database initialization."
+ else
+ @ECHO@ "Initializing PostgreSQL databases."
+ @MKDIR@ -p ${pgsql_home}
+ @CHOWN@ ${pgsql_user} ${pgsql_home}
+ @CHGRP@ ${pgsql_group} ${pgsql_home}
+ @CHMOD@ 0700 ${pgsql_home}
+ doit="@SU@ -m ${pgsql_user} -c '${command} init ${command_args}'"
+ eval $doit
+ fi
+}
+
+pgsql_start()
+{
+ @ECHO@ "Starting ${name}."
+ doit="@SU@ -m ${pgsql_user} -c '${command} start ${command_args}'"
+ eval $doit
+}
+
+pgsql_restart()
+{
+ @ECHO@ "Restarting ${name}."
+ doit="@SU@ -m ${pgsql_user} -c '${command} restart ${command_args}'"
+ eval $doit
+}
+
+pgsql_stop()
+{
+ @ECHO@ "Stopping ${name}."
+ doit="@SU@ -m ${pgsql_user} -c '${command} stop ${command_args}'"
+ eval $doit
+}
+
+pgsql_reload()
+{
+ @ECHO@ "Reloading ${name}."
+ doit="@SU@ -m ${pgsql_user} -c '${command} reload ${command_args}'"
+ eval $doit
+}
+
+if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
+ run_rc_command "$1"
+else
+ pidfile="${pgsql_home}/data/postmaster.pid"
+ case "$1" in
+ initdb)
+ eval ${initdb_cmd}
+ ;;
+ restart)
+ eval ${restart_precmd}
+ eval ${restart_cmd}
+ ;;
+ stop)
+ if [ -r "${pidfile}" ]; then
+ eval ${stop_cmd}
+ fi
+ ;;
+ reload)
+ eval ${reload_cmd}
+ ;;
+ *)
+ eval ${start_precmd}
+ eval ${start_cmd}
+ ;;
+ esac
+fi