--- /dev/null
+#################################
+# RPM-specific Makefile #
+# https://yum.postgresql.org #
+# #
+# Devrim Gunduz #
+# devrim@gunduz.org #
+#################################
+
+# Predefined values
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=.rhel10
+SPECFILE="postgresql-19.spec"
+
+# Now, include global Makefile
+include ../../../../global/Makefile.global
--- /dev/null
+../main/postgresql-19-A4.pdf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-Makefile.regress
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-README.rpm-dist
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-check-db-dir
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-conf.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-ecpg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-libs.conf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-perl-rpath.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-pg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-rpm-pgsql.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-setup
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-tmpfiles.d
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-var-run-socket.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam.suse
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.service
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.spec
\ No newline at end of file
--- /dev/null
+#################################
+# RPM-specific Makefile #
+# https://yum.postgresql.org #
+# #
+# Devrim Gunduz #
+# devrim@gunduz.org #
+#################################
+
+# Predefined values
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=.rhel8
+SPECFILE="postgresql-19.spec"
+
+# Now, include global Makefile
+include ../../../../global/Makefile.global
--- /dev/null
+../main/postgresql-19-A4.pdf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-Makefile.regress
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-README.rpm-dist
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-check-db-dir
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-conf.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-ecpg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-libs.conf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-perl-rpath.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-pg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-rpm-pgsql.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-setup
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-tmpfiles.d
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-var-run-socket.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam.suse
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.service
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.spec
\ No newline at end of file
--- /dev/null
+#################################
+# RPM-specific Makefile #
+# https://yum.postgresql.org #
+# #
+# Devrim Gunduz #
+# devrim@gunduz.org #
+#################################
+
+# Predefined values
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=.rhel9
+SPECFILE="postgresql-19.spec"
+
+# Now, include global Makefile
+include ../../../../global/Makefile.global
--- /dev/null
+../main/postgresql-19-A4.pdf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-Makefile.regress
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-README.rpm-dist
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-check-db-dir
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-conf.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-ecpg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-libs.conf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-perl-rpath.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-pg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-rpm-pgsql.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-setup
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-tmpfiles.d
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-var-run-socket.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam.suse
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.service
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.spec
\ No newline at end of file
--- /dev/null
+#################################
+# RPM-specific Makefile #
+# https://yum.postgresql.org #
+# #
+# Devrim Gunduz #
+# devrim@gunduz.org #
+#################################
+
+# Predefined values
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=.f41
+SPECFILE="postgresql-19.spec"
+
+# Now, include global Makefile
+include ../../../../global/Makefile.global
--- /dev/null
+../main/postgresql-19-A4.pdf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-Makefile.regress
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-README.rpm-dist
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-check-db-dir
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-conf.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-ecpg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-libs.conf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-perl-rpath.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-pg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-rpm-pgsql.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-setup
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-tmpfiles.d
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-var-run-socket.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam.suse
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.service
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.spec
\ No newline at end of file
--- /dev/null
+#################################
+# RPM-specific Makefile #
+# https://yum.postgresql.org #
+# #
+# Devrim Gunduz #
+# devrim@gunduz.org #
+#################################
+
+# Predefined values
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=.f42
+SPECFILE="postgresql-19.spec"
+
+# Now, include global Makefile
+include ../../../../global/Makefile.global
--- /dev/null
+../main/postgresql-19-A4.pdf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-Makefile.regress
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-README.rpm-dist
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-check-db-dir
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-conf.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-ecpg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-libs.conf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-perl-rpath.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-pg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-rpm-pgsql.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-setup
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-tmpfiles.d
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-var-run-socket.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam.suse
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.service
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.spec
\ No newline at end of file
--- /dev/null
+#################################
+# RPM-specific Makefile #
+# https://yum.postgresql.org #
+# #
+# Devrim Gunduz #
+# devrim@gunduz.org #
+#################################
+
+# Predefined values
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=".sles15"
+SPECFILE="postgresql-19.spec"
+
+# Now, include global Makefile
+include ../../../../global/Makefile.global
--- /dev/null
+../main/postgresql-19-A4.pdf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-Makefile.regress
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-README.rpm-dist
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-check-db-dir
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-conf.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-ecpg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-libs.conf
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-perl-rpath.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-pg_config.h
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-rpm-pgsql.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-setup
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-tmpfiles.d
\ No newline at end of file
--- /dev/null
+../main/postgresql-19-var-run-socket.patch
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.pam.suse
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.service
\ No newline at end of file
--- /dev/null
+../main/postgresql-19.spec
\ No newline at end of file
--- /dev/null
+#################################
+# RPM-specific Makefile #
+# https://yum.postgresql.org #
+# #
+# Devrim Gunduz #
+# devrim@gunduz.org #
+#################################
+
+# Predefined values
+
+ARCH=`rpm --eval "%{_arch}"`
+DIR=`pwd`
+DIST=.f99
+SPECFILE="postgresql-19.spec"
+
+# Now, include global Makefile
+include ../../../../global/Makefile.global
--- /dev/null
+#
+# Simplified makefile for running the PostgreSQL regression tests
+# in an RPM installation
+#
+
+# maximum simultaneous connections for parallel tests
+MAXCONNOPT =
+ifdef MAX_CONNECTIONS
+MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
+endif
+
+# locale
+NOLOCALE =
+ifdef NO_LOCALE
+NOLOCALE += --no-locale
+endif
+
+srcdir := .
+
+REGRESS_OPTS += --dlpath=.
+
+pg_regress_locale_flags = $(if $(ENCODING),--encoding=$(ENCODING)) $(NOLOCALE)
+
+pg_regress_installcheck = ./pg_regress --inputdir=$(srcdir) --bindir='/usr/pgsql-87/bin/' $(pg_regress_locale_flags)
+
+# Test input and expected files. These are created by pg_regress itself, so we
+# don't have a rule to create them. We do need rules to clean them however.
+ifile_list := $(subst .source,, $(notdir $(wildcard $(srcdir)/input/*.source)))
+input_files := $(foreach file, $(ifile_list), sql/$(file).sql)
+ofile_list := $(subst .source,, $(notdir $(wildcard $(srcdir)/output/*.source)))
+output_files := $(foreach file, $(ofile_list), expected/$(file).out)
+
+abs_srcdir := $(shell pwd)
+abs_builddir := $(shell pwd)
+
+check: installcheck-parallel
+
+installcheck: cleandirs
+ $(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule --max-connections=1 $(EXTRA_TESTS)
+
+installcheck-parallel: cleandirs
+ $(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(EXTRA_TESTS)
+
+# The tests command the server to write into testtablespace and results.
+# On a SELinux-enabled system this will fail unless we mark those directories
+# as writable by the server.
+cleandirs:
+ -rm -rf testtablespace results
+ mkdir testtablespace results
+ if test -x /usr/bin/chcon && ! test -f /.dockerenv; then \
+ /usr/bin/chcon -u system_u -r object_r -t postgresql_db_t testtablespace results ; \
+ fi
+
+# old interfaces follow...
+
+runcheck: check
+runtest: installcheck
+runtest-parallel: installcheck-parallel
+
+
+##
+## Clean up
+##
+
+clean distclean maintainer-clean:
+ rm -f $(output_files) $(input_files)
+ rm -rf testtablespace
+ rm -rf results tmp_check log
+ rm -f regression.diffs regression.out regress.out run_check.out
--- /dev/null
+README.rpm-dist
+-----------------------------------------------------------------------------
+Version 19, for the PostgreSQL 19 RPM set.
+Devrim Gündüz <devrim@gunduz.org>
+-----------------------------------------------------------------------------
+
+Contents:
+ 1.) Introduction and QuickStart
+ 2.) Upgrading an installation
+ 3.) PostgreSQL RPM packages and rationale
+ 4.) Starting multiple postmasters
+ 5.) Regression Testing
+ 6.) Starting postmaster automatically on startup
+ 7.) Grand Unified Configuration(GUC) File
+ 8.) Logging set up
+ 9.) Rebuilding from the source RPM
+10.) Contrib files
+11.) Further Information Resource
+
+INTRODUCTION
+-----------------------------------------------------------------------------
+This document exists to explain the layout of the RPMs for PostgreSQL, to
+describe various RPM specifics, and to document special features found
+in the RPMset.
+
+This document is written to be applicable to version 19 of PostgreSQL,
+which is the current version of the RPMs as of this writing. More to the
+point, versions prior to 19 are not documented here.
+
+Official PostgreSQL Global Development Group RPMs carry a 'PGDG after the
+release number. Other RPMsets as distributed with Linux distributions may
+have a different release number and initials.
+
+If you want to stay up-to-date on the PostgreSQL core itself, you may
+want to use PGDG set, instead of the binaries supplied by distribution.
+
+These RPMs do not support any sort of major version upgrading process
+other than that documented in the regular documentation. That is, you
+must dump, upgrade, initdb, and restore your data if you are
+performing a major version update. This is not needed for minor version
+updates.
+
+QUICKSTART (note that this requires postgresql19-server installed)
+-----------------------------------------------------------------------------
+For a fresh installation, you will need to initialize the cluster first. Run:
+
+ postgresql-19-setup initdb
+
+as root, and it will prepare a new database cluster for you. Then you will
+need to start PostgreSQL. Again as root, run:
+
+ systemctl start postgresql-19.service
+
+You will probably also want to do
+
+ systemctl enable postgresql-19.service
+
+so that the postmaster is automatically started during future reboots.
+
+These commands will start a postmaster that will listen on localhost and Unix
+socket 5432 only. Edit /var/lib/pgsql/19/data/postgresql.conf and pg_hba.conf
+if you want to allow remote access -- see the section on Grand Unified
+Configuration.
+
+The file /var/lib/pgsql/19/.bash_profile is packaged to help with the
+setting of environment variables. Users should not edit this file, because
+it may be overwritten during every new installation. However, you can create
+~/.pgsql_profile file, and add your customizations there.
+
+The user 'postgres' is created during installation of the server subpackage.
+This user by default is UID and GID 26. The user has the default shell set to
+bash, and the home directory set to /var/lib/pgsql. This user also has no
+default password. If you want to be able to su to it from a non-root account
+or login as 'postgres' you will need to set a password using passwd.
+
+In the default installation, only postgres user is allowed to access to
+the database server, because initdb in the RPMs pick up "peer" auth
+method in the RPMs.
+
+All the binaries are installed under /usr/pgsql-19/bin. However, the
+tools that are compatible with the previous releases are symlinked under
+/usr/bin directory. Please note that RPMs are using alternatives method
+in here, so whenever a newer major version is installed, symlinks will
+point to the new version. Here is the current list of the binaries that
+are under $PATH:
+
+- clusterdb
+- createdb
+- createuser
+- dropdb
+- dropuser
+- pg_basebackup
+- pg_combinebackup
+- pg_createsubscriber
+- pg_dump
+- pg_dumpall
+- pg_restore
+- pg_walsummary
+- psql
+- reindexdb
+- vacuumdb
+
+You may want to add /usr/pgsql-19/bin to your $PATH variable in
+/etc/profile, if you want to use them easily. However, please note that
+this may lead to some unintentional side effects, so be careful.
+
+
+UPGRADING AN INSTALLATION
+-----------------------------------------------------------------------------
+For a minor-version upgrade (such as 19.1 to 19.2), just install the
+new RPMs; there's usually nothing more to it than that (installing new minor
+version will restart database). Upgrading across a major release of PostgreSQL
+(for example, from 12.x to 19.x) requires more effort.
+
+If you are performing major version upgrade (for example, from 13.x to 19.x),
+there are three solutions:
+
+- pg_upgrade: PGDG RPMs allow side-by-side installation of multiple major versions.
+ Use pg_upgrade of the "greater" major version to perform the upgrade. See
+ /usr/pgsql-19/bin/pg_upgrade --help for details.
+- Traditional dump/reload: This is dumping and reloading process to bring your
+ data into the new version. *Before* upgrading, run pg_dumpall to extract all
+ your data into a SQL file. Shut down the old postmaster, upgrade to the new
+ version RPMs, initdb, and run the dump file through psql to restore your data.
+ You can also pg_dumpall global objects + pg_dump individual databases and restore
+ them.
+- Logical replication: Logical replication can also be used between two major version.
+ However please read the limitations here first:
+ https://www.postgresql.org/docs/current/logical-replication-restrictions.html
+
+RPMs also support in-place upgrade from the immediately previous major release.
+Currently, you can upgrade in-place from 17.x to 19.x. Just run:
+
+$ /usr/pgsql-19/bin/postgresql-19-setup upgrade
+
+Please note that 17 and 19 contrib RPMs need to be installed for this feature
+to work. You can also upgrade from other major versions either by editing the
+setup script, or passing PostgreSQL major version as the 3rd argument to the
+setup script.
+
+POSTGRESQL RPM PACKAGES AND RATIONALE.
+-----------------------------------------------------------------------------
+PostgreSQL is split up into multiple packages so that users can 'pick and
+choose' what pieces are needed, and what dependencies are required.
+
+The RPMset is packaged in the following subpackages:
+
+postgresql19: Key clients and libraries, and documentation
+postgresql19-contrib: The contrib modules (extensions) included in PostgreSQL
+postgresql19-devel: Development libraries and include files
+postgresql19-docs: Documentation, including PDF file
+postgresql19-ecpg: Run-time library for ECPG programs
+postgresql19-ecpg-devel: Development files for ECPG
+postgresql19-libs: Client shared libraries
+postgresql19-libs-oauth: Client shared libraries - OAuth flow
+postgresql19-llvmjit: Just-in-time compilation support
+postgresql19-test: The regression tests and associated files
+postgresql19-plperl: The Perl procedural language for PostgreSQL
+postgresql19-plpython: The Python procedural language for PostgreSQL
+postgresql19-pltcl: The Tcl procedural language for PostgreSQL
+postgresql19-test: The test suite distributed with PostgreSQL
+postgresql19-server: Server executables and data files
+
+postgresql-jdbc (version independent) and postgresql19-odbc are separate (s)rpms.
+
+You have to install postgresql19 and postgresql19-libs to do anything.
+postgresql19-server is needed unless you only plan to use the clients to work
+with a remote PostgreSQL server. The others are optional.
+
+Pgtcl is distributed via postgresql19-tcl package.
+
+-devel subpackage requires additional repos on RHEL and its derivatives.
+
+On RHEL 9 and 8, enable codeready-builder repo:
+
+$ subscription-manager repos --enable=codeready-builder-for-rhel-9-x86_64-rpms
+$ subscription-manager repos --enable=codeready-builder-for-rhel-8-x86_64-rpms
+
+On Rocky / AlmaLinux 8, enable crb repo:
+$ crb enable
+
+RPM FILE LOCATIONS.
+-----------------------------------------------------------------------------
+To be in compliance with the Linux FHS, the PostgreSQL RPMs install files in
+a manner not consistent with most of the PostgreSQL documentation. According
+to the standard PostgreSQL documentation, PostgreSQL is installed under the
+directory /usr/local/pgsql, with executables, source, and data existing in
+various subdirectories.
+
+Different distributions have different ideas of some of these file locations.
+In particular, the documentation directory can be /usr/doc, /usr/doc/packages,
+/usr/share/doc, /usr/share/doc/packages, or some other similar path.
+
+However, PGDG RPMS for the Red Hat / Rocky Linux / AlmaLinux / Fedora / SLES RPM's
+install the files like this:
+
+Executables: /usr/pgsql-19/bin (and /usr/bin, as described above)
+Libraries: /usr/pgsql-19/lib
+Documentation: /usr/pgsql-19/doc
+Contrib documentation: /usr/pgsql-19/doc
+Source: not installed
+Data: /var/lib/pgsql/19/data
+Backup area: /var/lib/pgsql/19/backups
+Templates: /usr/pgsql-19/share
+Procedural Languages: /usr/pgsql-19/lib
+Development Headers: /usr/pgsql-19/include
+Other shared data: /usr/pgsql-19/share
+Regression tests: /usr/pgsql-19/lib/test
+
+While it may seem gratuitous to place these files in different locations, the
+FHS requires it -- distributions should not ever touch /usr/local. It may
+also seem like more work to keep track of where everything is -- but, that's
+the beauty of RPM -- you don't have to keep track of the files, RPM does it
+for you.
+
+These RPMs are designed to be LSB-compliant -- if you find this not to be the
+case, please let us know by way of the pgsql-pkg-yum@lists.postgresql.org
+mailing list.
+
+-------------------------------------------------------------------------------
+MULTIPLE POSTMASTERS (For the same PostgreSQL version)
+-------------------------------------------------------------------------------
+The postgresql-server RPM contains a 'unit file' that is used to start the
+postmaster. The current version of this script has logic to be able to start
+multiple postmasters, with different data areas, listening on different ports,
+etc. To use this functionality requires root access.
+
+Here are the steps:
+
+1.) First, you will need to create a new unit file for the new cluster.
+ You can give any name in here. To distinguish the cluster, you can
+ add the service name or port value to the unit file name:
+
+ cp /lib/systemd/system/postgresql-19.service /etc/systemd/system/postgresql-19-secondary.service
+
+2.) Edit this file, and change PGDATA. Please note that you can give
+ any directory name in here that postgres can access. You don't
+ have to create this directory now, it will be created in the next step:
+
+ Environment=PGDATA=/var/lib/pgsql/19/data-secondary
+
+3.) Initialize the cluster:
+
+ /usr/pgsql-19/bin/postgresql-19-setup initdb postgresql-19-secondary
+
+4.) Edit postgresql.conf to change the port, address, tcpip settings, etc.
+
+5.) Start the postmaster with 'systemctl start postgresql-19-secondary.service'
+
+When doing a major-version upgrade of a secondary postmaster, mention the
+service name in the postgresql-19-setup command, for example 'postgresql-19-setup
+upgrade secondary'. This will let postgresql-19-setup find the correct data
+directory from the service file.
+
+REGRESSION TESTING
+-------------------------------------------------------------------------------
+If you install the postgresql19-test RPM then you can run the PostgreSQL
+regression tests. These tests stress your database installation and produce
+results that give you assurances that the installation is complete, and that
+your database machine is up to the task.
+
+To run the regression tests under the RPM installation, make sure that the
+postmaster has been started (if not, su to root and do "systemctl start
+postgresql-19.service"), cd to /usr/pgsql-19/lib/test/regress, su to
+postgres, and execute "make check". This command will start the
+regression tests and will both show the results to the screen and store
+the results in the file regress.out.
+
+If any tests fail, see the file regression.diffs in that directory for details,
+and read the "Regression Tests" section of the PostgreSQL documentation to
+find out whether the differences are actually significant. If you need help
+interpreting the results, contact the pgsql-general list at
+postgresql.org.
+
+After testing, say "make clean" to remove the files generated by the test
+script.
+
+STARTING POSTMASTER AUTOMATICALLY AT SYSTEM STARTUP
+-------------------------------------------------------------------------------
+Fedora / Red Hat / CentOS use the systemd package to manage server startup.
+A systemd unit file for PostgreSQL is provided in the server package, as
+/lib/systemd/system/postgresql-19.service. To start the postmaster manually,
+as root run
+ systemctl start postgresql-19.service
+To shut the postmaster down,
+ systemctl stop postgresql-19.service
+These two commands only change the postmaster's current status. If you
+want the postmaster to be started automatically during future system startups,
+run
+ systemctl enable postgresql-19.service
+To undo that again,
+ systemctl disable postgresql-19.service
+See "man systemctl" for other possible subcommands.
+
+GRAND UNIFIED CONFIGURATION (GUC) FILE
+-------------------------------------------------------------------------------
+The PostgreSQL server has many tunable parameters -- the file
+/var/lib/pgsql/19/data/postgresql.conf is the master configuration file for the
+whole system.
+
+The RPM ships with a mostly-default file -- you will need to tune the
+parameters for your installation. In particular, you might want to allow
+nonlocal TCP/IP socket connections -- in order to allow these, you will need
+to edit the postgresql.conf file. The line in question contains the string
+'listen_addresses' -- you need to both uncomment the line and set the value
+to '*' to get the postmaster to accept nonlocal connections. You'll also need
+to adjust pg_hba.conf appropriately.
+
+LOGGING SET UP
+-------------------------------------------------------------------------------
+By default, the postmaster's stderr log is directed into files placed in a
+log subdirectory of the data directory (ie, /var/lib/pgsql/19/data/log).
+The out-of-the-box configuration rotates among seven files, one for each
+day of the week. You can adjust this by changing postgresql.conf settings.
+
+REBUILDING FROM SOURCE RPM
+-------------------------------------------------------------------------------
+If your distribution is not supported by the binary RPMs from PostgreSQL.org,
+you will need to rebuild from the source RPM. Download the .src.rpm for this
+release. You will need to be root to rebuild, unless you have set up
+a non-root build environment (which is the recommended method anyway).
+
+Install the source RPM with rpm -i, then cd to the rpm building area
+(which is /usr/src/redhat by default). You will have to have a full
+development environment to rebuild the full RPM set.
+
+This release of the RPMset includes the ability to conditionally build
+sets of packages. The parameters, their defaults, and the meanings are:
+
+beta 0 #build with cassert and do not strip the binaries
+enabletaptests 1 #enable TAP tests
+icu 1 #build with ICU support
+kerberos 1 #use Kerberos 5 support.
+ldap 1 #build with LDAP support.
+libnuma 1 #build with NUMA support.
+liburing 1 #build with io_uring support (except on RHEL 8)
+llvm 1 #build with llvm support
+nls 1 #build with national language support.
+pam 1 #build with PAM support.
+plperl 1 #build the PL/Perl procedural language package.
+plpython 1 #build the PL/Python procedural language package.
+pltcl 1 #build the PL/Tcl procedural language package.
+runselftest 0 #do "make check" during the build.
+sdt 1 #build with dtrace.
+selinux 1 #build with SELinux.
+ssl 1 #use OpenSSL support.
+test 1 #build the postgresql19-test package.
+uuid 1 #build contrib/uuid-ossp
+xml 1 #build with XML support
+
+To use these defines, invoke a rebuild like this:
+rpmbuild --rebuild --define 'plpython 0' --define 'pltcl 0' \
+ --define 'test 0' --define 'runselftest 1' --define 'kerberos 0' \
+ postgresql19-19.0-1PGDG.rhel9.src.rpm
+This line would disable the plpython, pltcl, and test subpackages, enable
+the regression test run during build, and disable kerberos support.
+
+You might need to disable runselftest if there is an installed version of
+PostgreSQL that is a different major version from what you are trying to
+build. The self test tends to pick up the installed libpq.so shared library
+in place of the one being built :-(, so if that isn't compatible the test will
+fail. Also, you can't use runselftest when doing the build as root.
+
+More of these conditionals will be added in the future, and also some of them
+may be removed.
+
+CONTRIB FILES
+-------------------------------------------------------------------------------
+The contents of the contrib tree are packaged into the -contrib subpackage
+and are processed with make and make install. Most of the modules are in
+/usr/pgsql-19/lib for loadable modules, and binaries are in
+/usr/pgsql-19/bin. In the future these files may be split out,
+depending upon function and dependencies.
+
+
+MORE INFORMATION
+-------------------------------------------------------------------------------
+You can get more information at http://www.postgresql.org and
+https://yum.postgresql.org
+
+Please help make this packaging better -- let us know if you find problems, or
+better ways of doing things. You can reach us by e-mail at
+pgsql-pkg-yum@lists.postgresql.org
+-------------------------------------------------------------------------------
--- /dev/null
+#!/bin/sh
+
+# This script verifies that the postgresql data directory has been correctly
+# initialized. We do not want to automatically initdb it, because that has
+# a risk of catastrophic failure (ie, overwriting a valuable database) in
+# corner cases, such as a remotely mounted database on a volume that's a
+# bit slow to mount. But we can at least emit a message advising newbies
+# what to do.
+
+PGDATA="$1"
+
+if [ -z "$PGDATA" ]
+then
+ echo "Usage: $0 database-path"
+ exit 1
+fi
+
+# PGVERSION is the full package version, e.g., 19.0
+# Note: the specfile inserts the correct value during package build
+PGVERSION=xxxx
+# PGMAJORVERSION is major version, e.g., 19 (this should match PG_VERSION)
+PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\.[0-9]*\).*$/\1/'`
+# PREVMAJORVERSION is the previous major version, e.g., 15 for upgrades
+# Note: the specfile inserts the correct value during package build
+PREVMAJORVERSION=xxxx
+# PGDOCDIR is the directory containing the package's documentation
+# Note: the specfile inserts the correct value during package build
+PGDOCDIR=xxxx
+
+# Check for the PGDATA structure
+if [ -f "$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base" ]
+then
+ # Check version of existing PGDATA
+ if [ x`cat "$PGDATA/PG_VERSION"` = x"$PGMAJORVERSION" ]
+ then
+ : A-OK
+ elif [ x`cat "$PGDATA/PG_VERSION"` = x"$PREVMAJORVERSION" ]
+ then
+ echo $"An old version of the database format was found."
+ echo $"Use \"postgresql-setup upgrade\" to upgrade to version $PGMAJORVERSION."
+ echo $"See $PGDOCDIR/README.rpm-dist for more information."
+ exit 1
+ else
+ echo $"An old version of the database format was found."
+ echo $"You need to dump and reload before using PostgreSQL $PGMAJORVERSION."
+ echo $"See $PGDOCDIR/README.rpm-dist for more information."
+ exit 1
+ fi
+else
+ # No existing PGDATA! Warn the user to initdb it.
+ echo $"\"$PGDATA\" is missing or empty."
+ echo $"Use \"/usr/pgsql-19/bin/postgresql-19-setup initdb\" to initialize the database cluster."
+ echo $"See $PGDOCDIR/README.rpm-dist for more information."
+ exit 1
+fi
+
+exit 0
--- /dev/null
+--- src/backend/utils/misc/postgresql.conf.sample.old 2025-03-17 10:21:27.833589978 +0300
++++ src/backend/utils/misc/postgresql.conf.sample 2025-03-17 10:22:53.648146234 +0300
+@@ -468,31 +468,31 @@
+
+ # - Where to Log -
+
+-#log_destination = 'stderr' # Valid values are combinations of
++log_destination = 'stderr' # Valid values are combinations of
+ # stderr, csvlog, jsonlog, syslog, and
+ # eventlog, depending on platform.
+ # csvlog and jsonlog require
+ # logging_collector to be on.
+
+ # This is used when logging to stderr:
+-#logging_collector = off # Enable capturing of stderr, jsonlog,
++logging_collector = on # Enable capturing of stderr, jsonlog,
+ # and csvlog into log files. Required
+ # to be on for csvlogs and jsonlogs.
+ # (change requires restart)
+
+ # These are only used if logging_collector is on:
+-#log_directory = 'log' # directory where log files are written,
++log_directory = 'log' # directory where log files are written,
+ # can be absolute or relative to PGDATA
+-#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
++log_filename = 'postgresql-%a.log' # log file name pattern,
+ # can include strftime() escapes
+ #log_file_mode = 0600 # creation mode for log files,
+ # begin with 0 to use octal notation
+-#log_rotation_age = 1d # Automatic rotation of logfiles will
++log_rotation_age = 1d # Automatic rotation of logfiles will
+ # happen after that time. 0 disables.
+-#log_rotation_size = 10MB # Automatic rotation of logfiles will
++log_rotation_size = 0 # Automatic rotation of logfiles will
+ # happen after that much log output.
+ # 0 disables.
+-#log_truncate_on_rotation = off # If on, an existing log file with the
++log_truncate_on_rotation = on # If on, an existing log file with the
+ # same name as the new log file will be
+ # truncated rather than appended to.
+ # But such truncation only occurs on
+@@ -585,7 +585,7 @@
+ #log_duration = off # log statement duration
+ #log_error_verbosity = default # terse, default, or verbose messages
+ #log_hostname = off
+-#log_line_prefix = '%m [%p] ' # special values:
++log_line_prefix = '%m [%p] ' # special values:
+ # %a = application name
+ # %u = user name
+ # %d = database name
--- /dev/null
+/*
+ * Kluge to support multilib installation of both 32- and 64-bit RPMS:
+ * we need to arrange that header files that appear in both RPMs are
+ * identical. Hence, this file is architecture-independent and calls
+ * in an arch-dependent file that will appear in just one RPM.
+ *
+ * To avoid breaking arches not explicitly supported by Red Hat, we
+ * use this indirection file *only* on known multilib arches.
+ *
+ * Note: this may well fail if user tries to use gcc's -I- option.
+ * But that option is deprecated anyway.
+ */
+#if defined(__x86_64__)
+#include "ecpg_config_x86_64.h"
+#elif defined(__i386__)
+#include "ecpg_config_i386.h"
+#elif defined(__ppc64__) || defined(__powerpc64__)
+#include "ecpg_config_ppc64.h"
+#elif defined(__ppc__) || defined(__powerpc__)
+#include "ecpg_config_ppc.h"
+#elif defined(__s390x__)
+#include "ecpg_config_s390x.h"
+#elif defined(__s390__)
+#include "ecpg_config_s390.h"
+#elif defined(__sparc__) && defined(__arch64__)
+#include "ecpg_config_sparc64.h"
+#elif defined(__sparc__)
+#include "ecpg_config_sparc.h"
+#endif
--- /dev/null
+/usr/pgsql-19/lib/
--- /dev/null
+--- src/pl/plperl/GNUmakefile.old 2022-09-13 11:28:29.530773939 +0100
++++ src/pl/plperl/GNUmakefile 2022-09-13 11:28:51.739821139 +0100
+@@ -55,6 +55,9 @@
+
+ SHLIB_LINK = $(perl_embed_ldflags)
+
++# Force rpath to be used even though we disable it everywhere else
++SHLIB_LINK += $(rpath)
++
+ # see https://www.postgresql.org/message-id/flat/8c4fcb72-2574-ff7c-4c25-1f032d4a2a57%40enterprisedb.com
+ ifeq ($(PORTNAME), cygwin)
+ SHLIB_LINK += -Wl,--export-all-symbols
--- /dev/null
+/*
+ * Kluge to support multilib installation of both 32- and 64-bit RPMS:
+ * we need to arrange that header files that appear in both RPMs are
+ * identical. Hence, this file is architecture-independent and calls
+ * in an arch-dependent file that will appear in just one RPM.
+ *
+ * To avoid breaking arches not explicitly supported by Red Hat, we
+ * use this indirection file *only* on known multilib arches.
+ *
+ * Note: this may well fail if user tries to use gcc's -I- option.
+ * But that option is deprecated anyway.
+ */
+#if defined(__x86_64__)
+#include "pg_config_x86_64.h"
+#elif defined(__i386__)
+#include "pg_config_i386.h"
+#elif defined(__ppc64__) || defined(__powerpc64__)
+#include "pg_config_ppc64.h"
+#elif defined(__ppc__) || defined(__powerpc__)
+#include "pg_config_ppc.h"
+#elif defined(__s390x__)
+#include "pg_config_s390x.h"
+#elif defined(__s390__)
+#include "pg_config_s390.h"
+#elif defined(__sparc__) && defined(__arch64__)
+#include "pg_config_sparc64.h"
+#elif defined(__sparc__)
+#include "pg_config_sparc.h"
+#endif
--- /dev/null
+--- src/Makefile.global.in.old 2025-01-13 01:25:22.654145258 -0600
++++ src/Makefile.global.in 2025-01-13 01:25:34.049330728 -0600
+@@ -82,7 +82,7 @@
+ # Installation directories
+ #
+ # These are set by the equivalent --xxxdir configure options. We
+-# append "postgresql" to some of them, if the string does not already
++# append "pgsql" to some of them, if the string does not already
+ # contain "pgsql" or "postgres", in order to avoid directory clutter.
+ #
+ # In a PGXS build, we cannot use the values inserted into Makefile.global
+@@ -103,14 +103,14 @@
+ datadir := @datadir@
+ ifeq "$(findstring pgsql, $(datadir))" ""
+ ifeq "$(findstring postgres, $(datadir))" ""
+-override datadir := $(datadir)/postgresql
++override datadir := $(datadir)/pgsql
+ endif
+ endif
+
+ sysconfdir := @sysconfdir@
+ ifeq "$(findstring pgsql, $(sysconfdir))" ""
+ ifeq "$(findstring postgres, $(sysconfdir))" ""
+-override sysconfdir := $(sysconfdir)/postgresql
++override sysconfdir := $(sysconfdir)/pgsql
+ endif
+ endif
+
+@@ -119,7 +119,7 @@
+ pkglibdir = $(libdir)
+ ifeq "$(findstring pgsql, $(pkglibdir))" ""
+ ifeq "$(findstring postgres, $(pkglibdir))" ""
+-override pkglibdir := $(pkglibdir)/postgresql
++override pkglibdir := $(pkglibdir)/pgsql
+ endif
+ endif
+
+@@ -128,7 +128,7 @@
+ pkgincludedir = $(includedir)
+ ifeq "$(findstring pgsql, $(pkgincludedir))" ""
+ ifeq "$(findstring postgres, $(pkgincludedir))" ""
+-override pkgincludedir := $(pkgincludedir)/postgresql
++override pkgincludedir := $(pkgincludedir)/pgsql
+ endif
+ endif
+
+@@ -137,7 +137,7 @@
+ docdir := @docdir@
+ ifeq "$(findstring pgsql, $(docdir))" ""
+ ifeq "$(findstring postgres, $(docdir))" ""
+-override docdir := $(docdir)/postgresql
++override docdir := $(docdir)/pgsql
+ endif
+ endif
+
--- /dev/null
+#!/usr/bin/bash
+#
+# postgresql-setup Initialization and upgrade operations for PostgreSQL
+
+# PGVERSION is the full package version, e.g., 19.0
+# Note: the specfile inserts the correct value during package build
+PGVERSION=xxx
+# PGMAJORVERSION is major version, e.g., 19 (this should match PG_VERSION)
+PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\.[0-9]*\).*$/\1/'`
+# PGENGINE is the directory containing the postgres executable file.
+# Note: the specfile inserts the correct value during package build
+PGENGINE=xxxx
+# PREVMAJORVERSION is the previous major version, e.g., 15, for upgrades
+PREVMAJORVERSION=xxx
+# PREVPGENGINE is the directory containing the previous PostgreSQL version executable
+PREVPGENGINE=/usr/pgsql-$PREVMAJORVERSION/bin
+# PREVDATADIR is the directory containing the previous PostgreSQL version data
+PREVDATADIR=/var/lib/pgsql/$PREVMAJORVERSION/data
+
+# TODO: Provide a conf file that can override these settings
+
+# The second parameter is the new database version, i.e. $PGMAJORVERSION in this case.
+# Use "postgresql-$PGMAJORVERSION" service, if not specified.
+SERVICE_NAME="$2"
+if [ x"$SERVICE_NAME" = x ]
+then
+ SERVICE_NAME=postgresql-$PGMAJORVERSION
+fi
+
+# The third parameter is the old database version, i.e. $PREVMAJORVERSION in this case.
+# Use "postgresql-$PREVMAJORVERSION" service, if not specified.
+OLD_SERVICE_NAME="$3"
+if [ x"$OLD_SERVICE_NAME" = x ]
+then
+ OLD_SERVICE_NAME=postgresql-$PREVMAJORVERSION
+fi
+
+USAGE_STRING=$"
+Usage: $0 {initdb|check_upgrade|upgrade} [SERVICE_NAME]
+
+Script is aimed to help sysadmin with basic database cluster administration.
+
+The SERVICE_NAME is used for selection of proper unit configuration file; For
+more info and howto/when use this script please look at README.rpm-dist file.
+The 'postgresql' string is used when no SERVICE_NAME is explicitly passed.
+
+Available operation mode:
+ initdb Create a new PostgreSQL database cluster. This is usually the
+ first action you perform after PostgreSQL server installation.
+ check_upgrade Checks whether the old cluster can be upgraded to the new version
+ or not.
+ upgrade Upgrade PostgreSQL database cluster to be usable with new
+ server. Use this if you upgraded your PostgreSQL server to
+ newer major version (currently from $PREVMAJORVERSION \
+to $PGMAJORVERSION).
+
+Environment:
+ PGSETUP_INITDB_OPTIONS Options carried by this variable are passed to
+ subsequent call of \`initdb\` binary (see man
+ initdb(1)). This variable is used also during
+ 'upgrade' mode because the new cluster is actually
+ re-initialized from the old one.
+ PGSETUP_PGUPGRADE_OPTIONS Options in this variable are passed next to the
+ subsequent call of \`pg_upgrade\`. For more info
+ about possible options please look at man
+ pg_upgrade(1).
+ PGSETUP_DEBUG Set to '1' if you want to see debugging output."
+
+# note that these options are useful at least for help2man processing
+case "$1" in
+ --version)
+ echo "PostgreSQL setup script for version $PGVERSION"
+ exit 0
+ ;;
+ --help|--usage)
+ echo "$USAGE_STRING"
+ exit 0
+ ;;
+esac
+
+# this parsing technique fails for PGDATA pathnames containing spaces,
+# but there's not much I can do about it given systemctl's output format...
+PGDATA=`systemctl show -p Environment "${SERVICE_NAME}.service" |
+ sed 's/^Environment=//' | tr ' ' '\n' |
+ sed -n 's/^PGDATA=//p' | tail -n 1`
+if [ x"$PGDATA" = x ]; then
+ echo "failed to find PGDATA setting in ${SERVICE_NAME}.service"
+ exit 1
+fi
+
+# Find the unit file for new version.
+if [ -f "/etc/systemd/system/${SERVICE_NAME}.service" ]
+then
+ SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service"
+elif [ -f "/usr/lib/systemd/system/${SERVICE_NAME}.service" ]
+then
+ SERVICE_FILE="/usr/lib/systemd/system/${SERVICE_NAME}.service"
+else
+ echo "Could not find systemd unit file ${SERVICE_NAME}.service"
+ exit 1
+fi
+
+# Log file for pg_upgrade
+PGUPLOG=/var/lib/pgsql/$PGMAJORVERSION/pgupgrade.log
+# Log file for initdb
+PGLOG=/var/lib/pgsql/$PGMAJORVERSION/initdb.log
+
+export PGDATA
+
+# For SELinux we need to use 'runuser' not 'su'
+if [ -x /sbin/runuser ]
+then
+ SU=/sbin/runuser
+else
+ SU=su
+fi
+
+script_result=0
+
+# code shared between initdb and upgrade actions
+perform_initdb(){
+ if [ ! -e "$PGDATA" ]; then
+ mkdir -p "$PGDATA" || return 1
+ chown postgres:postgres "$PGDATA"
+ chmod go-rwx "$PGDATA"
+ fi
+ # Clean up SELinux tagging for PGDATA
+ [ -x /sbin/restorecon ] && /sbin/restorecon "$PGDATA"
+
+ # Create the initdb log file if needed
+ if [ ! -e "$PGLOG" -a ! -h "$PGLOG" ]; then
+ touch "$PGLOG" || return 1
+ chown postgres:postgres "$PGLOG"
+ chmod go-rwx "$PGLOG"
+ [ -x /sbin/restorecon ] && /sbin/restorecon "$PGLOG"
+ fi
+
+ # Initialize the database
+ initdbcmd="$PGENGINE/initdb --pgdata='$PGDATA' -A scram-sha-256 --auth-local=peer"
+ initdbcmd+=" $PGSETUP_INITDB_OPTIONS"
+
+ $SU -l postgres -c "$initdbcmd" >> "$PGLOG" 2>&1 < /dev/null
+
+ # Exit if initdb fails, to prevent the log/ directory to be created.
+ # Otherwise a subsequent initdb will not even start.
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+
+ # Create directory for PostgreSQL log files
+ mkdir "$PGDATA/log"
+ chown postgres:postgres "$PGDATA/log"
+ chmod go-rwx "$PGDATA/log"
+ [ -x /sbin/restorecon ] && /sbin/restorecon "$PGDATA/log"
+
+ if [ -f "$PGDATA/PG_VERSION" ]; then
+ return 0
+ fi
+ return 1
+}
+
+initdb(){
+ if [ -f "$PGDATA/PG_VERSION" ]; then
+ echo $"Data directory is not empty!"
+ echo
+ script_result=1
+ else
+ echo -n $"Initializing database ... "
+ if perform_initdb; then
+ echo $"OK"
+ else
+ echo $"failed, see $PGLOG"
+ script_result=1
+ fi
+ echo
+ fi
+}
+
+check_upgrade(){
+ # must see previous version in PG_VERSION
+ if [ ! -f "$PREVDATADIR/PG_VERSION" -o \
+ x`cat "$PREVDATADIR/PG_VERSION"` != x"$PREVMAJORVERSION" ]
+ then
+ echo
+ echo $"Cannot upgrade because the database in $PGDATA is not of"
+ echo $"compatible previous version $PREVMAJORVERSION."
+ echo
+ exit 1
+ fi
+
+ # Set up log file for pg_upgrade
+ rm -f "$PGUPLOG"
+ touch "$PGUPLOG" || exit 1
+ chown postgres:postgres "$PGUPLOG"
+ chmod go-rwx "$PGUPLOG"
+ [ -x /sbin/restorecon ] && /sbin/restorecon "$PGUPLOG"
+
+ # Make sure that the user initdb'ed the new cluster:
+ if [ ! -f "$PGDATA/PG_VERSION" ]
+ then
+ echo
+ echo $"Please initialize the new cluster before upgrading."
+ echo $"You can run this script with the ''initdb'' parameter:"
+ echo $""
+ echo $"$PGENGINE/postgresql-$PGVERSION-setup initdb"
+ echo
+ exit 1
+ fi
+
+ # Copy the current pg_hba.conf file to new cluster:
+
+ HBA_CONF_BACKUP_EXISTS=0
+
+ cp "$PREVDATADIR/pg_hba.conf" "$PGDATA/"
+ HBA_CONF_BACKUP_EXISTS=1
+
+ # For fluent upgrade 'postgres' user should be able to connect
+ # to any database without password. Temporarily, no other type
+ # of connection is needed.
+ echo "local all postgres peer" > "$PREVDATADIR/pg_hba.conf"
+
+ echo -n $"Performing upgrade check: "
+
+ # Do the upgrade
+ $SU -l postgres -c "$PGENGINE/pg_upgrade \
+ '--old-bindir=$PREVPGENGINE' \
+ '--new-bindir=$PGENGINE' \
+ '--old-datadir=$PREVDATADIR' \
+ '--new-datadir=$PGDATA' \
+ --check \
+ --user=postgres \
+ $PGSETUP_PGUPGRADE_OPTIONS" \
+ >> "$PGUPLOG" 2>&1 < /dev/null
+ if [ $? -ne 0 ]; then
+ # pg_upgrade failed
+ script_result=1
+ fi
+ if [ $script_result -eq 0 ]; then
+ echo $"OK"
+ else
+ # Clean up after failure
+ echo "Upgrade failed. Removing the new cluster. Please re-initdb the new cluster."
+ rm -rf "$PGDATA"
+ echo $"failed"
+ fi
+ echo
+ echo $"See $PGUPLOG for details."
+}
+
+
+upgrade(){
+# Perform the upgrade check first:
+check_upgrade
+ echo -n $"Upgrading database: "
+
+ # Do the upgrade
+ $SU -l postgres -c "$PGENGINE/pg_upgrade \
+ '--old-bindir=$PREVPGENGINE' \
+ '--new-bindir=$PGENGINE' \
+ '--old-datadir=$PREVDATADIR' \
+ '--new-datadir=$PGDATA' \
+ --link \
+ --user=postgres \
+ $PGSETUP_PGUPGRADE_OPTIONS" \
+ >> "$PGUPLOG" 2>&1 < /dev/null
+ if [ $? -ne 0 ]; then
+ # pg_upgrade failed
+ script_result=1
+ fi
+ if [ $script_result -eq 0 ]; then
+ echo $"OK"
+ echo
+ echo $"pg_hba.conf configuration file of the new cluster was replaced by the one in the old cluster."
+ else
+ # Clean up after failure
+ rm -rf "$PGDATA"
+ echo $"failed"
+ fi
+ echo
+ echo $"See $PGUPLOG for details."
+}
+
+# See how we were called.
+case "$1" in
+ initdb)
+ initdb
+ ;;
+ upgrade)
+ upgrade
+ ;;
+ check_upgrade)
+ check_upgrade
+ ;;
+ *)
+ echo >&2 "$USAGE_STRING"
+ exit 2
+esac
+
+exit $script_result
--- /dev/null
+d /run/postgresql 0755 postgres postgres -
--- /dev/null
+--- src/backend/utils/misc/guc_tables.c.old 2025-01-13 01:27:40.440387857 -0600
++++ src/backend/utils/misc/guc_tables.c 2025-01-13 01:28:11.679896303 -0600
+@@ -4508,7 +4508,7 @@
+ GUC_LIST_INPUT | GUC_LIST_QUOTE | GUC_SUPERUSER_ONLY
+ },
+ &Unix_socket_directories,
+- DEFAULT_PGSOCKET_DIR,
++ DEFAULT_PGSOCKET_DIR ", /tmp",
+ NULL, NULL, NULL
+ },
+
+--- src/include/pg_config_manual.h.old 2025-01-13 01:27:54.953624073 -0600
++++ src/include/pg_config_manual.h 2025-01-13 01:28:11.679896303 -0600
+@@ -190,7 +190,7 @@
+ * support them yet.
+ */
+ #ifndef WIN32
+-#define DEFAULT_PGSOCKET_DIR "/tmp"
++#define DEFAULT_PGSOCKET_DIR "/run/postgresql"
+ #else
+ #define DEFAULT_PGSOCKET_DIR ""
+ #endif
--- /dev/null
+#%PAM-1.0
+auth include password-auth
+account include password-auth
--- /dev/null
+#%PAM-1.0
+auth include common-auth
+account include common-account
--- /dev/null
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during package upgrades. It is recommended to use systemd
+# "dropin" feature; i.e. create file with suffix .conf under
+# /etc/systemd/system/postgresql-19.service.d directory overriding the
+# unit's defaults. You can also use "systemctl edit postgresql-19"
+# Look at systemd.unit(5) manual page for more info.
+
+# Note: changing PGDATA will typically require adjusting SELinux
+# configuration as well.
+
+# Note: do not use a PGDATA pathname containing spaces, or you will
+# break postgresql-19-setup.
+[Unit]
+Description=PostgreSQL 19 database server
+Documentation=https://www.postgresql.org/docs/19/static/
+After=syslog.target
+After=network-online.target
+
+[Service]
+Type=notify
+
+User=postgres
+Group=postgres
+
+# Note: avoid inserting whitespace in these Environment= lines, or you may
+# break postgresql-setup.
+
+# Location of database directory
+Environment=PGDATA=/var/lib/pgsql/19/data/
+
+# Where to send early-startup messages from the server (before the logging
+# options of postgresql.conf take effect)
+# This is normally controlled by the global default set by systemd
+# StandardOutput=syslog
+
+# Disable OOM kill on postgres main process
+OOMScoreAdjust=-1000
+Environment=PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj
+Environment=PG_OOM_ADJUST_VALUE=0
+
+ExecStartPre=/usr/pgsql-19/bin/postgresql-19-check-db-dir ${PGDATA}
+ExecStart=/usr/pgsql-19/bin/postgres -D ${PGDATA}
+ExecReload=/bin/kill -HUP $MAINPID
+KillMode=mixed
+KillSignal=SIGINT
+
+# Do not set any timeout value, so that systemd will not kill postgres
+# main process during crash recovery.
+TimeoutSec=0
+
+# 0 is the same as infinity, but "infinity" needs systemd 229
+TimeoutStartSec=0
+
+TimeoutStopSec=1h
+
+[Install]
+WantedBy=multi-user.target
--- /dev/null
+%global debug_package %{nil}
+%undefine _package_note_file
+
+# These are macros to be used with find_lang and other stuff
+%global packageversion 190
+%global pgpackageversion 19
+%global prevmajorversion 18
+%global sname postgresql
+%global pgbaseinstdir /usr/pgsql-%{pgmajorversion}
+
+%global pgdg_build_timestamp %(date +"%Y%m%d")
+%global beta 1
+%{?beta:%global __os_install_post /usr/lib/rpm/brp-compress}
+
+%{!?enabletaptests:%global enabletaptests 1}
+%{!?icu:%global icu 1}
+%{!?kerberos:%global kerberos 1}
+%{!?ldap:%global ldap 1}
+%{!?libnuma:%global libnuma 1}
+# RHEL 8 does not have io_uring support:
+%if 0%{?rhel} == 8
+%{!?liburing:%global liburing 0}
+%else
+%{!?liburing:%global liburing 1}
+%endif
+%{!?llvm:%global llvm 1}
+%{!?nls:%global nls 1}
+%{!?pam:%global pam 1}
+%{!?plperl:%global plperl 1}
+%{!?plpython3:%global plpython3 1}
+%{!?pltcl:%global pltcl 1}
+%{!?runselftest:%global runselftest 0}
+%{!?sdt:%global sdt 1}
+%{!?selinux:%global selinux 1}
+%{!?ssl:%global ssl 1}
+%{!?test:%global test 1}
+%{!?uuid:%global uuid 1}
+%{!?xml:%global xml 1}
+
+#Filter out some Perl "dependencies"
+%global __requires_exclude ^perl\\((PostgresVersion|PostgresNode|RecursiveCopy|SimpleTee|TestLib|PostgreSQL::Test::BackgroundPsql)
+%global __provides_exclude ^perl\\((PostgresVersion|PostgresNode|RecursiveCopy|SimpleTee|TestLib|PostgreSQL::Test::BackgroundPsql)
+
+Summary: PostgreSQL client programs and libraries
+Name: %{sname}%{pgmajorversion}
+Version: 19
+%if 0%{?suse_version} >= 1500
+# SuSE upstream packages have release numbers like 150200.5.19.1
+# which overrides our packages. Increase our release number on SuSE.
+Release: alpha_%{pgdg_build_timestamp}_PGDG%{?dist}
+%else
+Release: alpha_%{pgdg_build_timestamp}_PGDG%{?dist}
+%endif
+License: PostgreSQL
+Url: https://www.postgresql.org/
+Source0: https://download.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2
+Source4: %{sname}-%{pgmajorversion}-Makefile.regress
+Source5: %{sname}-%{pgmajorversion}-pg_config.h
+Source6: %{sname}-%{pgmajorversion}-README.rpm-dist
+Source7: %{sname}-%{pgmajorversion}-ecpg_config.h
+Source9: %{sname}-%{pgmajorversion}-libs.conf
+Source12: https://www.postgresql.org/files/documentation/pdf/%{pgpackageversion}/%{sname}-%{pgpackageversion}-A4.pdf
+%if 0%{?suse_version}
+Source14: %{sname}-%{pgmajorversion}.pam.suse
+%else
+Source14: %{sname}-%{pgmajorversion}.pam
+%endif
+Source17: %{sname}-%{pgmajorversion}-setup
+Source10: %{sname}-%{pgmajorversion}-check-db-dir
+Source18: %{sname}-%{pgmajorversion}.service
+Source19: %{sname}-%{pgmajorversion}-tmpfiles.d
+
+Patch1: %{sname}-%{pgmajorversion}-rpm-pgsql.patch
+Patch3: %{sname}-%{pgmajorversion}-conf.patch
+Patch5: %{sname}-%{pgmajorversion}-var-run-socket.patch
+Patch6: %{sname}-%{pgmajorversion}-perl-rpath.patch
+
+BuildRequires: perl glibc-devel bison >= 3.0.4 flex >= 2.6.1
+BuildRequires: gcc-c++ libcurl-devel >= 7.61.0
+BuildRequires: perl(ExtUtils::MakeMaker)
+BuildRequires: readline-devel zlib-devel >= 1.0.4
+BuildRequires: libxml2-devel libxslt-devel
+
+# lz4 dependency
+%if 0%{?suse_version} >= 1500
+BuildRequires: liblz4-devel
+Requires: liblz4-1
+%endif
+%if 0%{?rhel} || 0%{?fedora}
+BuildRequires: lz4-devel
+Requires: lz4-libs
+%endif
+
+# zstd dependency
+%if 0%{?suse_version} >= 1500
+BuildRequires: libzstd-devel >= 1.4.0
+Requires: libzstd1 >= 1.4.0
+%endif
+%if 0%{?rhel} || 0%{?fedora}
+BuildRequires: libzstd-devel >= 1.4.0
+Requires: libzstd >= 1.4.0
+%endif
+
+# This dependency is needed for Source 16:
+%if 0%{?fedora} || 0%{?rhel}
+BuildRequires: perl-generators
+%endif
+
+Requires: /sbin/ldconfig
+
+%if %icu
+BuildRequires: libicu-devel
+Requires: libicu
+%endif
+
+%if %kerberos
+BuildRequires: krb5-devel
+BuildRequires: e2fsprogs-devel
+%endif
+
+%if %ldap
+%if 0%{?suse_version} >= 1500
+BuildRequires: openldap2-devel
+%else
+BuildRequires: openldap-devel
+%endif
+%endif
+
+%if %libnuma
+%if 0%{?rhel} || 0%{?fedora}
+BuildRequires: numactl-devel
+Requires: numactl-libs
+%else
+BuildRequires: libnuma-devel
+Requires: libnuma1
+%endif
+%endif
+
+%if %liburing
+BuildRequires: liburing-devel
+%endif
+
+%if %llvm
+%if 0%{?suse_version} >= 1500
+BuildRequires: llvm17-devel clang17-devel
+%endif
+%if 0%{?fedora} || 0%{?rhel}
+BuildRequires: llvm-devel => 17.0 clang-devel >= 17.0
+%endif
+%endif
+
+%if %nls
+BuildRequires: gettext >= 0.19.8
+%endif
+
+%if %pam
+BuildRequires: pam-devel
+%endif
+
+%if %plperl
+%if 0%{?fedora} || 0%{?rhel}
+BuildRequires: perl-devel
+BuildRequires: perl-ExtUtils-Embed
+%else
+BuildRequires: perl
+%endif
+%endif
+
+%if %plpython3
+BuildRequires: python3-devel
+%endif
+
+%if %pltcl
+BuildRequires: tcl-devel
+%endif
+
+%if %sdt
+BuildRequires: systemtap-sdt-devel
+%endif
+
+%if %selinux
+# All supported distros have libselinux-devel package:
+BuildRequires: libselinux-devel >= 2.9
+# SLES: SLES 15 does not have selinux-policy package.
+# RHEL/Fedora has selinux-policy:
+%if 0%{?rhel} || 0%{?fedora}
+BuildRequires: selinux-policy >= 3.4.3
+%endif
+%endif
+
+%if %ssl
+BuildRequires: openssl-devel
+%if 0%{?fedora} >= 41
+BuildRequires: openssl-devel-engine
+%endif
+%endif
+
+%if %uuid
+%if 0%{?suse_version} >= 1500
+BuildRequires: uuid-devel
+%else
+BuildRequires: libuuid-devel
+%endif
+%endif
+
+BuildRequires: systemd, systemd-devel
+# We require this to be present for %%{_prefix}/lib/tmpfiles.d
+Requires: systemd
+%if 0%{?suse_version} >= 1500
+Requires(post): systemd-sysvinit
+%else
+Requires(post): systemd-sysv
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
+%endif
+
+Requires: %{name}-libs%{?_isa} = %{version}-%{release}
+
+Requires(post): %{_sbindir}/update-alternatives
+Requires(postun): %{_sbindir}/update-alternatives
+
+Provides: %{sname} >= %{version}-%{release}
+
+%description
+PostgreSQL is an advanced Object-Relational database management system (DBMS).
+The base postgresql package contains the client programs that you'll need to
+access a PostgreSQL DBMS server. These client programs can be located on the
+same machine as the PostgreSQL server, or on a remote machine that accesses a
+PostgreSQL server over a network connection. The PostgreSQL server can be found
+in the postgresql%{pgmajorversion}-server sub-package.
+
+If you want to manipulate a PostgreSQL database on a local or remote PostgreSQL
+server, you need this package. You also need to install this package
+if you're installing the postgresql%{pgmajorversion}-server package.
+
+%package contrib
+Summary: Contributed source and binaries distributed with PostgreSQL
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: %{name}-libs%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
+Provides: postgresql-contrib >= %{version}-%{release}
+
+%description contrib
+The postgresql%{pgmajorversion}-contrib package contains various extension
+modules that are included in the PostgreSQL distribution.
+
+%package devel
+Summary: PostgreSQL development header files and libraries
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: %{name}-libs%{?_isa} = %{version}-%{release}
+
+%package ecpg
+Summary: Run-time library for ECPG programs
+
+%if 0%{?suse_version} >= 1500
+Requires: libopenssl1_1
+%else
+Requires: openssl-libs >= 1.1.1k
+%endif
+
+%description ecpg
+The postgresql%{pgmajorversion}-ecpg is used by programs built with ECPG
+(Embedded PostgreSQL for C).
+
+%package ecpg-devel
+Summary: Development files for ECPG (Embedded PostgreSQL for C)
+Requires: %{name}-ecpg%{?_isa} = %{version}-%{release}
+
+%if 0%{?suse_version} >= 1500
+Requires: libopenssl1_1
+%else
+Requires: openssl-libs >= 1.1.1k
+%endif
+
+%description ecpg-devel
+The postgresql%{pgmajorversion}-ecpg-devel pacakge contains the necessary
+files to build ECPG (Embedded PostgreSQL for C) programs. It includes the
+development libraries and the preprocessor program ecpg.
+
+%if %enabletaptests
+BuildRequires: perl-IPC-Run perl-Test-Harness perl-Test-Simple
+Requires: perl-IPC-Run
+# SLES 15 does not have a separate perl-TimeHires package. It is part
+# of the main perl package.
+%if 0%{?rhel} || 0%{?fedora}
+BuildRequires: perl-Time-HiRes
+%endif
+%endif
+
+%if %icu
+Requires: libicu-devel
+%endif
+
+%if %llvm
+Requires: %{name}%{?_isa} = %{version}-%{release}
+%if 0%{?suse_version} >= 1500
+Requires: llvm17-devel clang17-devel
+%endif
+%if 0%{?fedora} || 0%{?rhel}
+Requires: llvm-devel => 17.0 clang-devel >= 17.0
+%endif
+%endif
+
+Provides: postgresql-devel >= %{version}-%{release}
+Obsoletes: libpq-devel <= 42.0
+
+%description devel
+The postgresql%{pgmajorversion}-devel package contains the header files and
+libraries needed to compile C or C++ applications which will directly interact
+with a PostgreSQL database management server. You need to install this package
+if you want to develop applications which will interact with a PostgreSQL
+server.
+
+%package docs
+Summary: Extra documentation for PostgreSQL
+Provides: postgresql-docs >= %{version}-%{release}
+%if 0%{?rhel} || 0%{?fedora}
+BuildRequires: docbook-style-xsl libxslt
+%endif
+%if 0%{?suse_version} >= 1499
+BuildRequires: docbook-xsl-stylesheets
+%endif
+
+%description docs
+The postgresql%{pgmajorversion}-docs package includes the SGML source for the
+documentation as well as the documentation in PDF format and some extra
+documentation. Install this package if you want to help with the PostgreSQL
+documentation project, or if you want to generate printed documentation. This
+package also includes HTML version of the documentation.
+
+%package libs
+Summary: The shared libraries required for any PostgreSQL clients
+Provides: postgresql-libs = %{pgmajorversion} libpq5 >= 10.0
+
+%if 0%{?suse_version} >= 1500
+Requires: libopenssl1_1
+%else
+Requires: openssl-libs >= 1.1.1k
+%endif
+
+%description libs
+The postgresql%{pgmajorversion}-libs package provides the essential shared
+libraries for any PostgreSQL client program or interface. You will need to
+install this package to use any other PostgreSQL package or any clients that
+need to connect to a PostgreSQL server.
+
+%package libs-oauth
+Summary: The shared libraries required for any PostgreSQL clients - OAuth flow
+Provides: postgresql-libs = %{pgmajorversion} libpq5 >= 10.0
+Requires: postgresql%{pgmajorversion}-libs%{?_isa} = %{version}-%{release}
+
+%if 0%{?suse_version} >= 1500
+Requires: libcurl4
+%else
+Requires: curl
+%endif
+
+%description libs-oauth
+The postgresql%{pgmajorversion}-libs-oauth is an optional module for
+postgresql%{pgmajorversion}-libs implementing the Device Authorization flow for
+OAuth clients (RFC 8628). It is maintained as its own shared library in order
+to isolate its dependency on libcurl. If a connection string allows the use of
+OAuth, and the server asks for it, and a libpq client has not installed its own
+custom OAuth flow, libpq will attempt to delay-load this module using dlopen()
+and the following ABI. Failure to load results in a failed connection.
+
+%if %llvm
+%package llvmjit
+Summary: Just-in-time compilation support for PostgreSQL
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
+%if 0%{?suse_version} >= 1500
+Requires: libLLVM17
+%endif
+%if 0%{?fedora} || 0%{?rhel}
+Requires: llvm => 17
+%endif
+
+Provides: postgresql-llvmjit >= %{version}-%{release}
+
+%description llvmjit
+The postgresql%{pgmajorversion}-llvmjit package contains support for
+just-in-time compiling parts of PostgreSQL queries. Using LLVM it compiles e.g.
+expressions and tuple deforming into native code, with the goal of accelerating
+analytics queries.
+%endif
+
+%if %plperl
+%package plperl
+Summary: The Perl procedural language for PostgreSQL
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
+Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+Provides: postgresql-plperl >= %{version}-%{release}
+
+%description plperl
+The postgresql%{pgmajorversion}-plperl package contains the PL/Perl procedural
+language, which is an extension to the PostgreSQL database server. Install this
+if you want to write database functions in Perl.
+%endif
+
+%if %plpython3
+%package plpython3
+Summary: The Python3 procedural language for PostgreSQL
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
+Provides: postgresql-plpython3 >= %{version}-%{release}
+%if 0%{?suse_version} >= 1500
+Requires: python3-base
+%else
+Requires: python3-libs
+%endif
+
+%description plpython3
+The postgresql%{pgmajorversion}-plpython3 package contains the PL/Python3
+procedural language, which is an extension to the PostgreSQL database server.
+Install this if you want to write database functions in Python 3.
+%endif
+
+%if %pltcl
+%package pltcl
+Summary: The Tcl procedural language for PostgreSQL
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
+Requires: tcl
+Provides: postgresql-pltcl >= %{version}-%{release}
+
+%description pltcl
+PostgreSQL is an advanced Object-Relational database management
+system. The %{name}-pltcl package contains the PL/Tcl language
+for the backend.
+%endif
+
+%package server
+Summary: The programs needed to create and run a PostgreSQL server
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: %{name}-libs%{?_isa} = %{version}-%{release}
+Requires(pre): /usr/sbin/useradd /usr/sbin/groupadd
+Requires: util-linux
+%if %liburing
+%if 0%{?fedora} || 0%{?rhel}
+Requires: liburing
+%else
+Requires: liburing2
+%endif
+%endif
+# for /sbin/ldconfig
+Requires(post): glibc
+Requires(postun): glibc
+# pre/post stuff needs systemd too
+
+%if 0%{?suse_version} >= 1500
+Requires(post): systemd
+%else
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
+%endif
+
+Provides: postgresql-server >= %{version}-%{release}
+
+%description server
+PostgreSQL is an advanced Object-Relational database management system (DBMS).
+The postgresql%{pgmajorversion}-server package contains the programs needed to
+create and run a PostgreSQL server, which will in turn allow you to create and
+maintain PostgreSQL databases.
+
+%if %test
+%package test
+Summary: The test suite distributed with PostgreSQL
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
+Requires: %{name}-devel%{?_isa} = %{version}-%{release}
+Provides: postgresql-test >= %{version}-%{release}
+
+%description test
+The postgresql%{pgmajorversion}-test package contains files needed for various
+tests for the PostgreSQL database management system, including regression tests
+and benchmarks.
+%endif
+
+%prep
+%setup -q -n %{sname}-%{pgpackageversion}devel
+
+%patch -P 1 -p0
+%patch -P 3 -p0
+%patch -P 5 -p0
+%patch -P 6 -p0
+
+%{__cp} -p %{SOURCE12} .
+
+%build
+
+# fail quickly and obviously if user tries to build as root
+%if %runselftest
+ if [ x"`id -u`" = x0 ]; then
+ echo "postgresql's regression tests fail if run as root."
+ echo "If you really need to build the RPM as root, use"
+ echo "--define='runselftest 0' to skip the regression tests."
+ exit 1
+ fi
+%endif
+
+CFLAGS="${CFLAGS:-%optflags}"
+# Strip out -ffast-math from CFLAGS....
+CFLAGS=`echo $CFLAGS|xargs -n 1|grep -v ffast-math|xargs -n 100`
+%if 0%{?rhel}
+LDFLAGS="-Wl,--as-needed"; export LDFLAGS
+%endif
+
+export CFLAGS
+
+# We need to export these even though they are under the standard
+# path. Buildfarm utilises ccache which may not be available on
+# users' instances, and that breaks extension builds as shown here:
+# https://www.postgresql.org/message-id/CACMiCkV%2BfQ4yAZqygyWx7ZQ8eWsj1AjoC6CGEUoyxY9jUm7paA%40mail.gmail.com
+# Previously reported by Muralikrishna Bandaru.
+export CLANG=%{_bindir}/clang LLVM_CONFIG=%{_bindir}/llvm-config
+
+./configure --enable-rpath \
+ --prefix=%{pgbaseinstdir} \
+ --includedir=%{pgbaseinstdir}/include \
+ --mandir=%{pgbaseinstdir}/share/man \
+ --datadir=%{pgbaseinstdir}/share \
+ --libdir=%{pgbaseinstdir}/lib \
+ --with-lz4 \
+ --with-zstd \
+%if %beta
+ --enable-debug \
+ --enable-cassert \
+%endif
+%if %enabletaptests
+ --enable-tap-tests \
+%endif
+%if %icu
+ --with-icu \
+%endif
+%if %kerberos
+ --with-gssapi \
+ --with-includes=%{_includedir} \
+ --with-libraries=%{_libdir} \
+%endif
+%if %libnuma
+ --with-libnuma \
+%endif
+%if %liburing
+ --with-liburing \
+%endif
+%if %ldap
+ --with-ldap \
+%endif
+%if %llvm
+ --with-llvm \
+%endif
+%if %nls
+ --enable-nls \
+%endif
+%if %pam
+ --with-pam \
+%endif
+%if %plperl
+ --with-perl \
+%endif
+%if %plpython3
+ --with-python \
+%endif
+%if %pltcl
+ --with-tcl \
+ --with-tclconfig=%{_libdir} \
+%endif
+%if %sdt
+ --enable-dtrace \
+%endif
+%if %selinux
+ --with-selinux \
+%endif
+%if %ssl
+ --with-openssl \
+%endif
+%if %uuid
+ --with-uuid=e2fs \
+%endif
+%if %xml
+ --with-libxml \
+ --with-libxslt \
+%endif
+ --with-libcurl \
+ --with-systemd \
+ --with-system-tzdata=%{_datadir}/zoneinfo \
+ --sysconfdir=/etc/sysconfig/pgsql \
+ --docdir=%{pgbaseinstdir}/doc \
+ --htmldir=%{pgbaseinstdir}/doc/html
+
+cd src/backend
+MAKELEVEL=0 %{__make} submake-generated-headers
+cd ../..
+
+# Have to hack makefile to put correct path into tutorial scripts
+sed "s|C=\`pwd\`;|C=%{pgbaseinstdir}/lib/tutorial;|" < src/tutorial/Makefile > src/tutorial/GNUmakefile
+%{__make} %{?_smp_mflags} -C src/tutorial NO_PGXS=1 all
+%{__rm} -f src/tutorial/GNUmakefile
+
+MAKELEVEL=0 %{__make} %{?_smp_mflags} all
+%{__make} %{?_smp_mflags} -C doc all
+%{__make} %{?_smp_mflags} -C contrib all
+%if %uuid
+%{__make} %{?_smp_mflags} -C contrib/uuid-ossp all
+%endif
+
+
+# run_testsuite WHERE
+# -------------------
+# Run 'make check' in WHERE path. When that command fails, return the logs
+# given by PostgreSQL build system and set 'test_failure=1'.
+
+run_testsuite()
+{
+ %{__make} -C "$1" MAX_CONNECTIONS=5 check && return 0
+
+ test_failure=1
+
+ (
+ set +x
+ echo "=== trying to find all regression.diffs files in build directory ==="
+ find -name 'regression.diffs' | \
+ while read line; do
+ echo "=== make failure: $line ==="
+ cat "$line"
+ done
+ )
+}
+
+%if %runselftest
+ run_testsuite "src/test/regress"
+ %{__make} clean -C "src/test/regress"
+ run_testsuite "src/pl"
+%if %plpython3
+ run_testsuite "src/pl/plpython"
+%endif
+ run_testsuite "contrib"
+%endif
+
+%if %test
+ pushd src/test/regress
+ %{__make} all
+ popd
+%endif
+
+%install
+%{__rm} -rf %{buildroot}
+
+%{__make} DESTDIR=%{buildroot} install
+
+%if %plpython3
+ # Install PL/Python3
+ pushd src/pl/plpython
+ %{__make} DESTDIR=%{buildroot} install
+ popd
+%endif
+
+%{__mkdir} -p %{buildroot}%{pgbaseinstdir}/share/extensions/
+%{__make} -C contrib DESTDIR=%{buildroot} install
+%if %uuid
+%{__make} -C contrib/uuid-ossp DESTDIR=%{buildroot} install
+%endif
+
+# multilib header hack; note pg_config.h is installed in two places!
+# we only apply this to known Red Hat multilib arches, per bug #177564
+case `uname -i` in
+ i386 | x86_64 | ppc | ppc64 | s390 | s390x)
+ %{__mv} %{buildroot}%{pgbaseinstdir}/include/pg_config.h %{buildroot}%{pgbaseinstdir}/include/pg_config_`uname -i`.h
+ %{__install} -m 644 %{SOURCE5} %{buildroot}%{pgbaseinstdir}/include/pg_config.h
+ %{__mv} %{buildroot}%{pgbaseinstdir}/include/server/pg_config.h %{buildroot}%{pgbaseinstdir}/include/server/pg_config_`uname -i`.h
+ %{__install} -m 644 %{SOURCE5} %{buildroot}%{pgbaseinstdir}/include/server/pg_config.h
+ %{__mv} %{buildroot}%{pgbaseinstdir}/include/ecpg_config.h %{buildroot}%{pgbaseinstdir}/include/ecpg_config_`uname -i`.h
+ %{__install} -m 644 %{SOURCE7} %{buildroot}%{pgbaseinstdir}/include/ecpg_config.h
+ ;;
+ *)
+ ;;
+esac
+
+# This is only for systemd supported distros:
+# prep the setup script, including insertion of some values it needs
+sed -e 's|^PGVERSION=.*$|PGVERSION=%{pgmajorversion}|' \
+ -e 's|^PGENGINE=.*$|PGENGINE=%{pgbaseinstdir}/bin|' \
+ -e 's|^PREVMAJORVERSION=.*$|PREVMAJORVERSION=%{prevmajorversion}|' \
+ <%{SOURCE17} >postgresql-%{pgmajorversion}-setup
+%{__install} -m 755 postgresql-%{pgmajorversion}-setup %{buildroot}%{pgbaseinstdir}/bin/postgresql-%{pgmajorversion}-setup
+# Create a symlink of the setup script under $PATH
+%{__mkdir} -p %{buildroot}%{_bindir}
+%{__ln_s} ../../../../../../../../../../../../../../%{pgbaseinstdir}/bin/postgresql-%{pgmajorversion}-setup %{buildroot}%{_bindir}/
+
+# prep the startup check script, including insertion of some values it needs
+sed -e 's|^PGVERSION=.*$|PGVERSION=%{pgmajorversion}|' \
+ -e 's|^PREVMAJORVERSION=.*$|PREVMAJORVERSION=%{prevmajorversion}|' \
+ -e 's|^PGDOCDIR=.*$|PGDOCDIR=%{_pkgdocdir}|' \
+ <%{SOURCE10} >%{sname}-%{pgmajorversion}-check-db-dir
+touch -r %{SOURCE10} %{sname}-%{pgmajorversion}-check-db-dir
+%{__install} -m 755 %{sname}-%{pgmajorversion}-check-db-dir %{buildroot}%{pgbaseinstdir}/bin/%{sname}-%{pgmajorversion}-check-db-dir
+
+%{__install} -d %{buildroot}%{_unitdir}
+%{__install} -m 644 %{SOURCE18} %{buildroot}%{_unitdir}/%{sname}-%{pgmajorversion}.service
+
+%if %pam
+%{__install} -d %{buildroot}/etc/pam.d
+%{__install} -m 644 %{SOURCE14} %{buildroot}/etc/pam.d/%{sname}
+%endif
+
+# Create the directory for sockets.
+%{__install} -d -m 755 %{buildroot}%{_rundir}/%{sname}
+# ... and make a tmpfiles script to recreate it at reboot.
+%{__mkdir} -p %{buildroot}/%{_tmpfilesdir}
+%{__install} -m 0644 %{SOURCE19} %{buildroot}/%{_tmpfilesdir}/%{sname}-%{pgmajorversion}.conf
+
+# PGDATA needs removal of group and world permissions due to pg_pwd hole.
+%{__install} -d -m 700 %{buildroot}/var/lib/pgsql/%{pgmajorversion}/data
+
+# backups of data go here...
+%{__install} -d -m 700 %{buildroot}/var/lib/pgsql/%{pgmajorversion}/backups
+
+# Create the multiple PostgreSQL version startup directory
+%{__install} -d -m 700 %{buildroot}/etc/sysconfig/pgsql/%{pgmajorversion}
+
+# Install linker conf file under postgresql installation directory.
+# We will install the latest version via alternatives.
+%{__install} -d -m 755 %{buildroot}%{pgbaseinstdir}/share/
+%{__install} -m 700 %{SOURCE9} %{buildroot}%{pgbaseinstdir}/share/
+
+%if %test
+ # tests. There are many files included here that are unnecessary,
+ # but include them anyway for completeness. We replace the original
+ # Makefiles, however.
+ %{__mkdir} -p %{buildroot}%{pgbaseinstdir}/lib/test
+ %{__cp} -a src/test/regress %{buildroot}%{pgbaseinstdir}/lib/test
+ %{__rm} -f %{buildroot}%{pgbaseinstdir}/lib/test/regress/refint.so
+ %{__rm} -f %{buildroot}%{pgbaseinstdir}/lib/test/regress/autoinc.so
+ # pg_regress binary should be only in one subpackage,
+ # there will be a symlink from -test to -devel
+ %{__rm} -f %{buildroot}%{pgbaseinstdir}/lib/test/regress/pg_regress
+ %{__mkdir} -p %{buildroot}%{pgbaseinstdir}/lib/pgsql/test/regress/
+ %{__ln_s} -f ../../pgxs/src/test/regress/pg_regress %{buildroot}%{pgbaseinstdir}/lib/test/regress/pg_regress
+ pushd %{buildroot}%{pgbaseinstdir}/lib/test/regress
+ strip *.so
+ %{__rm} -f GNUmakefile Makefile *.o
+ chmod 0755 pg_regress regress.so
+ popd
+ %{__cp} %{SOURCE4} %{buildroot}%{pgbaseinstdir}/lib/test/regress/Makefile
+ chmod 0644 %{buildroot}%{pgbaseinstdir}/lib/test/regress/Makefile
+%endif
+
+%if %plpython3
+# Quick hack:
+%{__rm} -f %{buildroot}/%{pgbaseinstdir}/share/extension/*plpython2u*
+%{__rm} -f %{buildroot}/%{pgbaseinstdir}/share/extension/*plpythonu-*
+%{__rm} -f %{buildroot}/%{pgbaseinstdir}/share/extension/*_plpythonu.control
+%endif
+
+# Fix some more documentation
+%{__cp} %{SOURCE6} README.rpm-dist
+%{__mkdir} -p %{buildroot}%{pgbaseinstdir}/share/doc/html
+%{__mv} doc/src/sgml/html doc
+%{__mkdir} -p %{buildroot}%{pgbaseinstdir}/share/man/
+%{__mv} doc/src/sgml/man1 doc/src/sgml/man3 doc/src/sgml/man7 %{buildroot}%{pgbaseinstdir}/share/man/
+%{__rm} -rf %{buildroot}%{_docdir}/pgsql
+
+# These file(s) should not be packaged:
+%{__rm} %{buildroot}%{pgbaseinstdir}/lib/libpgfeutils.a
+
+# Initialize file lists
+%{__cp} /dev/null main.lst
+%{__cp} /dev/null libs.lst
+%{__cp} /dev/null server.lst
+%{__cp} /dev/null devel.lst
+%{__cp} /dev/null plperl.lst
+%{__cp} /dev/null pltcl.lst
+%{__cp} /dev/null plpython.lst
+%{__cp} /dev/null pg_plpython3.lst
+%{__cp} /dev/null pg_checksums.lst
+
+%if %nls
+%find_lang ecpg-%{pgmajorversion}
+%find_lang ecpglib6-%{pgmajorversion}
+%find_lang initdb-%{pgmajorversion}
+%find_lang libpq5-%{pgmajorversion}
+%find_lang pg_amcheck-%{pgmajorversion}
+%find_lang pg_archivecleanup-%{pgmajorversion}
+%find_lang pg_basebackup-%{pgmajorversion}
+%find_lang pg_checksums-%{pgmajorversion}
+%find_lang pg_config-%{pgmajorversion}
+%find_lang pg_combinebackup-%{pgmajorversion}
+%find_lang pg_controldata-%{pgmajorversion}
+%find_lang pg_ctl-%{pgmajorversion}
+%find_lang pg_dump-%{pgmajorversion}
+%find_lang pg_resetwal-%{pgmajorversion}
+%find_lang pg_rewind-%{pgmajorversion}
+%find_lang pg_test_fsync-%{pgmajorversion}
+%find_lang pg_test_timing-%{pgmajorversion}
+%find_lang pg_upgrade-%{pgmajorversion}
+%find_lang pg_verifybackup-%{pgmajorversion}
+%find_lang pg_waldump-%{pgmajorversion}
+%find_lang pg_walsummary-%{pgmajorversion}
+%find_lang pgscripts-%{pgmajorversion}
+%if %plperl
+%find_lang plperl-%{pgmajorversion}
+cat plperl-%{pgmajorversion}.lang > pg_plperl.lst
+%endif
+%find_lang plpgsql-%{pgmajorversion}
+%if %plpython3
+%find_lang plpython-%{pgmajorversion}
+cat plpython-%{pgmajorversion}.lang >> pg_plpython3.lst
+%endif
+%if %pltcl
+%find_lang pltcl-%{pgmajorversion}
+cat pltcl-%{pgmajorversion}.lang > pg_pltcl.lst
+%endif
+%find_lang postgres-%{pgmajorversion}
+%find_lang psql-%{pgmajorversion}
+
+cat pg_amcheck-%{pgmajorversion}.lang > pg_contrib.lst
+cat libpq5-%{pgmajorversion}.lang > pg_libpq5.lst
+cat pg_config-%{pgmajorversion}.lang > pg_devel.lst
+cat ecpg-%{pgmajorversion}.lang ecpglib6-%{pgmajorversion}.lang > ecpg.lst
+cat initdb-%{pgmajorversion}.lang pg_ctl-%{pgmajorversion}.lang psql-%{pgmajorversion}.lang pg_dump-%{pgmajorversion}.lang pg_basebackup-%{pgmajorversion}.lang pgscripts-%{pgmajorversion}.lang pg_combinebackup-%{pgmajorversion}.lang pg_walsummary-%{pgmajorversion}.lang > pg_main.lst
+cat postgres-%{pgmajorversion}.lang pg_resetwal-%{pgmajorversion}.lang pg_checksums-%{pgmajorversion}.lang pg_verifybackup-%{pgmajorversion}.lang pg_controldata-%{pgmajorversion}.lang plpgsql-%{pgmajorversion}.lang pg_test_timing-%{pgmajorversion}.lang pg_test_fsync-%{pgmajorversion}.lang pg_archivecleanup-%{pgmajorversion}.lang pg_waldump-%{pgmajorversion}.lang pg_rewind-%{pgmajorversion}.lang pg_upgrade-%{pgmajorversion}.lang > pg_server.lst
+%endif
+
+%pre server
+groupadd -g 26 -o -r postgres >/dev/null 2>&1 || :
+useradd -M -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
+ -c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || :
+
+%post server
+/sbin/ldconfig
+if [ $1 -eq 1 ] ; then
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+ %if 0%{?suse_version} >= 1500
+ %service_add_pre postgresql-%{pgpackageversion}.service
+ %else
+ %systemd_post %{sname}-%{pgpackageversion}.service
+ %endif
+fi
+
+# postgres' .bash_profile.
+# We now don't install .bash_profile as we used to in pre 9.0. Instead, use cat,
+# so that package manager will be happy during upgrade to new major version.
+echo "[ -f /etc/profile ] && source /etc/profile
+PGDATA=/var/lib/pgsql/%{pgmajorversion}/data
+export PGDATA
+# If you want to customize your settings,
+# Use the file below. This is not overridden
+# by the RPMS.
+[ -f /var/lib/pgsql/.pgsql_profile ] && source /var/lib/pgsql/.pgsql_profile" > /var/lib/pgsql/.bash_profile
+chown postgres: /var/lib/pgsql/.bash_profile
+chmod 700 /var/lib/pgsql/.bash_profile
+
+%preun server
+if [ $1 -eq 0 ] ; then
+ # Package removal, not upgrade
+ /bin/systemctl --no-reload disable %{sname}-%{pgmajorversion}.service >/dev/null 2>&1 || :
+ /bin/systemctl stop %{sname}-%{pgmajorversion}.service >/dev/null 2>&1 || :
+fi
+
+%postun server
+/sbin/ldconfig
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /bin/systemctl try-restart %{sname}-%{pgmajorversion}.service >/dev/null 2>&1 || :
+fi
+
+# Create alternatives entries for common binaries and man files
+%post
+%{_sbindir}/update-alternatives --install %{_bindir}/psql pgsql-psql %{pgbaseinstdir}/bin/psql %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/clusterdb pgsql-clusterdb %{pgbaseinstdir}/bin/clusterdb %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/createdb pgsql-createdb %{pgbaseinstdir}/bin/createdb %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/createuser pgsql-createuser %{pgbaseinstdir}/bin/createuser %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/dropdb pgsql-dropdb %{pgbaseinstdir}/bin/dropdb %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/dropuser pgsql-dropuser %{pgbaseinstdir}/bin/dropuser %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/pg_basebackup pgsql-pg_basebackup %{pgbaseinstdir}/bin/pg_basebackup %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/pg_combinebackup pgsql-pg_combinebackup %{pgbaseinstdir}/bin/pg_combinebackup %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/pg_createsubscriber pgsql-pg_createsubscriber %{pgbaseinstdir}/bin/pg_createsubscriber %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/pg_dump pgsql-pg_dump %{pgbaseinstdir}/bin/pg_dump %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/pg_dumpall pgsql-pg_dumpall %{pgbaseinstdir}/bin/pg_dumpall %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/pg_restore pgsql-pg_restore %{pgbaseinstdir}/bin/pg_restore %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/pg_walsummary pgsql-pg_walsummary %{pgbaseinstdir}/bin/pg_walsummary %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/reindexdb pgsql-reindexdb %{pgbaseinstdir}/bin/reindexdb %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_bindir}/vacuumdb pgsql-vacuumdb %{pgbaseinstdir}/bin/vacuumdb %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/clusterdb.1 pgsql-clusterdbman %{pgbaseinstdir}/share/man/man1/clusterdb.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/createdb.1 pgsql-createdbman %{pgbaseinstdir}/share/man/man1/createdb.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/createuser.1 pgsql-createuserman %{pgbaseinstdir}/share/man/man1/createuser.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/dropdb.1 pgsql-dropdbman %{pgbaseinstdir}/share/man/man1/dropdb.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/dropuser.1 pgsql-dropuserman %{pgbaseinstdir}/share/man/man1/dropuser.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/pg_basebackup.1 pgsql-pg_basebackupman %{pgbaseinstdir}/share/man/man1/pg_basebackup.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/pg_combinebackup.1 pgsql-pg_combinebackupman %{pgbaseinstdir}/share/man/man1/pg_combinebackup.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/pg_createsubscriber.1 pgsql-pg_createsubscriberman %{pgbaseinstdir}/share/man/man1/pg_createsubscriber.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/pg_dump.1 pgsql-pg_dumpman %{pgbaseinstdir}/share/man/man1/pg_dump.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/pg_dumpall.1 pgsql-pg_dumpallman %{pgbaseinstdir}/share/man/man1/pg_dumpall.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/pg_restore.1 pgsql-pg_restoreman %{pgbaseinstdir}/share/man/man1/pg_restore.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/pg_walsummary.1 pgsql-pg_walsummaryman %{pgbaseinstdir}/share/man/man1/pg_walsummary.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/psql.1 pgsql-psqlman %{pgbaseinstdir}/share/man/man1/psql.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/reindexdb.1 pgsql-reindexdbman %{pgbaseinstdir}/share/man/man1/reindexdb.1 %{packageversion}0
+%{_sbindir}/update-alternatives --install %{_mandir}/man1/vacuumdb.1 pgsql-vacuumdbman %{pgbaseinstdir}/share/man/man1/vacuumdb.1 %{packageversion}0
+
+%post libs
+%{_sbindir}/update-alternatives --install /etc/ld.so.conf.d/%{sname}-pgdg-libs.conf pgsql-ld-conf %{pgbaseinstdir}/share/%{sname}-%{pgmajorversion}-libs.conf %{packageversion}0
+/sbin/ldconfig
+
+# Drop alternatives entries for common binaries and man files
+%postun
+if [ "$1" -eq 0 ]
+ then
+ # Only remove these links if the package is completely removed from the system (vs.just being upgraded)
+ %{_sbindir}/update-alternatives --remove pgsql-psql %{pgbaseinstdir}/bin/psql
+ %{_sbindir}/update-alternatives --remove pgsql-clusterdb %{pgbaseinstdir}/bin/clusterdb
+ %{_sbindir}/update-alternatives --remove pgsql-clusterdbman %{pgbaseinstdir}/share/man/man1/clusterdb.1
+ %{_sbindir}/update-alternatives --remove pgsql-createdb %{pgbaseinstdir}/bin/createdb
+ %{_sbindir}/update-alternatives --remove pgsql-createdbman %{pgbaseinstdir}/share/man/man1/createdb.1
+ %{_sbindir}/update-alternatives --remove pgsql-createuser %{pgbaseinstdir}/bin/createuser
+ %{_sbindir}/update-alternatives --remove pgsql-createuserman %{pgbaseinstdir}/share/man/man1/createuser.1
+ %{_sbindir}/update-alternatives --remove pgsql-dropdb %{pgbaseinstdir}/bin/dropdb
+ %{_sbindir}/update-alternatives --remove pgsql-dropdbman %{pgbaseinstdir}/share/man/man1/dropdb.1
+ %{_sbindir}/update-alternatives --remove pgsql-dropuser %{pgbaseinstdir}/bin/dropuser
+ %{_sbindir}/update-alternatives --remove pgsql-dropuserman %{pgbaseinstdir}/share/man/man1/dropuser.1
+ %{_sbindir}/update-alternatives --remove pgsql-pg_basebackup %{pgbaseinstdir}/bin/pg_basebackup
+ %{_sbindir}/update-alternatives --remove pgsql-pg_combinebackup %{pgbaseinstdir}/bin/pg_combinebackup
+ %{_sbindir}/update-alternatives --remove pgsql-pg_createsubscriber %{pgbaseinstdir}/bin/pg_createsubscriber
+ %{_sbindir}/update-alternatives --remove pgsql-pg_dump %{pgbaseinstdir}/bin/pg_dump
+ %{_sbindir}/update-alternatives --remove pgsql-pg_dumpall %{pgbaseinstdir}/bin/pg_dumpall
+ %{_sbindir}/update-alternatives --remove pgsql-pg_dumpallman %{pgbaseinstdir}/share/man/man1/pg_dumpall.1
+ %{_sbindir}/update-alternatives --remove pgsql-pg_basebackupman %{pgbaseinstdir}/share/man/man1/pg_basebackup.1
+ %{_sbindir}/update-alternatives --remove pgsql-pg_combinebackupman %{pgbaseinstdir}/share/man/man1/pg_combinebackup.1
+ %{_sbindir}/update-alternatives --remove pgsql-pg_createsubscriberman %{pgbaseinstdir}/share/man/man1/pg_createsubscriber.1
+ %{_sbindir}/update-alternatives --remove pgsql-pg_dumpman %{pgbaseinstdir}/share/man/man1/pg_dump.1
+ %{_sbindir}/update-alternatives --remove pgsql-pg_restore %{pgbaseinstdir}/bin/pg_restore
+ %{_sbindir}/update-alternatives --remove pgsql-pg_restoreman %{pgbaseinstdir}/share/man/man1/pg_restore.1
+ %{_sbindir}/update-alternatives --remove pgsql-pg_walsummary %{pgbaseinstdir}/bin/pg_walsummary
+ %{_sbindir}/update-alternatives --remove pgsql-psqlman %{pgbaseinstdir}/share/man/man1/psql.1
+ %{_sbindir}/update-alternatives --remove pgsql-reindexdb %{pgbaseinstdir}/bin/reindexdb
+ %{_sbindir}/update-alternatives --remove pgsql-reindexdbman %{pgbaseinstdir}/share/man/man1/reindexdb.1
+ %{_sbindir}/update-alternatives --remove pgsql-vacuumdb %{pgbaseinstdir}/bin/vacuumdb
+ %{_sbindir}/update-alternatives --remove pgsql-vacuumdbman %{pgbaseinstdir}/share/man/man1/vacuumdb.1
+ fi
+
+%postun libs
+if [ "$1" -eq 0 ]
+ then
+ %{_sbindir}/update-alternatives --remove pgsql-ld-conf %{pgbaseinstdir}/share/%{sname}-%{pgmajorversion}-libs.conf
+ /sbin/ldconfig
+fi
+
+# FILES section.
+
+%files -f pg_main.lst
+%defattr(-,root,root)
+%if %llvm
+# Install bitcode directory along with the main package,
+# so that extensions can use this dir.
+%dir %{pgbaseinstdir}/lib/bitcode
+%endif
+%doc doc/KNOWN_BUGS doc/MISSING_FEATURES
+%doc COPYRIGHT
+%doc README.rpm-dist
+%{pgbaseinstdir}/bin/clusterdb
+%{pgbaseinstdir}/bin/createdb
+%{pgbaseinstdir}/bin/createuser
+%{pgbaseinstdir}/bin/dropdb
+%{pgbaseinstdir}/bin/dropuser
+%{pgbaseinstdir}/bin/pgbench
+%{pgbaseinstdir}/bin/pg_basebackup
+%{pgbaseinstdir}/bin/pg_combinebackup
+%{pgbaseinstdir}/bin/pg_config
+%{pgbaseinstdir}/bin/pg_createsubscriber
+%{pgbaseinstdir}/bin/pg_dump
+%{pgbaseinstdir}/bin/pg_dumpall
+%{pgbaseinstdir}/bin/pg_isready
+%{pgbaseinstdir}/bin/pg_receivewal
+%{pgbaseinstdir}/bin/pg_restore
+%{pgbaseinstdir}/bin/pg_waldump
+%{pgbaseinstdir}/bin/pg_walsummary
+%{pgbaseinstdir}/bin/psql
+%{pgbaseinstdir}/bin/reindexdb
+%{pgbaseinstdir}/bin/vacuumdb
+%{pgbaseinstdir}/share/errcodes.txt
+%{pgbaseinstdir}/share/man/man1/clusterdb.*
+%{pgbaseinstdir}/share/man/man1/createdb.*
+%{pgbaseinstdir}/share/man/man1/createuser.*
+%{pgbaseinstdir}/share/man/man1/dropdb.*
+%{pgbaseinstdir}/share/man/man1/dropuser.*
+%{pgbaseinstdir}/share/man/man1/pgbench.1
+%{pgbaseinstdir}/share/man/man1/pg_basebackup.*
+%{pgbaseinstdir}/share/man/man1/pg_combinebackup.*
+%{pgbaseinstdir}/share/man/man1/pg_config.*
+%{pgbaseinstdir}/share/man/man1/pg_createsubscriber.*
+%{pgbaseinstdir}/share/man/man1/pg_dump.*
+%{pgbaseinstdir}/share/man/man1/pg_dumpall.*
+%{pgbaseinstdir}/share/man/man1/pg_isready.*
+%{pgbaseinstdir}/share/man/man1/pg_restore.*
+%{pgbaseinstdir}/share/man/man1/pg_walsummary.*
+%{pgbaseinstdir}/share/man/man1/psql.*
+%{pgbaseinstdir}/share/man/man1/reindexdb.*
+%{pgbaseinstdir}/share/man/man1/vacuumdb.*
+%{pgbaseinstdir}/share/man/man3/*
+%{pgbaseinstdir}/share/man/man7/*
+
+%files contrib -f pg_contrib.lst
+%defattr(-,root,root)
+%doc %{pgbaseinstdir}/doc/extension/*.example
+%{pgbaseinstdir}/lib/_int.so
+%{pgbaseinstdir}/lib/amcheck.so
+%{pgbaseinstdir}/lib/auth_delay.so
+%{pgbaseinstdir}/lib/autoinc.so
+%{pgbaseinstdir}/lib/auto_explain.so
+%{pgbaseinstdir}/lib/basebackup_to_shell.so
+%{pgbaseinstdir}/lib/basic_archive.so
+%{pgbaseinstdir}/lib/bloom.so
+%{pgbaseinstdir}/lib/btree_gin.so
+%{pgbaseinstdir}/lib/btree_gist.so
+%{pgbaseinstdir}/lib/citext.so
+%{pgbaseinstdir}/lib/cube.so
+%{pgbaseinstdir}/lib/dblink.so
+%{pgbaseinstdir}/lib/earthdistance.so
+%{pgbaseinstdir}/lib/file_fdw.so*
+%{pgbaseinstdir}/lib/fuzzystrmatch.so
+%{pgbaseinstdir}/lib/insert_username.so
+%{pgbaseinstdir}/lib/isn.so
+%{pgbaseinstdir}/lib/hstore.so
+%if %plperl
+%{pgbaseinstdir}/lib/hstore_plperl.so
+%{pgbaseinstdir}/lib/jsonb_plperl.so
+%{pgbaseinstdir}/share/extension/jsonb_plperl*.sql
+%{pgbaseinstdir}/share/extension/jsonb_plperl*.control
+%endif
+%if %plpython3
+%{pgbaseinstdir}/lib/hstore_plpython3.so
+%{pgbaseinstdir}/lib/jsonb_plpython3.so
+%{pgbaseinstdir}/lib/ltree_plpython3.so
+%endif
+%{pgbaseinstdir}/lib/lo.so
+%{pgbaseinstdir}/lib/ltree.so
+%{pgbaseinstdir}/lib/moddatetime.so
+%{pgbaseinstdir}/lib/pageinspect.so
+%{pgbaseinstdir}/lib/passwordcheck.so
+%{pgbaseinstdir}/lib/pgcrypto.so
+%{pgbaseinstdir}/lib/pgrowlocks.so
+%{pgbaseinstdir}/lib/pgstattuple.so
+%{pgbaseinstdir}/lib/pg_buffercache.so
+%{pgbaseinstdir}/lib/pg_freespacemap.so
+%{pgbaseinstdir}/lib/pg_logicalinspect.so
+%{pgbaseinstdir}/lib/pg_overexplain.so
+%{pgbaseinstdir}/lib/pg_prewarm.so
+%{pgbaseinstdir}/lib/pg_stat_statements.so
+%{pgbaseinstdir}/lib/pg_surgery.so
+%{pgbaseinstdir}/lib/pg_trgm.so
+%{pgbaseinstdir}/lib/pg_visibility.so
+%{pgbaseinstdir}/lib/pg_walinspect.so
+%{pgbaseinstdir}/lib/postgres_fdw.so
+%{pgbaseinstdir}/lib/refint.so
+%{pgbaseinstdir}/lib/seg.so
+%if %ssl
+%{pgbaseinstdir}/lib/sslinfo.so
+%endif
+%if %selinux
+%{pgbaseinstdir}/lib/sepgsql.so
+%{pgbaseinstdir}/share/contrib/sepgsql.sql
+%endif
+%{pgbaseinstdir}/lib/tablefunc.so
+%{pgbaseinstdir}/lib/tcn.so
+%{pgbaseinstdir}/lib/test_decoding.so
+%{pgbaseinstdir}/lib/tsm_system_rows.so
+%{pgbaseinstdir}/lib/tsm_system_time.so
+%{pgbaseinstdir}/lib/unaccent.so
+%if %xml
+%{pgbaseinstdir}/lib/pgxml.so
+%endif
+%if %uuid
+%{pgbaseinstdir}/lib/uuid-ossp.so
+%endif
+%{pgbaseinstdir}/share/extension/amcheck*
+%{pgbaseinstdir}/share/extension/autoinc*
+%{pgbaseinstdir}/share/extension/bloom*
+%{pgbaseinstdir}/share/extension/btree_gin*
+%{pgbaseinstdir}/share/extension/btree_gist*
+%{pgbaseinstdir}/share/extension/citext*
+%{pgbaseinstdir}/share/extension/cube*
+%{pgbaseinstdir}/share/extension/dblink*
+%{pgbaseinstdir}/share/extension/dict_int*
+%{pgbaseinstdir}/share/extension/dict_xsyn*
+%{pgbaseinstdir}/share/extension/earthdistance*
+%{pgbaseinstdir}/share/extension/file_fdw*
+%{pgbaseinstdir}/share/extension/fuzzystrmatch*
+%{pgbaseinstdir}/share/extension/hstore.control
+%{pgbaseinstdir}/share/extension/hstore--*.sql
+%if %plperl
+%{pgbaseinstdir}/share/extension/hstore_plperl*
+%endif
+%{pgbaseinstdir}/share/extension/insert_username*
+%{pgbaseinstdir}/share/extension/intagg*
+%{pgbaseinstdir}/share/extension/intarray*
+%{pgbaseinstdir}/share/extension/isn*
+%{pgbaseinstdir}/share/extension/lo*
+%{pgbaseinstdir}/share/extension/ltree.control
+%{pgbaseinstdir}/share/extension/ltree--*.sql
+%{pgbaseinstdir}/share/extension/moddatetime*
+%{pgbaseinstdir}/share/extension/pageinspect*
+%{pgbaseinstdir}/share/extension/pg_buffercache*
+%{pgbaseinstdir}/share/extension/pg_freespacemap*
+%{pgbaseinstdir}/share/extension/pg_logicalinspect*
+%{pgbaseinstdir}/share/extension/pg_prewarm*
+%{pgbaseinstdir}/share/extension/pg_stat_statements*
+%{pgbaseinstdir}/share/extension/pg_surgery*
+%{pgbaseinstdir}/share/extension/pg_trgm*
+%{pgbaseinstdir}/share/extension/pg_visibility*
+%{pgbaseinstdir}/share/extension/pg_walinspect*
+%{pgbaseinstdir}/share/extension/pgcrypto*
+%{pgbaseinstdir}/share/extension/pgrowlocks*
+%{pgbaseinstdir}/share/extension/pgstattuple*
+%{pgbaseinstdir}/share/extension/postgres_fdw*
+%{pgbaseinstdir}/share/extension/refint*
+%{pgbaseinstdir}/share/extension/seg*
+%if %ssl
+%{pgbaseinstdir}/share/extension/sslinfo*
+%endif
+%{pgbaseinstdir}/share/extension/tablefunc*
+%{pgbaseinstdir}/share/extension/tcn*
+%{pgbaseinstdir}/share/extension/tsm_system_rows*
+%{pgbaseinstdir}/share/extension/tsm_system_time*
+%{pgbaseinstdir}/share/extension/unaccent*
+%if %uuid
+%{pgbaseinstdir}/share/extension/uuid-ossp*
+%endif
+%if %xml
+%{pgbaseinstdir}/share/extension/xml2*
+%endif
+%{pgbaseinstdir}/bin/oid2name
+%{pgbaseinstdir}/bin/pg_amcheck
+%{pgbaseinstdir}/bin/pg_recvlogical
+%{pgbaseinstdir}/bin/vacuumlo
+%{pgbaseinstdir}/share/man/man1/pg_amcheck.1
+%{pgbaseinstdir}/share/man/man1/oid2name.1
+%{pgbaseinstdir}/share/man/man1/pg_recvlogical.1
+%{pgbaseinstdir}/share/man/man1/vacuumlo.1
+
+%files devel -f pg_devel.lst
+%defattr(-,root,root)
+%{pgbaseinstdir}/include/libpq*.h
+%{pgbaseinstdir}/include/pg_config*.h
+%{pgbaseinstdir}/include/postgres_ext.h
+%{pgbaseinstdir}/include/internal/*
+%{pgbaseinstdir}/include/libpq/*
+%{pgbaseinstdir}/include/server/*
+
+%{pgbaseinstdir}/lib/libpq.so
+%{pgbaseinstdir}/lib/libpq.a
+%{pgbaseinstdir}/lib/libpq-oauth.a
+%{pgbaseinstdir}/lib/libpgcommon.a
+%{pgbaseinstdir}/lib/libpgcommon_shlib.a
+%{pgbaseinstdir}/lib/libpgport.a
+%{pgbaseinstdir}/lib/libpgport_shlib.a
+%{pgbaseinstdir}/lib/pgxs/*
+%{pgbaseinstdir}/lib/pkgconfig/libpq.pc
+
+%files docs
+%defattr(-,root,root)
+%doc doc/src/*
+%doc *-A4.pdf
+%doc src/tutorial
+%doc doc/html
+
+%files ecpg -f ecpg.lst
+%defattr(-,root,root)
+%{pgbaseinstdir}/bin/ecpg
+%{pgbaseinstdir}/lib/libecpg.so*
+%{pgbaseinstdir}/lib/libecpg_compat.so*
+%{pgbaseinstdir}/lib/libecpg.a
+%{pgbaseinstdir}/lib/libecpg_compat.a
+%{pgbaseinstdir}/lib/libpgtypes.a
+%{pgbaseinstdir}/lib/libpgtypes.so*
+%{pgbaseinstdir}/share/man/man1/ecpg.*
+
+%files ecpg-devel
+%defattr(-,root,root)
+%{pgbaseinstdir}/include/informix/*
+%{pgbaseinstdir}/include/pgtypes*h
+%{pgbaseinstdir}/include/ecpg*.h
+%{pgbaseinstdir}/include/sql3types.h
+%{pgbaseinstdir}/include/sqlca.h
+%{pgbaseinstdir}/include/sqlda*.h
+%{pgbaseinstdir}/lib/pkgconfig/libecpg*.pc
+%{pgbaseinstdir}/lib/pkgconfig/libpgtypes.pc
+
+%files libs -f pg_libpq5.lst
+%defattr(-,root,root)
+%{pgbaseinstdir}/lib/libpq.so.*
+%{pgbaseinstdir}/lib/libpqwalreceiver.so
+%config(noreplace) %attr (644,root,root) %{pgbaseinstdir}/share/%{sname}-%{pgmajorversion}-libs.conf
+
+%files libs-oauth
+%defattr(-,root,root)
+%{pgbaseinstdir}/lib/libpq-oauth-%{pgmajorversion}.so
+
+%if %llvm
+%files llvmjit
+%defattr(-,root,root)
+%{pgbaseinstdir}/lib/bitcode/*
+%{pgbaseinstdir}/lib/llvmjit.so
+%{pgbaseinstdir}/lib/llvmjit_types.bc
+%endif
+
+%if %plperl
+%files plperl -f pg_plperl.lst
+%defattr(-,root,root)
+%{pgbaseinstdir}/lib/bool_plperl.so
+%{pgbaseinstdir}/lib/plperl.so
+%{pgbaseinstdir}/share/extension/plperl*
+%{pgbaseinstdir}/share/extension/bool_plperl*
+%endif
+
+%if %pltcl
+%files pltcl -f pg_pltcl.lst
+%defattr(-,root,root)
+%{pgbaseinstdir}/lib/pltcl.so
+%{pgbaseinstdir}/share/extension/pltcl*
+%endif
+
+%if %plpython3
+%files plpython3 -f pg_plpython3.lst
+%{pgbaseinstdir}/share/extension/plpython3*
+%{pgbaseinstdir}/lib/plpython3.so
+%{pgbaseinstdir}/share/extension/*_plpython3u*
+%endif
+
+%files server -f pg_server.lst
+%defattr(-,root,root)
+%{pgbaseinstdir}/bin/%{sname}-%{pgmajorversion}-setup
+%{_bindir}/%{sname}-%{pgmajorversion}-setup
+%{pgbaseinstdir}/bin/%{sname}-%{pgmajorversion}-check-db-dir
+%{_tmpfilesdir}/%{sname}-%{pgmajorversion}.conf
+%{_unitdir}/%{sname}-%{pgmajorversion}.service
+%if %pam
+%config(noreplace) /etc/pam.d/%{sname}
+%endif
+%attr (755,root,root) %dir /etc/sysconfig/pgsql
+%{pgbaseinstdir}/bin/initdb
+%{pgbaseinstdir}/bin/pg_archivecleanup
+%{pgbaseinstdir}/bin/pg_checksums
+%{pgbaseinstdir}/bin/pg_controldata
+%{pgbaseinstdir}/bin/pg_ctl
+%{pgbaseinstdir}/bin/pg_resetwal
+%{pgbaseinstdir}/bin/pg_rewind
+%{pgbaseinstdir}/bin/pg_test_fsync
+%{pgbaseinstdir}/bin/pg_test_timing
+%{pgbaseinstdir}/bin/pg_upgrade
+%{pgbaseinstdir}/bin/pg_verifybackup
+%{pgbaseinstdir}/bin/postgres
+%{pgbaseinstdir}/share/man/man1/initdb.*
+%{pgbaseinstdir}/share/man/man1/pg_archivecleanup.1
+%{pgbaseinstdir}/share/man/man1/pg_checksums.*
+%{pgbaseinstdir}/share/man/man1/pg_controldata.*
+%{pgbaseinstdir}/share/man/man1/pg_ctl.*
+%{pgbaseinstdir}/share/man/man1/pg_resetwal.*
+%{pgbaseinstdir}/share/man/man1/pg_receivewal.*
+%{pgbaseinstdir}/share/man/man1/pg_rewind.1
+%{pgbaseinstdir}/share/man/man1/pg_test_fsync.1
+%{pgbaseinstdir}/share/man/man1/pg_test_timing.1
+%{pgbaseinstdir}/share/man/man1/pg_upgrade.1
+%{pgbaseinstdir}/share/man/man1/pg_verifybackup.*
+%{pgbaseinstdir}/share/man/man1/pg_waldump.1
+%{pgbaseinstdir}/share/man/man1/postgres.*
+%{pgbaseinstdir}/share/postgres.bki
+%{pgbaseinstdir}/share/system_constraints.sql
+%{pgbaseinstdir}/share/system_functions.sql
+%{pgbaseinstdir}/share/system_views.sql
+%{pgbaseinstdir}/share/*.sample
+%{pgbaseinstdir}/share/timezonesets/*
+%{pgbaseinstdir}/share/tsearch_data/*.affix
+%{pgbaseinstdir}/share/tsearch_data/*.dict
+%{pgbaseinstdir}/share/tsearch_data/*.ths
+%{pgbaseinstdir}/share/tsearch_data/*.rules
+%{pgbaseinstdir}/share/tsearch_data/*.stop
+%{pgbaseinstdir}/share/tsearch_data/*.syn
+%{pgbaseinstdir}/lib/dict_int.so
+%{pgbaseinstdir}/lib/dict_snowball.so
+%{pgbaseinstdir}/lib/dict_xsyn.so
+%{pgbaseinstdir}/lib/euc2004_sjis2004.so
+%{pgbaseinstdir}/lib/pgoutput.so
+%{pgbaseinstdir}/lib/plpgsql.so
+%dir %{pgbaseinstdir}/share/extension
+%{pgbaseinstdir}/share/extension/plpgsql*
+
+%dir %{pgbaseinstdir}/lib
+%dir %{pgbaseinstdir}/share
+%attr(700,postgres,postgres) %dir /var/lib/pgsql
+%attr(700,postgres,postgres) %dir /var/lib/pgsql/%{pgmajorversion}
+%attr(700,postgres,postgres) %dir /var/lib/pgsql/%{pgmajorversion}/data
+%attr(700,postgres,postgres) %dir /var/lib/pgsql/%{pgmajorversion}/backups
+%attr(755,postgres,postgres) %dir %{_rundir}/%{sname}
+
+%{pgbaseinstdir}/lib/*_and_*.so
+%{pgbaseinstdir}/share/information_schema.sql
+%{pgbaseinstdir}/share/snowball_create.sql
+%{pgbaseinstdir}/share/sql_features.txt
+
+%if %test
+%files test
+%defattr(-,postgres,postgres)
+%attr(-,postgres,postgres) %{pgbaseinstdir}/lib/test/*
+%attr(-,postgres,postgres) %dir %{pgbaseinstdir}/lib/test
+%endif
+
+%changelog
+* Mon Jun 30 2025 Devrim Gunduz <devrim@gunduz.org> - 19.0alpha-1PGDG
+- Initial cut for PostgreSQL 19
+