2010-05-11 22:27:00 +02:00
|
|
|
Before you can run postgresql you'll need to create the
|
|
|
|
database files in /var/lib/pgsql. The following should do
|
|
|
|
the trick.
|
2016-10-13 16:11:08 +02:00
|
|
|
# su postgres -c "initdb -D /var/lib/pgsql/9.6/data --locale=en_US.UTF-8 -A md5 -W"
|
2010-05-11 22:27:00 +02:00
|
|
|
|
|
|
|
Additionally, a logrotation script and init script are included.
|
|
|
|
For production level log file handling please read
|
2016-10-13 16:11:08 +02:00
|
|
|
http://www.postgresql.org/docs/9.6/interactive/logfile-maintenance.html
|
2010-05-11 22:27:00 +02:00
|
|
|
|
|
|
|
In order to start postgresql at boot and stop it properly at shutdown,
|
|
|
|
make sure rc.postgresql is executable and add the following lines to
|
|
|
|
the following files:
|
|
|
|
|
|
|
|
/etc/rc.d/rc.local
|
|
|
|
==================
|
|
|
|
# Startup postgresql
|
|
|
|
if [ -x /etc/rc.d/rc.postgresql ]; then
|
|
|
|
/etc/rc.d/rc.postgresql start
|
|
|
|
fi
|
|
|
|
|
|
|
|
/etc/rc.d/rc.local_shutdown
|
|
|
|
===========================
|
|
|
|
# Stop postgres
|
|
|
|
if [ -x /etc/rc.d/rc.postgresql ]; then
|
|
|
|
/etc/rc.d/rc.postgresql stop
|
|
|
|
fi
|
|
|
|
|
2012-12-02 18:58:51 +01:00
|
|
|
Additionally, rc.postgresql script has additional modes for stop/restart:
|
2010-05-13 00:41:27 +02:00
|
|
|
force-stop|force-restart (i.e. pg_ctl 'fast' mode)
|
|
|
|
unclean-stop|unclean-restart (i.e. pg_ctl 'immediate' mode)
|
2016-10-13 16:11:08 +02:00
|
|
|
See http://www.postgresql.org/docs/9.6/static/app-pg-ctl.html
|
2013-10-26 07:40:32 +02:00
|
|
|
|
|
|
|
From PostgreSQL 9.3 we support in place database upgrades using pg_upgrade:
|
2016-10-13 16:11:08 +02:00
|
|
|
http://www.postgresql.org/docs/9.6/static/pgupgrade.html
|
2013-10-26 07:40:32 +02:00
|
|
|
|
2016-10-13 16:11:08 +02:00
|
|
|
A few hints for PostgreSQL 9.5 -> 9.6 upgrade:
|
|
|
|
- Don't remove old PostgreSQL 9.5.x package
|
|
|
|
- Install PostgreSQL 9.6.x, note that binaries are in
|
|
|
|
'/usr/lib64/postgresql/9.6/bin'
|
2013-10-26 07:40:32 +02:00
|
|
|
- Follow regular pg_upgrade docs
|
|
|
|
- Remove old package when transition is over, or read comments in
|
|
|
|
rc.postgresql if you want to run multiple PostgreSQL versions in parallel
|
2016-10-13 16:11:08 +02:00
|
|
|
- Run '/var/log/scripts/postgresql-9.6.x-x86_64-1_SBo' (doinst.sh script)
|
2013-10-26 07:40:32 +02:00
|
|
|
from filesystem root, to create symlinks in /usr/bin to PostgreSQL binaries
|
|
|
|
|
2010-05-13 00:41:27 +02:00
|
|
|
|
2010-10-25 05:40:41 +02:00
|
|
|
This script builds postgresql with some useful extension modules from
|
|
|
|
the contrib directory, see PG_EXTENSIONS in SlackBuild file.
|
2012-12-02 18:58:51 +01:00
|
|
|
To build PostgreSQL with all extensions, use the following command:
|
|
|
|
|
|
|
|
# PG_EXTENSIONS=ALL ./postgresql.SlackBuild
|
2010-05-11 22:27:00 +02:00
|
|
|
|
2015-01-22 00:37:52 +01:00
|
|
|
Please note that in order to actually use extension, you must execute
|
|
|
|
'CREATE EXTENSION [ IF NOT EXISTS ] extension_name' for each extension.
|
2015-01-08 11:03:57 +01:00
|
|
|
|
|
|
|
OpenLDAP Notes
|
|
|
|
|
|
|
|
With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
|
|
|
|
process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
|
|
|
|
also uses LDAP will crash on exit.
|
|
|
|
|
|
|
|
The LDAP wont be enabled (regardless of '--with-ldap' flag in slackbuild)
|
|
|
|
for affected OpenLDAP versions, so we've removed that build flag alltogether.
|
|
|
|
|
|
|
|
(OpenLDAP 2.4.31 is the version included in Slackware 14.1)
|