Revert "PostgreSQL 19: Remove .bash_profile. Per https://redmine.postgresql.org/issue...
authorDevrim Gunduz <devrim@gunduz.org>
Tue, 23 Sep 2025 18:30:25 +0000 (21:30 +0300)
committerDevrim Gunduz <devrim@gunduz.org>
Tue, 23 Sep 2025 18:30:25 +0000 (21:30 +0300)
This reverts commit af10bc71a9d7f66db273fa28d290f1114e321b2b.

rpm/redhat/main/non-common/postgresql-19/main/postgresql-19.spec

index 4da34be1e091b41888c5b628803dc2d2a965ae67..5a582481e7503d78e22ab8937a34495de9a03c07 100644 (file)
@@ -46,9 +46,9 @@ 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}.1
+Release:       alpha_%{pgdg_build_timestamp}_PGDG%{?dist}
 %else
-Release:       alpha_%{pgdg_build_timestamp}_PGDG%{?dist}.1
+Release:       alpha_%{pgdg_build_timestamp}_PGDG%{?dist}
 %endif
 License:       PostgreSQL
 Url:           https://www.postgresql.org/
@@ -834,6 +834,19 @@ if [ $1 -eq 1 ] ; then
    %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