diff options
Diffstat (limited to 'system/postgresql15/README.SBo')
-rw-r--r-- | system/postgresql15/README.SBo | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/system/postgresql15/README.SBo b/system/postgresql15/README.SBo new file mode 100644 index 0000000000..347868b3ec --- /dev/null +++ b/system/postgresql15/README.SBo @@ -0,0 +1,60 @@ +Before you can run postgresql you'll need to create the +database files in /var/lib/pgsql. The following should do +the trick. + # su postgres -c "initdb -D /var/lib/pgsql/15/data --locale=en_US.UTF-8 -A md5 -W" + +Additionally, a logrotation script and init script are included. +For production level log file handling please read +https://www.postgresql.org/docs/15/logfile-maintenance.html + +In order to start postgresql at boot and stop it properly at shutdown, +make sure rc.postgresql15 is executable and add the following lines to +the following files: + + /etc/rc.d/rc.local + ================== + # Startup postgresql + if [ -x /etc/rc.d/rc.postgresql15 ]; then + /etc/rc.d/rc.postgresql15 start + fi + + /etc/rc.d/rc.local_shutdown + =========================== + # Stop postgres + if [ -x /etc/rc.d/rc.postgresql15 ]; then + /etc/rc.d/rc.postgresql15 stop + fi + +Additionally, rc.postgresql15 script has additional modes for stop/restart: + force-stop|force-restart (i.e. pg_ctl 'fast' mode) + unclean-stop|unclean-restart (i.e. pg_ctl 'immediate' mode) +See https://www.postgresql.org/docs/15/app-pg-ctl.html + +From PostgreSQL 9.3 we support in place database upgrades using pg_upgrade: + https://www.postgresql.org/docs/15/pgupgrade.html + +A few hints for PostgreSQL 14.x -> 15.x upgrade: + - Don't remove old PostgreSQL 14.x package (yet) + - Install PostgreSQL 15.x, note that binaries are in + '/usr/lib64/postgresql15/15/bin' + - Create database file for postgresql 15 + # su postgres -c "initdb -D /var/lib/pgsql/15/data --locale=en_US.UTF-8 -A md5 -W" + - Adjust the pg_hba.conf in postgresql 15 to allow postgres user to connect + - Run pg_upgrade (as postgres user) + $ pg_upgrade --old-datadir /var/lib/pgsql/14/data/ --new-datadir /var/lib/pgsql/15/data/ --old-bindir /usr/lib64/postgresql/14/bin/ --new-bindir /usr/lib64/postgresql15/15/bin/ -U postgres + - Start postgresql 15 service + - Optionally, vacuum all database + /usr/lib{64}/postgresql15/15/bin/vacuumdb -U postgres --all --analyze-in-stages + To remove old's cluster data files, run: + ./delete_old_cluster.sh + - Remove old package when transition is over, or read comments in + rc.postgresql if you want to run multiple PostgreSQL versions in parallel + +This script builds postgresql with some useful extension modules from +the contrib directory, see PG_EXTENSIONS in SlackBuild file. +To build PostgreSQL with all extensions, use the following command: + + # PG_EXTENSIONS=ALL ./postgresql.SlackBuild + +Please note that in order to actually use extension, you must execute +'CREATE EXTENSION [ IF NOT EXISTS ] extension_name' for each extension. |