Total download size: 8.9 M Installed size: 37 M ... Installed: postgresql-16.1-1.module+el9.4.0+20018+a4fc542f.x86_64 postgresql-private-libs-16.1-1.module+el9.4.0+20018+a4fc542f.x86_64 postgresql-server-16.1-1.module+el9.4.0+20018+a4fc542f.x86_64
Complete!
由于本机之前安装过PG,所以先要进行升级。
1 2 3 4 5 6 7 8 9 10 11 12 13
[postgres@rocky9 ~]$ postgresql-setup --upgrade * Upgrading database. * Upgraded OK. WARNING: The configuration files were replaced by default configuration. WARNING: The previous configuration and data are stored in folder WARNING: /var/lib/pgsql/data-old. WARNING: If you've just upgraded your database from a previous major version of Fedora or RHEL, please run reindexdb against your databases. Core library collation data may have changed and this will invalidate database indexes. For example, in Fedora 28 and RHEL 8 there have been extensive changes in glibc collations to support ISO 14651:2016 (Unicode 9.0.0 data) and your indexes may be affected: https://sourceware.org/ml/libc-announce/2018/msg00002.html * See /var/lib/pgsql/upgrade_postgresql.log for details.
启动PG服务。
1 2 3 4 5 6 7
[shawnyan@rocky9 ~]$ sudo systemctl start postgresql [shawnyan@rocky9 ~]$ systemctl status postgresql ● postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; preset: disabled) Active: active (running) since Mon 2024-06-02 14:05:29 UTC; 5s ago ... Jun 02 14:05:29 rocky9.shawnyan.cn systemd[1]: Started PostgreSQL database server.
查看PG版本。
1 2 3 4 5
[postgres@rocky9~]$ psql -c 'select version()' version -------------------------------------------------------------------------------------------------------------- PostgreSQL 16.1on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 11.4.120231218 (Red Hat 11.4.1-3), 64-bit (1row)