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/16/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/16/logfile-maintenance.html

In order to start postgresql at boot and stop it properly at shutdown,
make sure rc.postgresql16 is executable and add the following lines to
the following files:

	/etc/rc.d/rc.local
	==================
	# Startup postgresql
	if [ -x /etc/rc.d/rc.postgresql16 ]; then
		/etc/rc.d/rc.postgresql16 start
	fi

	/etc/rc.d/rc.local_shutdown
	===========================
	# Stop postgres
	if [ -x /etc/rc.d/rc.postgresql16 ]; then
		/etc/rc.d/rc.postgresql16 stop
	fi

Additionally, rc.postgresql16 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/16/app-pg-ctl.html

From PostgreSQL 9.3 we support in place database upgrades using pg_upgrade:
  https://www.postgresql.org/docs/16/pgupgrade.html

A few hints for PostgreSQL 15.x -> 16.x upgrade:
  - Don't remove old PostgreSQL 15.x package (yet)
  - Install PostgreSQL 16.x, note that binaries are in
    '/usr/lib64/postgresql16/16/bin'
  - Create database file for postgresql 16
    # su postgres -c "initdb -D /var/lib/pgsql/16/data --locale=en_US.UTF-8 -A md5 -W"
  - Adjust the pg_hba.conf in postgresql 16 to allow postgres user to connect
  - Run pg_upgrade (as postgres user)
	$ pg_upgrade --old-datadir /var/lib/pgsql/15/data/ --new-datadir /var/lib/pgsql/16/data/ --old-bindir /usr/lib64/postgresql15/15/bin/ --new-bindir /usr/lib64/postgresql16/16/bin/ -U postgres
  - Start postgresql 16 service
  - Optionally, vacuum all database
	/usr/lib{64}/postgresql16/16/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.
