Install PostgreSQL 15 on Rocky Linux 9.0

# TL;DR

* use module system

# check default

```
[root@localhost ~]# dnf module list postgresql
Last metadata expiration check: 0:00:20 ago on Mon 25 Nov 2024 06:55:37 AM UTC.
Rocky Linux 9 - AppStream
Name                         Stream                   Profiles                            Summary
postgresql                   15                       client, server [d]                  PostgreSQL server and client module
postgresql                   16                       client, server [d]                  PostgreSQL server and client module
```

```
[root@localhost ~]# dnf search postgresql-server
Last metadata expiration check: 0:00:46 ago on Mon 25 Nov 2024 06:55:37 AM UTC.
================================================== Name Exactly Matched: postgresql-server ===================================================
postgresql-server.x86_64 : The programs needed to create and run a PostgreSQL server
[root@localhost ~]# dnf install postgresql-server
Last metadata expiration check: 0:00:55 ago on Mon 25 Nov 2024 06:55:37 AM UTC.
Dependencies resolved.
==============================================================================================================================================
 Package                                    Architecture              Version                              Repository                    Size
==============================================================================================================================================
Installing:
 postgresql-server                          x86_64                    13.16-1.el9_4                        appstream                    5.7 M
Upgrading:
 gnupg2                                     x86_64                    2.3.3-4.el9                          baseos                       2.5 M
 libcurl                                    x86_64                    7.76.1-31.el9                        baseos                       283 k
 libldb                                     x86_64                    2.9.1-2.el9                          baseos                       182 k
 l
```

この状態ではpostgresql 13が入る


# change module to PostgreSQL 15

```
[root@localhost ~]# dnf module switch-to postgresql:15
Last metadata expiration check: 0:02:56 ago on Mon 25 Nov 2024 06:55:37 AM UTC.
Dependencies resolved.
==============================================================================================================================================
 Package                           Architecture                     Version                           Repository                         Size
==============================================================================================================================================
Enabling module streams:
 postgresql                                                         15

Transaction Summary
==============================================================================================================================================

Is this ok [y/N]: y
Complete!
```

```
[root@localhost ~]# dnf module list postgresql
Last metadata expiration check: 0:03:06 ago on Mon 25 Nov 2024 06:55:37 AM UTC.
Rocky Linux 9 - AppStream
Name                         Stream                   Profiles                            Summary
postgresql                   15 [e]                   client, server [d]                  PostgreSQL server and client module
postgresql                   16                       client, server [d]                  PostgreSQL server and client module
```

# install

```
[root@localhost ~]# dnf install postgresql-server
Last metadata expiration check: 0:04:55 ago on Mon 25 Nov 2024 06:55:37 AM UTC.
Dependencies resolved.
==============================================================================================================================================
 Package                               Architecture         Version                                             Repository               Size
==============================================================================================================================================
Installing:
 postgresql-server                     x86_64               15.8-2.module+el9.5.0+28955+a22540b0                appstream               6.2 M
Upgrading:
 gnupg2                                x86_64               2.3.3-4.el9                                         baseos                  2.5 M
 libcurl                               x86_64               7.76.1-31.el9                                       baseos                  283 k
 libldb                                x86_64               2.9.1-2.el9                                         baseos                  182 k
 libnfsidmap                           x86_64               1:2.5.4-27.el9                                      baseos                   59 k
 libssh                                x86_64               0.10.4-13.el9                                       baseos                  215 k
 libssh-config                         noarch               0.10.4-13.el9                                       baseos                  9.5 k
 libsss_certmap                        x86_64               2.9.5-4.el9_5.1                                     baseos                   91 k
 libsss_idmap                          x86_64               2.9.5-4.el9_5.1                                     baseos                   42 k
 libsss_nss_idmap                      x86_64               2.9.5-4.el9_5.1                                     baseos                   46 k
 libsss_sudo                           x86_64               2.9.5-4.el9_5.1                                     baseos                   36 k
 libtalloc                             x86_64               2.4.2-1.el9                                         baseos                   30 k
 libtdb                                x86_64               1.4.10-1.el9                                        baseos                   50 k
 libtevent                             x86_64               0.16.1-1.el9                                        baseos                   47 k
 libuser                               x86_64               0.63-15.el9                                         baseos                  387 k
 openldap                              x86_64               2.6.6-3.el9                                         baseos                  254 k
 openssl                               x86_64               1:3.2.2-6.el9_5                                     baseos                  1.3 M
 openssl-libs                          x86_64               1:3.2.2-6.el9_5                                     baseos                  2.4 M
 sssd-client                           x86_64               2.9.5-4.el9_5.1                                     baseos                  161 k
 sssd-common                           x86_64               2.9.5-4.el9_5.1                                     baseos                  1.6 M
 sssd-kcm                              x86_64               2.9.5-4.el9_5.1                                     baseos                  110 k
 sssd-nfs-idmap                        x86_64               2.9.5-4.el9_5.1                                     baseos                   40 k
 sudo                                  x86_64               1.9.5p2-10.el9_3                                    baseos                  1.0 M
Installing dependencies:
 libicu                                x86_64               67.1-9.el9                                          baseos                  9.6 M
 postgresql                            x86_64               15.8-2.module+el9.5.0+28955+a22540b0                appstream               1.6 M
 postgresql-private-libs               x86_64               15.8-2.module+el9.5.0+28955+a22540b0                appstream               143 k

Transaction Summary
==============================================================================================================================================
Install   4 Packages
Upgrade  22 Packages

Total download size: 28 M
```

# check

```
[root@localhost ~]# psql -V
psql (PostgreSQL) 15.8
```

OK