Sunday, 11 August 2024

PostgreSQL 13 installation on Linux 8

 
[root@rac10-p ~]#
[root@rac10-p ~]#
[root@rac10-p ~]# cd /etc/yum.repos.d

[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]# ls -lrt
total 12
-rw-r--r--. 1 root root  243 May 16  2023 virt-ol8.repo
-rw-r--r--. 1 root root  941 Jul  8 11:46 uek-ol8.repo
-rw-r--r--. 1 root root 3662 Jul 16 19:07 oracle-linux-ol8.repo
[root@rac10-p yum.repos.d]#

Step 1. Download PostgreSql repository: 
Use OS command dnf to download PostgreSQL repository, 
Please note yum command require Internet Connection on Server. You can use yum repolist command to verify PostgreSQL repository created in Server.


[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]# dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
Oracle Linux 8 BaseOS Latest (x86_64)                                                                                                         18 kB/s | 4.3 kB     00:00
Oracle Linux 8 BaseOS Latest (x86_64)                                                                                                        7.0 MB/s |  79 MB     00:11
Oracle Linux 8 Application Stream (x86_64)                                                                                                    52 kB/s | 4.5 kB     00:00
Oracle Linux 8 Application Stream (x86_64)                                                                                                   5.5 MB/s |  62 MB     00:11
Oracle Linux 8 CodeReady Builder (x86_64) - Unsupported                                                                                      9.7 kB/s | 3.8 kB     00:00
Oracle Linux 8 CodeReady Builder (x86_64) - Unsupported                                                                                      5.0 MB/s |  11 MB     00:02
Latest Unbreakable Enterprise Kernel Release 7 for Oracle Linux 8 (x86_64)                                                                   1.9 kB/s | 3.5 kB     00:01
Last metadata expiration check: 0:00:01 ago on Sat 10 Aug 2024 11:43:22 PM IST.
pgdg-redhat-repo-latest.noarch.rpm                                                                                                            18 kB/s |  15 kB     00:00
Dependencies resolved.
=============================================================================================================================================================================
 Package                                       Architecture                        Version                                   Repository                                 Size
=============================================================================================================================================================================
Installing:
 pgdg-redhat-repo                              noarch                              42.0-43PGDG                               @commandline                               15 k
Transaction Summary
=============================================================================================================================================================================
Install  1 Package
Total size: 15 k
Installed size: 15 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                     1/1
  Installing       : pgdg-redhat-repo-42.0-43PGDG.noarch                                                                                                                 1/1
  Verifying        : pgdg-redhat-repo-42.0-43PGDG.noarch                                                                                                                 1/1
Installed:
  pgdg-redhat-repo-42.0-43PGDG.noarch
Complete!



[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]# ls -lrt
total 28
-rw-r--r--. 1 root root   243 May 16  2023 virt-ol8.repo
-rw-r--r--. 1 root root 13280 Apr 10 12:30 pgdg-redhat-all.repo
-rw-r--r--. 1 root root   941 Jul  8 11:46 uek-ol8.repo
-rw-r--r--. 1 root root  3662 Jul 16 19:07 oracle-linux-ol8.repo
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#



[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]# dnf repolist
repo id                                                     repo name
ol8_UEKR7                                                   Latest Unbreakable Enterprise Kernel Release 7 for Oracle Linux 8 (x86_64)
ol8_appstream                                               Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest                                           Oracle Linux 8 BaseOS Latest (x86_64)
ol8_codeready_builder                                       Oracle Linux 8 CodeReady Builder (x86_64) - Unsupported
pgdg-common                                                 PostgreSQL common RPMs for RHEL / Rocky / AlmaLinux 8 - x86_64
pgdg12                                                      PostgreSQL 12 for RHEL / Rocky / AlmaLinux 8 - x86_64
pgdg13                                                      PostgreSQL 13 for RHEL / Rocky / AlmaLinux 8 - x86_64
pgdg14                                                      PostgreSQL 14 for RHEL / Rocky / AlmaLinux 8 - x86_64
pgdg15                                                      PostgreSQL 15 for RHEL / Rocky / AlmaLinux 8 - x86_64
pgdg16                                                      PostgreSQL 16 for RHEL / Rocky / AlmaLinux 8 - x86_64
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#



[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]# dnf module disable postgresql
PostgreSQL common RPMs for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                               457  B/s | 659  B     00:01
PostgreSQL common RPMs for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                               2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
Is this ok [y/N]: y
PostgreSQL common RPMs for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                               143 kB/s | 467 kB     00:03
PostgreSQL 16 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        268  B/s | 659  B     00:02
PostgreSQL 16 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
Is this ok [y/N]: y
PostgreSQL 16 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        131 kB/s | 418 kB     00:03
PostgreSQL 15 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        544  B/s | 659  B     00:01
PostgreSQL 15 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
Is this ok [y/N]: y
PostgreSQL 15 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        260 kB/s | 676 kB     00:02
PostgreSQL 14 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        585  B/s | 659  B     00:01
PostgreSQL 14 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
Is this ok [y/N]: y
PostgreSQL 14 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        155 kB/s | 1.0 MB     00:06
PostgreSQL 13 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        470  B/s | 659  B     00:01
PostgreSQL 13 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
Is this ok [y/N]: y
PostgreSQL 13 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        428 kB/s | 1.2 MB     00:02
PostgreSQL 12 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        412  B/s | 659  B     00:01
PostgreSQL 12 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
Is this ok [y/N]: y
PostgreSQL 12 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        491 kB/s | 1.3 MB     00:02
Dependencies resolved.
=============================================================================================================================================================================
 Package                                  Architecture                            Version                                     Repository                                Size
=============================================================================================================================================================================
Disabling modules:
 postgresql
Transaction Summary
=============================================================================================================================================================================
Is this ok [y/N]: y
Complete!





[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]# dnf list "postgresql*-server"
Last metadata expiration check: 0:01:22 ago on Sat 10 Aug 2024 11:48:44 PM IST.
Available Packages
postgresql12-server.x86_64                                                              12.20-2PGDG.rhel8                                                              pgdg12
postgresql13-server.x86_64                                                              13.16-2PGDG.rhel8                                                              pgdg13
postgresql14-server.x86_64                                                              14.13-2PGDG.rhel8                                                              pgdg14
postgresql15-server.x86_64                                                              15.8-1PGDG.rhel8                                                               pgdg15
postgresql16-server.x86_64                                                              16.4-1PGDG.rhel8                                                               pgdg16

**************************************************************************************************************
Step 2.  Install  PostgreSQL Server: Use OS command “dnf” to  install  PostgreSQL Version 13.
**************************************************************************************************************
[root@rac10-p yum.repos.d]# dnf install postgresql13-server postgresql13
Last metadata expiration check: 0:03:12 ago on Sat 10 Aug 2024 11:54:13 PM IST.
Dependencies resolved.
=============================================================================================================================================================================
 Package                                         Architecture                       Version                                         Repository                          Size
=============================================================================================================================================================================
Installing:
 postgresql13                                    x86_64                             13.16-2PGDG.rhel8                               pgdg13                             1.5 M
 postgresql13-server                             x86_64                             13.16-2PGDG.rhel8                               pgdg13                             5.5 M
Installing dependencies:
 postgresql13-libs                               x86_64                             13.16-2PGDG.rhel8                               pgdg13                             420 k
Transaction Summary
=============================================================================================================================================================================
Install  3 Packages
Total download size: 7.4 M
Installed size: 31 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): postgresql13-13.16-2PGDG.rhel8.x86_64.rpm                                                                                             563 kB/s | 1.5 MB     00:02
(2/3): postgresql13-server-13.16-2PGDG.rhel8.x86_64.rpm                                                                                      1.5 MB/s | 5.5 MB     00:03
(3/3): postgresql13-libs-13.16-2PGDG.rhel8.x86_64.rpm                                                                                        102 kB/s | 420 kB     00:04
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                        1.8 MB/s | 7.4 MB     00:04
PostgreSQL 13 for RHEL / Rocky / AlmaLinux 8 - x86_64                                                                                        2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                     1/1
  Installing       : postgresql13-libs-13.16-2PGDG.rhel8.x86_64                                                                                                          1/3
  Running scriptlet: postgresql13-libs-13.16-2PGDG.rhel8.x86_64                                                                                                          1/3
  Installing       : postgresql13-13.16-2PGDG.rhel8.x86_64                                                                                                               2/3
  Running scriptlet: postgresql13-13.16-2PGDG.rhel8.x86_64                                                                                                               2/3
  Running scriptlet: postgresql13-server-13.16-2PGDG.rhel8.x86_64                                                                                                        3/3
  Installing       : postgresql13-server-13.16-2PGDG.rhel8.x86_64                                                                                                        3/3
  Running scriptlet: postgresql13-server-13.16-2PGDG.rhel8.x86_64                                                                                                        3/3
  Verifying        : postgresql13-13.16-2PGDG.rhel8.x86_64                                                                                                               1/3
  Verifying        : postgresql13-libs-13.16-2PGDG.rhel8.x86_64                                                                                                          2/3
  Verifying        : postgresql13-server-13.16-2PGDG.rhel8.x86_64                                                                                                        3/3
Installed:
  postgresql13-13.16-2PGDG.rhel8.x86_64                postgresql13-libs-13.16-2PGDG.rhel8.x86_64                postgresql13-server-13.16-2PGDG.rhel8.x86_64
Complete!
[root@rac10-p yum.repos.d]#
[root@rac10-p yum.repos.d]#

Go to /usr/pgsql-13/bin

[root@rac10-p]# cd /usr/pgsql-13/bin
[root@rac10-p bin]# pwd
/usr/pgsql-13/bin
[root@rac10-p bin]#
[root@rac10-p bin]#
[root@rac10-p bin]# ls -rlt
total 11264
lrwxrwxrwx. 1 root root       8 Aug  9 03:25 postmaster -> postgres
-rwxr-xr-x. 1 root root    9622 Aug  9 03:25 postgresql-13-setup
-rwxr-xr-x. 1 root root    2170 Aug  9 03:25 postgresql-13-check-db-dir
-rwxr-xr-x. 1 root root   81920 Aug  9 03:26 vacuumdb
-rwxr-xr-x. 1 root root   81744 Aug  9 03:26 reindexdb
-rwxr-xr-x. 1 root root  678648 Aug  9 03:26 psql
-rwxr-xr-x. 1 root root 7914808 Aug  9 03:26 postgres
-rwxr-xr-x. 1 root root  102248 Aug  9 03:26 pg_waldump
-rwxr-xr-x. 1 root root   94112 Aug  9 03:26 pg_verifybackup
-rwxr-xr-x. 1 root root  156824 Aug  9 03:26 pg_upgrade
-rwxr-xr-x. 1 root root   38824 Aug  9 03:26 pg_test_timing
-rwxr-xr-x. 1 root root   47336 Aug  9 03:26 pg_test_fsync
-rwxr-xr-x. 1 root root  132048 Aug  9 03:26 pg_rewind
-rwxr-xr-x. 1 root root  187632 Aug  9 03:26 pg_restore
-rwxr-xr-x. 1 root root   68376 Aug  9 03:26 pg_resetwal
-rwxr-xr-x. 1 root root   86088 Aug  9 03:26 pg_receivewal
-rwxr-xr-x. 1 root root   68824 Aug  9 03:26 pg_isready
-rwxr-xr-x. 1 root root  111328 Aug  9 03:26 pg_dumpall
-rwxr-xr-x. 1 root root  431608 Aug  9 03:26 pg_dump
-rwxr-xr-x. 1 root root   72632 Aug  9 03:26 pg_ctl
-rwxr-xr-x. 1 root root   59608 Aug  9 03:26 pg_controldata
-rwxr-xr-x. 1 root root   46992 Aug  9 03:26 pg_config
-rwxr-xr-x. 1 root root   64208 Aug  9 03:26 pg_checksums
-rwxr-xr-x. 1 root root  161456 Aug  9 03:26 pgbench
-rwxr-xr-x. 1 root root  128464 Aug  9 03:26 pg_basebackup
-rwxr-xr-x. 1 root root   43008 Aug  9 03:26 pg_archivecleanup
-rwxr-xr-x. 1 root root  136248 Aug  9 03:26 initdb
-rwxr-xr-x. 1 root root   68816 Aug  9 03:26 dropuser
-rwxr-xr-x. 1 root root   68888 Aug  9 03:26 dropdb
-rwxr-xr-x. 1 root root   77696 Aug  9 03:26 createuser
-rwxr-xr-x. 1 root root   77352 Aug  9 03:26 createdb
-rwxr-xr-x. 1 root root   73200 Aug  9 03:26 clusterdb
[root@rac10-p bin]#


Step 3. Initialize  DB and Enable Auto Restart: Follow the below steps.
==============================================================================
[root@rac10-p ~]#
[root@rac10-p ~]# /usr/pgsql-13/bin/postgresql-13-setup initdb
Initializing database ... OK
[root@rac10-p ~]#
[root@rac10-p ~]#
[root@rac10-p ~]#
[root@rac10-p ~]# systemctl enable postgresql-13
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql-13.service → /usr/lib/systemd/system/postgresql-13.service.
[root@rac10-p ~]#
[root@ra
[root@rac10-p ~]#
[root@rac10-p ~]# systemctl start postgresql-13
[root@rac10-p ~]#
[root@rac10-p ~]#
[root@rac10-p ~]#

[root@rac10-p ~]#
[root@rac10-p ~]# ps -ef| grep postgres
postgres    7707       1  0 00:12 ?        00:00:00 /usr/pgsql-13/bin/postmaster -D /var/lib/pgsql/13/data/
postgres    7709    7707  0 00:12 ?        00:00:00 postgres: logger
postgres    7711    7707  0 00:12 ?        00:00:00 postgres: checkpointer
postgres    7712    7707  0 00:12 ?        00:00:00 postgres: background writer
postgres    7713    7707  0 00:12 ?        00:00:00 postgres: walwriter
postgres    7714    7707  0 00:12 ?        00:00:00 postgres: autovacuum launcher
postgres    7715    7707  0 00:12 ?        00:00:00 postgres: stats collector
postgres    7716    7707  0 00:12 ?        00:00:00 postgres: logical replication launcher
root        7730    4893  0 00:12 pts/0    00:00:00 grep --color=auto postgres
[root@rac10-p ~]#
[root@rac10-p ~]#
[root@rac10-p ~]#


Step 4. Login to psql: Yum command will take care of all prerequisites and once all above steps are done you will notice OS user:  

****************************************************************************************************************************************
postgres and Binary Location: /usr/pgsql-13/bin/ 
and 
Data Directory Location: /var/lib/pgsql/13/data/ created. 
Perform switch user to  postgres and type psql (terminal-based front-end to PostgreSQL). 
When you enter psql you will be connected to psql terminal with database: 
postgres and user: postgres (Here postgres=# is DBName). Use command \conninfo to get connection details.

Binary Location : 
--------------------------

cd /usr/pgsql-13/bin/
[root@rac10-p ~]# cd /usr/pgsql-13/bin/
[root@rac10-p bin]#
[root@rac10-p bin]#
[root@rac10-p bin]# ls -lrt
total 11264
lrwxrwxrwx. 1 root root       8 Aug  9 03:25 postmaster -> postgres
-rwxr-xr-x. 1 root root    9622 Aug  9 03:25 postgresql-13-setup
-rwxr-xr-x. 1 root root    2170 Aug  9 03:25 postgresql-13-check-db-dir
-rwxr-xr-x. 1 root root   81920 Aug  9 03:26 vacuumdb
-rwxr-xr-x. 1 root root   81744 Aug  9 03:26 reindexdb
-rwxr-xr-x. 1 root root  678648 Aug  9 03:26 psql
-rwxr-xr-x. 1 root root 7914808 Aug  9 03:26 postgres
-rwxr-xr-x. 1 root root  102248 Aug  9 03:26 pg_waldump
-rwxr-xr-x. 1 root root   94112 Aug  9 03:26 pg_verifybackup
-rwxr-xr-x. 1 root root  156824 Aug  9 03:26 pg_upgrade
-rwxr-xr-x. 1 root root   38824 Aug  9 03:26 pg_test_timing
-rwxr-xr-x. 1 root root   47336 Aug  9 03:26 pg_test_fsync
-rwxr-xr-x. 1 root root  132048 Aug  9 03:26 pg_rewind
-rwxr-xr-x. 1 root root  187632 Aug  9 03:26 pg_restore
-rwxr-xr-x. 1 root root   68376 Aug  9 03:26 pg_resetwal
-rwxr-xr-x. 1 root root   86088 Aug  9 03:26 pg_receivewal
-rwxr-xr-x. 1 root root   68824 Aug  9 03:26 pg_isready
-rwxr-xr-x. 1 root root  111328 Aug  9 03:26 pg_dumpall
-rwxr-xr-x. 1 root root  431608 Aug  9 03:26 pg_dump
-rwxr-xr-x. 1 root root   72632 Aug  9 03:26 pg_ctl
-rwxr-xr-x. 1 root root   59608 Aug  9 03:26 pg_controldata
-rwxr-xr-x. 1 root root   46992 Aug  9 03:26 pg_config
-rwxr-xr-x. 1 root root   64208 Aug  9 03:26 pg_checksums
-rwxr-xr-x. 1 root root  161456 Aug  9 03:26 pgbench
-rwxr-xr-x. 1 root root  128464 Aug  9 03:26 pg_basebackup
-rwxr-xr-x. 1 root root   43008 Aug  9 03:26 pg_archivecleanup
-rwxr-xr-x. 1 root root  136248 Aug  9 03:26 initdb
-rwxr-xr-x. 1 root root   68816 Aug  9 03:26 dropuser
-rwxr-xr-x. 1 root root   68888 Aug  9 03:26 dropdb
-rwxr-xr-x. 1 root root   77696 Aug  9 03:26 createuser
-rwxr-xr-x. 1 root root   77352 Aug  9 03:26 createdb
-rwxr-xr-x. 1 root root   73200 Aug  9 03:26 clusterdb
[root@rac10-p bin]#


Data Directory Location : 
--------------------------

[root@rac10-p bin]# cd /var/lib/pgsql/13/data/
[root@rac10-p data]#
[root@rac10-p data]# ls -lrt
total 132
drwx------. 2 postgres postgres  4096 Aug 11 00:11 pg_twophase
drwx------. 2 postgres postgres  4096 Aug 11 00:11 pg_snapshots
drwx------. 2 postgres postgres  4096 Aug 11 00:11 pg_serial
drwx------. 2 postgres postgres  4096 Aug 11 00:11 pg_notify
drwx------. 2 postgres postgres  4096 Aug 11 00:11 pg_dynshmem
drwx------. 2 postgres postgres  4096 Aug 11 00:11 pg_commit_ts
-rw-------. 1 postgres postgres     3 Aug 11 00:11 PG_VERSION
drwx------. 2 postgres postgres  4096 Aug 11 00:11 pg_tblspc
drwx------. 2 postgres postgres  4096 Aug 11 00:11 pg_stat
drwx------. 2 postgres postgres  4096 Aug 11 00:11 pg_replslot
drwx------. 4 postgres postgres  4096 Aug 11 00:11 pg_multixact
-rw-------. 1 postgres postgres 28086 Aug 11 00:11 postgresql.conf
-rw-------. 1 postgres postgres    88 Aug 11 00:11 postgresql.auto.conf
-rw-------. 1 postgres postgres  1636 Aug 11 00:11 pg_ident.conf
-rw-------. 1 postgres postgres  4548 Aug 11 00:11 pg_hba.conf
drwx------. 2 postgres postgres  4096 Aug 11 00:11 pg_xact
drwx------. 3 postgres postgres  4096 Aug 11 00:11 pg_wal
drwx------. 2 postgres postgres  4096 Aug 11 00:11 pg_subtrans
drwx------. 2 postgres postgres  4096 Aug 11 00:11 global
drwx------. 5 postgres postgres  4096 Aug 11 00:11 base
drwx------. 4 postgres postgres  4096 Aug 11 00:11 pg_logical
drwx------. 2 postgres postgres  4096 Aug 11 00:12 log
-rw-------. 1 postgres postgres    30 Aug 11 00:12 current_logfiles
-rw-------. 1 postgres postgres    58 Aug 11 00:12 postmaster.opts
-rw-------. 1 postgres postgres    99 Aug 11 00:12 postmaster.pid
drwx------. 2 postgres postgres  4096 Aug 11 00:16 pg_stat_tmp
[root@rac10-p data]#



[root@rac10-p bin]# id postgres
uid=26(postgres) gid=26(postgres) groups=26(postgres)
[root@rac10-p bin]#
[root@rac10-p bin]#

Switch to the postgres - user

[root@rac10-p data]#
[root@rac10-p data]# su - postgres
[postgres@rac10-p ~]$
[postgres@rac10-p ~]$
[postgres@rac10-p ~]$
[postgres@rac10-p ~]$ psql
psql (13.16)
Type "help" for help.
postgres=#
postgres=#
postgres=#
postgres=# \conninfo
You are connected to database "postgres" as user "postgres" via socket in "/run/postgresql" at port "5432".
postgres=#
postgres=#



Step 5. Verify  PostgreSql Version: Use command SELECT version() or SHOW server_version.



postgres=# SELECT version();
                                                 version
----------------------------------------------------------------------------------------------------------
 PostgreSQL 13.16 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22), 64-bit
(1 row)

postgres=# SHOW server_version;
 server_version
----------------
 13.16
(1 row)








No comments:

Post a Comment

Master and Slave - Sync check - PostgreSQL

  1) Run the below Query on Primary:- SELECT     pid,     usename,     application_name,     client_addr,     state,     sync_state,     sen...