Tag Archives: PostgreSQL DBA

Are Uncommitted Transactions Also Written to WAL?

Are Uncommitted Transactions Also Written to WAL?

Table of Contents



1. The Big Question

When you run BEGIN; INSERT INTO ... ; but have not yet committed, is that data already written to the WAL (Write-Ahead Log)?

Short answer: YES. Every data modification is written to WAL the moment the statement executes, regardless of whether the transaction is later committed or rolled back. The WAL records the action, not the outcome. The commit or rollback is recorded as a separate WAL record afterward.

This post proves it with a hands-on demo — we will insert data, leave it uncommitted, and physically inspect the WAL file on disk to find our data sitting there.

2. What is WAL and Why Does It Exist?

The Write-Ahead Log (WAL) is PostgreSQL’s crash-recovery mechanism. The core rule is simple:

  • Before any change is written to the actual data files (heap), the change is first appended to the WAL.
  • If the server crashes, PostgreSQL replays the WAL on startup to restore the database to a consistent state.
  • Committed transactions are replayed. Rolled-back transactions are undone during recovery using the ABORT records in the WAL.

This means the WAL must record everything — including uncommitted work — so that recovery knows what to undo if the server crashes mid-transaction.

3. Setup — Create Demo Table

postgres=# DROP TABLE IF EXISTS wal_demo;
DROP TABLE
postgres=#

postgres=# CREATE TABLE wal_demo (
    id      SERIAL PRIMARY KEY,
    fname   TEXT
);
CREATE TABLE
postgres=#

4. Check synchronous_commit Setting

This setting controls when WAL is flushed to disk. The default on means every COMMIT waits for the WAL to be physically written to disk.

postgres=# SHOW synchronous_commit;
 synchronous_commit
--------------------
 on   <-------------
(1 row)

postgres=#

Important: Even with synchronous_commit = on, individual INSERT statements within a transaction write to the WAL buffer immediately. The COMMIT is what triggers the flush-to-disk guarantee. The data still hits the WAL file on disk very quickly either way.

5. Record WAL Position Before Any Transaction

We capture the current WAL position (LSN = Log Sequence Number) so we can compare it after our insert.

postgres=# SELECT
    pg_current_wal_lsn() AS current_lsn,
    pg_walfile_name(pg_current_wal_lsn()) AS wal_file;
 current_lsn |         wal_file
-------------+--------------------------
 5/5F02E8C0  | 00000001000000050000005F
(1 row)

postgres=#

Our starting point is LSN 5/5F02E8C0 in WAL file 00000001000000050000005F

6. BEGIN + INSERT (Uncommitted) — Check WAL Position

Now we start a transaction and insert a row, but we do NOT commit.

postgres=# BEGIN;
BEGIN
postgres=*#

postgres=*# SELECT txid_current();
 txid_current
--------------
         2384 <-----------
(1 row)

postgres=*#

postgres=*# INSERT INTO wal_demo (fname) VALUES ('SUGIVARDHAN SUNDARRAJAN - UNCOMMITTED COPY');
INSERT 0 1
postgres=*#

-- The row is visible inside this transaction
postgres=*# SELECT * FROM wal_demo;
 id |                   fname
----+--------------------------------------------
  1 | SUGIVARDHAN SUNDARRAJAN - UNCOMMITTED COPY
(1 row)

postgres=*#

Now check the WAL position without committing:

postgres=*# SELECT
    pg_current_wal_lsn() AS current_lsn,
    pg_walfile_name(pg_current_wal_lsn()) AS wal_file;
 current_lsn |         wal_file
-------------+--------------------------
 5/5F02EBE0  | 00000001000000050000005F
(1 row)

postgres=*#


-- Also check the flush position
postgres=*# SELECT pg_current_wal_flush_lsn();
 pg_current_wal_flush_lsn
--------------------------
 5/5F02EBE0
(1 row)

postgres=*#

The WAL LSN moved! It went from 5/5F02E8C0 to 5/5F02EBE0. The INSERT was written to WAL even though we have not committed. The flush LSN matches, meaning the data is already on disk.

7. Grep the WAL File — Is the Uncommitted Data There?

Let’s physically inspect the WAL file on disk using the strings command.

[postgres@pgdb01 pg_wal]$ strings $PGDATA/pg_wal/00000001000000050000005F | grep -i "SUGIVARDHAN"
WSUGIVARDHAN SUNDARRAJAN - UNCOMMITTED COPY
[postgres@pgdb01 pg_wal]$ 

[postgres@pgdb01 ~]$ xxd $PGDATA/pg_wal/00000001000000050000005F | grep -i -B2 -A2 "sugiv"
0002e9e0: 800a 0000 4d23 4834 0060 3500 7f06 0000  ....M#H4.`5.....
0002e9f0: 0500 0000 ca01 0100 0000 0000 ff03 0200  ................
0002ea00: 0208 1800 0100 0000 5753 5547 4956 4152  ........WSUGIVAR
0002ea10: 4448 414e 2053 554e 4441 5252 414a 414e  DHAN SUNDARRAJAN
0002ea20: 202d 2055 4e43 4f4d 4d49 5454 4544 2043   - UNCOMMITTED C
[postgres@pgdb01 ~]$

There it is! The uncommitted row’s data is physically present in the WAL file on disk. Anyone with read access to the WAL directory can see it. This is why WAL files should be protected with proper file permissions and encryption.

8. ROLLBACK — Table is Empty, But WAL Remembers

postgres=*# ROLLBACK;
ROLLBACK
postgres=#


-- The table is empty — the row is gone from the user's perspective
postgres=# SELECT * FROM wal_demo;
 id | fname
----+-------
(0 rows)

postgres=#
postgres=# SELECT pg_current_wal_flush_lsn();
 pg_current_wal_flush_lsn
--------------------------
 5/5F02EE18
(1 row)

postgres=#

Our ending point is LSN 5/5F02EE18 in WAL file 00000001000000050000005F

But is the data still in the WAL file?

[postgres@pgdb01 ~]$ strings $PGDATA/pg_wal/00000001000000050000005F | grep -i "SUGIVARDHAN"
WSUGIVARDHAN SUNDARRAJAN - UNCOMMITTED COPY
[postgres@pgdb01 ~]$

[postgres@pgdb01 ~]$ xxd $PGDATA/pg_wal/00000001000000050000005F | grep -i -B2 -A2 "sugiv"
0002e9e0: 800a 0000 4d23 4834 0060 3500 7f06 0000  ....M#H4.`5.....
0002e9f0: 0500 0000 ca01 0100 0000 0000 ff03 0200  ................
0002ea00: 0208 1800 0100 0000 5753 5547 4956 4152  ........WSUGIVAR
0002ea10: 4448 414e 2053 554e 4441 5252 414a 414e  DHAN SUNDARRAJAN
0002ea20: 202d 2055 4e43 4f4d 4d49 5454 4544 2043   - UNCOMMITTED C
[postgres@pgdb01 ~]$

The data is STILL in the WAL file even after ROLLBACK. The ROLLBACK did not erase the WAL record. Instead, it wrote a new ABORT record to the WAL. During crash recovery, PostgreSQL replays the INSERT and then sees the ABORT, so it undoes the change. The WAL is an append-only log — records are never deleted or modified in place.

9. Inspect WAL with pg_waldump — The Full Story

pg_waldump decodes binary WAL files into human-readable records. Let’s inspect what PostgreSQL wrote for our uncommitted transaction.

[postgres@pgdb01 ~]$ pg_waldump $PGDATA/pg_wal/00000001000000050000005F \
    --start 5/5F02E8C0 --end 5/5F02EE18 \
    | grep -i "Insert\|Commit\|Abort"

rmgr: Heap        len (rec/tot):    102/   102, tx:       2384, lsn: 5/5F02E9D0, prev 5/5F02E998, desc: INSERT+INIT off: 1, flags: 0x00, blkref #0: rel 1663/5/65994 blk 0
rmgr: Btree       len (rec/tot):     64/    64, tx:       2384, lsn: 5/5F02EA98, prev 5/5F02EA38, desc: INSERT_LEAF off: 1, blkref #0: rel 1663/5/66000 blk 1
rmgr: Transaction len (rec/tot):     34/    34, tx:       2384, lsn: 5/5F02EBE0, prev 5/5F02EBA8, desc: ABORT 2026-09-25 19:23:15.559348 +08

[postgres@pgdb01 ~]$

Let’s break down every record in order:

#Record TypeTX IDWhat It Means
1Heap INSERT+INIT2384The actual row data was written to table block 0. The INIT flag indicates that this insert initialized a brand-new page.
2Btree INSERT_LEAF2384The primary key index (id SERIAL PRIMARY KEY) was updated with a new leaf entry in index block 1 under the same transaction ID.
3ABORT2384The ROLLBACK command logged an ABORT record along with the exact timestamp. This tells crash recovery to ignore/undo records #1 and #2.

Key Takeaway: Both the heap insertion and the primary key index update were written to the WAL before the transaction ended. When we executed ROLLBACK, PostgreSQL appended an ABORT record. The WAL is an append-only log: rolled-back records are never wiped or overwritten.

Why is this necessary? If the database crashes mid-transaction, PostgreSQL recovery reads the WAL sequentially. It must replay the uncommitted changes and then read the ABORT record to cleanly roll them back. Without logging uncommitted work, crash recovery would have no way to restore consistency.

10. Now COMMIT — Compare the WAL Records

Let’s do the same experiment, but this time we COMMIT.

postgres=# SELECT
    pg_current_wal_lsn() AS current_lsn,
    pg_walfile_name(pg_current_wal_lsn()) AS wal_file;
 current_lsn |         wal_file
-------------+--------------------------
 5/5F02EE18  | 00000001000000050000005F
(1 row)

postgres=#

postgres=# BEGIN;
BEGIN
postgres=*#

postgres=*# INSERT INTO wal_demo (fname) VALUES ('RAJASEKHAR AMUDALA - COMMITTED COPY');
INSERT 0 1
postgres=*#

postgres=*# COMMIT;
COMMIT
postgres=#


-- Record the new WAL position
postgres=# SELECT
    pg_current_wal_lsn() AS current_lsn,
    pg_walfile_name(pg_current_wal_lsn()) AS wal_file;
 current_lsn |         wal_file
-------------+--------------------------
 5/5F02F080  | 00000001000000050000005F
(1 row)

postgres=#


-- Verify the row is in the table
postgres=# SELECT * FROM wal_demo;
 id |                fname
----+-------------------------------------
  2 | RAJASEKHAR AMUDALA - COMMITTED COPY
(1 row)

postgres=#


-- Check the transaction visibility metadata
postgres=# SELECT
    fname,
    xmin                                      AS inserting_xid,
    xmin::text::bigint < txid_current()       AS is_in_past
FROM wal_demo;
                fname                | inserting_xid | is_in_past
-------------------------------------+---------------+------------
 RAJASEKHAR AMUDALA - COMMITTED COPY |          2385 | t
(1 row)

postgres=#

Grep the WAL file for the committed data:

[postgres@pgdb01 ~]$ strings $PGDATA/pg_wal/00000001000000050000005F | grep -i "RAJASEKHAR"
IRAJASEKHAR AMUDALA - COMMITTED COPYP
[postgres@pgdb01 ~]$

Inspect with pg_waldump:

[postgres@pgdb01 ~]$ pg_waldump $PGDATA/pg_wal/00000001000000050000005F \
    --start 5/5F02EE18 --end 5/5F02F080 \
    | grep -i "Insert\|Commit\|Abort"

rmgr: Heap        len (rec/tot):     54/   222, tx:       2385, lsn: 5/5F02EE80, prev 5/5F02EE18, desc: INSERT off: 2, flags: 0x00, blkref #0: rel 1663/5/65994 blk 0 FPW
rmgr: Btree       len (rec/tot):     53/   133, tx:       2385, lsn: 5/5F02EF60, prev 5/5F02EE80, desc: INSERT_LEAF off: 2, blkref #0: rel 1663/5/66000 blk 1 FPW
rmgr: Transaction len (rec/tot):     34/    34, tx:       2385, lsn: 5/5F02F020, prev 5/5F02EFE8, desc: COMMIT 2026-09-25 19:50:32.487755 +08

[postgres@pgdb01 ~]$

Detailed breakdown of the committed records:

#Record TypeTX IDDetails & Explanation
1Heap INSERT (FPW)2385The tuple was inserted at offset 2 of table block 0. Because a checkpoint finished right before this statement, the first touch to this page triggered a Full Page Write (FPW), storing the entire backup image into WAL (total length: 222 bytes).
2Btree INSERT_LEAF (FPW)2385The index entry for the primary key was written to index block 1. Just like the heap page, modifying this index block also produced an FPW.
3COMMIT2385The transaction committed successfully. Instead of ABORT, WAL logged a COMMIT record containing the exact timestamp (2026-09-25 19:50:32.487755 +08).

The Proof:

  • Uncommitted / Aborted: Heap INSERT → Btree INSERT_LEAF → ABORT
  • Committed: Heap INSERT → Btree INSERT_LEAF → COMMIT

The heap modification and index updates were written to the WAL file in both scenarios before the transaction ended. The only structural difference is the final record: ABORT vs COMMIT.

11. Side-by-Side Comparison

AspectUncommitted (ROLLBACK)Committed (COMMIT)
INSERT written to WAL?✅ Yes — immediately✅ Yes — immediately
Data visible in WAL file?✅ Yes — strings finds it✅ Yes — strings finds it
WAL LSN advances?✅ Yes — before commit/rollback✅ Yes — before commit
Transaction end recordABORTCOMMIT
Row visible in table?❌ No — rolled back✅ Yes — committed
Crash recovery behaviorReplay INSERT, then undo via ABORTReplay INSERT, keep via COMMIT
WAL record structureINSERT → ABORTINSERT → COMMIT

Key takeaway: The WAL does not wait for COMMIT to record your data. It writes every modification as it happens. The only difference between a committed and uncommitted transaction in the WAL is the final record: COMMIT vs ABORT. This is by design — if the server crashes mid-transaction, PostgreSQL needs the WAL to know what to undo.

Security implication: Sensitive data (passwords, credit card numbers, PII) written in a transaction that is later rolled back is still present in the WAL files on disk. WAL files should be protected with strict file permissions (0700).

12. Quick Summary Cheatsheet

ConceptDetail
Are uncommitted writes in WAL?Yes. Every INSERT/UPDATE/DELETE is written to WAL immediately, before commit.
Why?Crash recovery needs to know what to undo. Without the INSERT record, the ABORT record is meaningless.
What differs between COMMIT and ROLLBACK?Only the final WAL record: COMMIT vs ABORT. The data records are identical.
Is the WAL append-only?Yes. Records are never modified or deleted in place. Old WAL files are eventually recycled or archived.
Check current WAL positionSELECT pg_current_wal_lsn();
Check WAL flush positionSELECT pg_current_wal_flush_lsn();
Find WAL file name from LSNSELECT pg_walfile_name(pg_current_wal_lsn());
Inspect WAL contentspg_waldump $PGDATA/pg_wal/<file>
Search WAL for datastrings $PGDATA/pg_wal/<file> | grep "text"
Security concernRolled-back sensitive data persists in WAL. Protect WAL files and consider encryption.
Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
Thank you
Rajasekhar Amudala

PostgreSQL Configuration File

PostgreSQL Configuration File (postgresql.conf & auto.conf)

Table of Contents



1. What is postgresql.conf?

postgresql.conf is the main configuration file for PostgreSQL. It controls nearly every aspect of the server’s behavior — memory, connections, WAL, logging, query planner, autovacuum, and more.

But there is actually a second file most DBAs overlook:

  • postgresql.conf — the main file you edit by hand.
  • postgresql.auto.conf — created and managed by ALTER SYSTEM. It is read after postgresql.conf, so its values always win.

This post walks through both files, shows the difference between static (restart-required) and dynamic (reload-only) parameters, demonstrates the four levels of parameter scope, and shows what happens when things go wrong.

2. Locate the Configuration Files

The location varies by OS and installation method. Ask PostgreSQL directly:

postgres=# SHOW data_directory;
    data_directory
----------------------
 /pgData/pgsql17/data
(1 row)

postgres=# SHOW config_file;
             config_file
--------------------------------------
 /pgData/pgsql17/data/postgresql.conf
(1 row)

postgres=# SHOW hba_file;
             hba_file
----------------------------------
 /pgData/pgsql17/data/pg_hba.conf
(1 row)

postgres=# SHOW ident_file;
             ident_file
------------------------------------
 /pgData/pgsql17/data/pg_ident.conf
(1 row)

postgres=#

Key fact: postgresql.auto.conf always lives in the same directory as postgresql.conf (normally $PGDATA). It is created and updated only by ALTER SYSTEM.

3. Understand pg_settings — The Columns That Matter

The pg_settings view is your single source of truth for every configuration parameter. Here are the columns you need to know:

postgres=# SELECT
    name,
    setting,
    unit,
    context,
    source,
    sourcefile,
    sourceline,
    pending_restart
FROM pg_settings
WHERE name = 'max_connections';
      name       | setting | unit |  context   |       source       |              sourcefile              | sourceline | pending_restart
-----------------+---------+------+------------+--------------------+--------------------------------------+------------+-----------------
 max_connections | 100     |      | postmaster | configuration file | /pgData/pgsql17/data/postgresql.conf |          1 | f   <--------------
(1 row)

postgres=#

Column breakdown:

  • context — WHO/WHEN can change it. This is what defines static vs dynamic.
  • source — Where the current active value came from (default, configuration file, override, session, etc.).
  • sourcefile — The actual file that set it (.conf or .auto.conf).
  • sourceline — Line number within that file.
  • pending_restart — true = value was changed but needs a RESTART to apply.

4. Static vs Dynamic Parameters

Every parameter has a context that determines how and when it can be changed.

STATIC — context = postmaster (restart required)

postgres=# SELECT name, setting, context
FROM pg_settings
WHERE context = 'postmaster'
ORDER BY name
LIMIT 20;
                name                 |               setting                |  context
-------------------------------------+--------------------------------------+------------
 archive_mode                        | on                                   | postmaster
 autovacuum_freeze_max_age           | 200000000                            | postmaster
 autovacuum_max_workers              | 3                                    | postmaster
 autovacuum_multixact_freeze_max_age | 400000000                            | postmaster
 bonjour                             | off                                  | postmaster
 bonjour_name                        |                                      | postmaster
 cluster_name                        |                                      | postmaster
 commit_timestamp_buffers            | 32                                   | postmaster
 config_file                         | /pgData/pgsql17/data/postgresql.conf | postmaster
 data_directory                      | /pgData/pgsql17/data                 | postmaster
 data_sync_retry                     | off                                  | postmaster
 debug_io_direct                     |                                      | postmaster
 dynamic_shared_memory_type          | posix                                | postmaster
 event_source                        | PostgreSQL                           | postmaster
 external_pid_file                   |                                      | postmaster
 hba_file                            | /pgData/pgsql17/data/pg_hba.conf     | postmaster
 hot_standby                         | on                                   | postmaster
 huge_pages                          | try                                  | postmaster
 huge_page_size                      | 0                                    | postmaster
 ident_file                          | /pgData/pgsql17/data/pg_ident.conf   | postmaster
(20 rows)

postgres=#

DYNAMIC — everything else (no restart needed)

postgres=# SELECT name, setting, context
FROM pg_settings
WHERE context IN ('sighup','backend','superuser','user')
ORDER BY context, name
LIMIT 20;
                 name                  |            setting            | context
---------------------------------------+-------------------------------+---------
 ignore_system_indexes                 | off                           | backend
 post_auth_delay                       | 0                             | backend
 allow_alter_system                    | on                            | sighup
 archive_cleanup_command               |                               | sighup
 archive_command                       | cp %p /pgArch/pgsql17/arch/%f | sighup
 archive_library                       |                               | sighup
 archive_timeout                       | 0                             | sighup
 authentication_timeout                | 60                            | sighup
 autovacuum                            | on                            | sighup
 autovacuum_analyze_scale_factor       | 0.1                           | sighup
 autovacuum_analyze_threshold          | 50                            | sighup
 autovacuum_naptime                    | 60                            | sighup
 autovacuum_vacuum_cost_delay          | 2                             | sighup
 autovacuum_vacuum_cost_limit          | -1                            | sighup
 autovacuum_vacuum_insert_scale_factor | 0.2                           | sighup
 autovacuum_vacuum_insert_threshold    | 1000                          | sighup
 autovacuum_vacuum_scale_factor        | 0.2                           | sighup
 autovacuum_vacuum_threshold           | 50                            | sighup
 autovacuum_work_mem                   | -1                            | sighup
 bgwriter_delay                        | 200                           | sighup
(20 rows)

postgres=#

Count parameters per context

postgres=# SELECT context, count(*) AS num_params
FROM pg_settings
GROUP BY context
ORDER BY num_params DESC;
      context      | num_params
-------------------+------------
 user              |        145
 sighup            |         98
 postmaster        |         65
 superuser         |         46
 internal          |         19
 superuser-backend |          4
 backend           |          2
(7 rows)

postgres=#

Context cheat sheet:

  • postmaster → RESTART required. Cannot change on the fly.
  • sighup → RELOAD is enough (pg_reload_conf() or SIGHUP).
  • backend → Reload + only takes effect for new connections.
  • superuser / user → Can be changed live with SET, per session.

5. pg_file_settings — What’s Actually Written in the Files

pg_file_settings shows the raw contents of the conf files, independent of whether the value is currently applied.

postgres=# SELECT sourcefile, sourceline, name, setting, applied, error
FROM pg_file_settings
ORDER BY sourcefile, sourceline
LIMIT 15;
              sourcefile              | sourceline |            name            |      setting      | applied | error
--------------------------------------+------------+----------------------------+-------------------+---------+-------
 /pgData/pgsql17/data/postgresql.conf |          1 | max_connections            | 100               | t       |
 /pgData/pgsql17/data/postgresql.conf |          2 | shared_buffers             | 128MB             | t       |
 /pgData/pgsql17/data/postgresql.conf |          3 | dynamic_shared_memory_type | posix             | t       |
 /pgData/pgsql17/data/postgresql.conf |          4 | max_wal_size               | 1GB               | t       |
 /pgData/pgsql17/data/postgresql.conf |          5 | min_wal_size               | 80MB              | t       |
 /pgData/pgsql17/data/postgresql.conf |          6 | log_destination            | stderr            | t       |
 /pgData/pgsql17/data/postgresql.conf |          7 | logging_collector          | on                | t       |
 /pgData/pgsql17/data/postgresql.conf |          8 | log_directory              | log               | t       |
 /pgData/pgsql17/data/postgresql.conf |          9 | log_filename               | postgresql-%a.log | t       |
 /pgData/pgsql17/data/postgresql.conf |         10 | log_rotation_age           | 1d                | t       |
 /pgData/pgsql17/data/postgresql.conf |         11 | log_rotation_size          | 0                 | t       |
 /pgData/pgsql17/data/postgresql.conf |         12 | log_truncate_on_rotation   | on                | t       |
 /pgData/pgsql17/data/postgresql.conf |         13 | log_line_prefix            | %m [%p]           | t       |
 /pgData/pgsql17/data/postgresql.conf |         14 | log_timezone               | Asia/Singapore    | t       |
 /pgData/pgsql17/data/postgresql.conf |         15 | datestyle                  | iso, dmy          | t       |
(15 rows)

postgres=#

Key columns:

  • applied = false — the setting was overridden by a later file. For example, postgresql.auto.conf is read after postgresql.conf, so it wins.
  • error — non-null if that specific line failed to parse or apply.

6. Dynamic Parameter Change — Reload Only, No Restart

log_min_duration_statement has context = 'sighup', so a reload is enough.

-- Change the value using ALTER SYSTEM
postgres=# ALTER SYSTEM SET log_min_duration_statement = 500;
ALTER SYSTEM
postgres=#

-- Apply with reload (no restart needed)
postgres=# SELECT pg_reload_conf();
 pg_reload_conf
----------------
 t
(1 row)

postgres=#

-- Confirm it applied immediately
postgres=# SELECT name, setting, context, source, sourcefile, pending_restart
FROM pg_settings
WHERE name = 'log_min_duration_statement';
            name            | setting |  context  |       source       |                sourcefile                 | pending_restart
----------------------------+---------+-----------+--------------------+-------------------------------------------+-----------------
 log_min_duration_statement | 500     | superuser | configuration file | /pgData/pgsql17/data/postgresql.auto.conf | f
(1 row)

postgres=#
postgres=# SHOW log_min_duration_statement;
 log_min_duration_statement
----------------------------
 500ms   <-------------------
(1 row)

postgres=#

Change is LIVE right now. setting = 500, source = 'override', sourcefile = postgresql.auto.conf, pending_restart = false. No restart was needed.

7. Static Parameter Change — Reload is NOT Enough

max_connections has context = 'postmaster'. A reload picks up the file change, but the running server cannot apply it without a restart.

-- Change the value
postgres=# ALTER SYSTEM SET max_connections = 250;
ALTER SYSTEM
postgres=#

-- Reload
postgres=# SELECT pg_reload_conf();
 pg_reload_conf
----------------
 t
(1 row)

postgres=#

-- Check the setting — the OLD value is still active!
postgres=# SELECT name, setting, context, source, sourcefile, pending_restart
FROM pg_settings
WHERE name = 'max_connections';
      name       | setting |  context   |       source       |              sourcefile              | pending_restart
-----------------+---------+------------+--------------------+--------------------------------------+-----------------
 max_connections | 100     | postmaster | configuration file | /pgData/pgsql17/data/postgresql.conf | t   <----------------
(1 row)

postgres=#

[postgres@pgdb01 ~]$ pg_ctl restart -D $PGDATA
waiting for server to shut down.... done
server stopped
waiting for server to start....2026-09-25 13:43:50.273 +08 [3390] LOG:  redirecting log output to logging collector process
2026-09-25 13:43:50.273 +08 [3390] HINT:  Future log output will appear in directory "log".
 done
server started
[postgres@pgdb01 ~]$

postgres=# SELECT name, setting, context, source, sourcefile, pending_restart
FROM pg_settings
WHERE name = 'max_connections';
      name       | setting |  context   |       source       |                sourcefile                 | pending_restart
-----------------+---------+------------+--------------------+-------------------------------------------+-----------------
 max_connections | 250     | postmaster | configuration file | /pgData/pgsql17/data/postgresql.auto.conf | f  <-------------
(1 row)

postgres=#

pending_restart = true. The file has the new value (250), but the running server still shows 100. A postmaster-context parameter requires a full restart to take effect. pg_reload_conf() alone is not enough.

8. How postgresql.auto.conf Overrides postgresql.conf

Every ALTER SYSTEM SET writes to postgresql.auto.conf, not to postgresql.conf. Since postgresql.auto.conf is parsed last, its values always win.

postgres=# SELECT name, setting, sourcefile, sourceline
FROM pg_settings
WHERE name IN ('log_min_duration_statement','max_connections')
ORDER BY name;
            name            | setting |                sourcefile                 | sourceline
----------------------------+---------+-------------------------------------------+------------
 log_min_duration_statement | 500     | /pgData/pgsql17/data/postgresql.auto.conf |          3
 max_connections            | 250     | /pgData/pgsql17/data/postgresql.auto.conf |          4
(2 rows)

postgres=#

Verify from the OS shell:

-- postgresql.conf
[postgres@pgdb01 ~]$ cat /pgData/pgsql17/data/postgresql.conf|grep max_connections
max_connections = 100                   # (change requires restart)
[postgres@pgdb01 ~]$

-- postgresql.auto.conf
[postgres@pgdb01 ~]$ cat /pgData/pgsql17/data/postgresql.auto.conf|grep max_connections
max_connections = '250'
[postgres@pgdb01 ~]$ 

Both files mention max_connections with different values. The auto.conf value (250) is what PostgreSQL uses. This can cause confusion if you edit postgresql.conf and forget that auto.conf is overriding it.

9. Reset a Parameter Back to postgresql.conf’s Value

ALTER SYSTEM RESET removes the line from postgresql.auto.conf entirely, so PostgreSQL falls back to postgresql.conf (or the built-in default).

postgres=# SELECT name, setting, source, sourcefile
FROM pg_settings
WHERE name = 'log_min_duration_statement';
            name            | setting |       source       |                sourcefile
----------------------------+---------+--------------------+-------------------------------------------
 log_min_duration_statement | 500     | configuration file | /pgData/pgsql17/data/postgresql.auto.conf
(1 row)

postgres=#

postgres=# ALTER SYSTEM RESET log_min_duration_statement;
ALTER SYSTEM
postgres=#
postgres=# SELECT pg_reload_conf();
 pg_reload_conf
----------------
 t
(1 row)

postgres=#
postgres=# SELECT name, setting, source, sourcefile
FROM pg_settings
WHERE name = 'log_min_duration_statement';
            name            | setting | source  | sourcefile
----------------------------+---------+---------+------------
 log_min_duration_statement | -1      | default |
(1 row)

postgres=#

[postgres@pgdb01 ~]$ cat /pgData/pgsql17/data/postgresql.auto.conf|grep log_min_duration_statement
[postgres@pgdb01 ~]$

Back to postgresql.conf. The auto.conf override is gone. source now reads configuration file and sourcefile points back to postgresql.conf.

10. Set a WRONG Value and See the Error

Scenario A: ALTER SYSTEM catches it immediately

postgres=# ALTER SYSTEM SET shared_buffers = 'not_a_number';
ERROR:  invalid value for parameter "shared_buffers": "not_a_number"
postgres=#

ALTER SYSTEM validates most values up front. The bad value is rejected immediately — nothing is written to auto.conf, nothing to reload.

Scenario B: Hand-edit the file (the real-world “fat-finger” scenario)

# Someone accidentally edits postgresql.conf directly:

[postgres@pgdb01 ~]$ cp /pgData/pgsql17/data/postgresql.conf /pgData/pgsql17/data/postgresql.conf.bkp
[postgres@pgdb01 ~]$


[postgres@pgdb01 ~]$ echo "work_mem = 'banana'" >> /pgData/pgsql17/data/postgresql.conf
[postgres@pgdb01 ~]$


# Then reloads:
[postgres@pgdb01 ~]$ psql -c "SELECT pg_reload_conf();"
 pg_reload_conf
----------------
 t
(1 row)

[postgres@pgdb01 ~]$

Check the PostgreSQL log:

[postgres@pgdb01 ~]$ tail -5 /pgData/pgsql17/data/log/postgresql-Fri.log
2026-09-25 13:53:14.494 +08 [3428] ERROR:  invalid value for parameter "shared_buffers": "not_a_number"
2026-09-25 13:53:14.494 +08 [3428] STATEMENT:  ALTER SYSTEM SET shared_buffers = 'not_a_number';
2026-09-25 13:56:38.363 +08 [3390] LOG:  received SIGHUP, reloading configuration files
2026-09-25 13:56:38.364 +08 [3390] LOG:  invalid value for parameter "work_mem": "banana"
2026-09-25 13:56:38.365 +08 [3390] LOG:  configuration file "/pgData/pgsql17/data/postgresql.conf" contains errors; unaffected changes were applied
[postgres@pgdb01 ~]$

# Manually edit and update right Value
[postgres@pgdb01 ~]$ cat /pgData/pgsql17/data/postgresql.conf | grep work_mem
work_mem = '4MB'
[postgres@pgdb01 ~]$

[postgres@pgdb01 ~]$ psql -c "SELECT pg_reload_conf();"
 pg_reload_conf
----------------
 t
(1 row)

[postgres@pgdb01 ~]$
[postgres@pgdb01 ~]$ tail -5 /pgData/pgsql17/data/log/postgresql-Fri.log
2026-09-25 13:53:14.494 +08 [3428] STATEMENT:  ALTER SYSTEM SET shared_buffers = 'not_a_number';
2026-09-25 13:56:38.363 +08 [3390] LOG:  received SIGHUP, reloading configuration files
2026-09-25 13:56:38.364 +08 [3390] LOG:  invalid value for parameter "work_mem": "banana"
2026-09-25 13:56:38.365 +08 [3390] LOG:  configuration file "/pgData/pgsql17/data/postgresql.conf" contains errors; unaffected changes were applied

-- New output

2026-09-25 14:03:56.537 +08 [3390] LOG:  received SIGHUP, reloading configuration files
[postgres@pgdb01 ~]$

For a sighup-context bad value: PostgreSQL logs the error but keeps the previous good value running. The server does not crash. Fix the typo and reload again.

For a postmaster-context bad value: If you restart with a malformed listen_addresses or shared_buffers, the server will fail to start entirely. The log will show a fatal parse error.

11. Find Every Parameter Pending a Restart

This is the single most useful query for a DBA before scheduling a restart window. It tells you exactly which staged changes are waiting.

postgres=# SELECT
    name,
    setting AS current_running_value,
    context,
    sourcefile
FROM pg_settings
WHERE pending_restart = true
ORDER BY name;
 name | current_running_value | context | sourcefile
------+-----------------------+---------+------------
(0 rows)

postgres=# ALTER SYSTEM SET max_connections=300;  <---- static parameter
ALTER SYSTEM
postgres=# 

postgres=# SELECT pg_reload_conf();
 pg_reload_conf
----------------
 t
(1 row)

postgres=#

postgres=# SELECT
    name,
    setting AS current_running_value,
    context,
    sourcefile
FROM pg_settings
WHERE pending_restart = true
ORDER BY name;
      name       | current_running_value |  context   |                sourcefile
-----------------+-----------------------+------------+-------------------------------------------
 max_connections | 250                   | postmaster | /pgData/pgsql17/data/postgresql.auto.conf
(1 row)

postgres=#

postgres=# SELECT count(*) AS still_pending
FROM pg_settings
WHERE pending_restart = true;
 still_pending
---------------
             1  <----- means something require to restart 
(1 row)

postgres=#
postgres=# SELECT name, setting, context, pending_restart
FROM pg_settings
WHERE name = 'max_connections';
      name       | setting |  context   | pending_restart
-----------------+---------+------------+-----------------
 max_connections | 250     | postmaster | t  <----------------
(1 row)

postgres=#

DBA tip: Run this query before every planned restart. If it returns zero rows, there is nothing staged and the restart won’t change any configuration. This prevents unnecessary downtime.

12. Restart and Confirm pending_restart Clears

# Restart the server (OS shell)
[postgres@pgdb01 ~]$ pg_ctl restart -D $PGDATA
waiting for server to shut down.... done
server stopped
waiting for server to start....2026-09-25 14:16:29.475 +08 [3600] LOG:  redirecting log output to logging collector process
2026-09-25 14:16:29.475 +08 [3600] HINT:  Future log output will appear in directory "log".
 done
server started
[postgres@pgdb01 ~]$

After the restart, reconnect and verify:

postgres=# SELECT name, setting, context, pending_restart
FROM pg_settings
WHERE name = 'max_connections';

      name       | setting |  context   | pending_restart
-----------------+---------+------------+-----------------
 max_connections | 300     | postmaster | f   <-------------
(1 row)

postgres=#

-- Confirm nothing else is pending
postgres=# SELECT count(*) AS still_pending
FROM pg_settings
WHERE pending_restart = true;

 still_pending
---------------
             0  <--------- means nothing pending for restart
(1 row)

postgres=#

postgres=# SELECT
    name,
    setting AS current_running_value,
    context,
    sourcefile
FROM pg_settings
WHERE pending_restart = true
ORDER BY name;
 name | current_running_value | context | sourcefile
------+-----------------------+---------+------------
(0 rows)

postgres=#

max_connections is now 300 and pending_restart = false. The restart applied the staged change.

13. Parameter Scope — Cluster / Database / User / Session

PostgreSQL lets you set most dynamic parameters at four different scopes, each narrower than the last. The narrowest scope always wins.

Precedence (narrowest wins):

SESSION  >  ROLE+DATABASE  >  ROLE  >  DATABASE  >  CLUSTER  >  built-in default

13a. CLUSTER Level (ALTER SYSTEM)

Affects the whole server — every database, every user, every session.

postgres=# SHOW work_mem;
 work_mem
----------
 4MB <------
(1 row)

postgres=# ALTER SYSTEM SET work_mem = '8MB';
ALTER SYSTEM
postgres=#
postgres=# SELECT pg_reload_conf();
 pg_reload_conf
----------------
 t
(1 row)

postgres=#
postgres=# SHOW work_mem;
 work_mem
----------
 8MB   <----------------------
(1 row)

postgres=#

13b. DATABASE Level (overrides cluster for one database)

Only sessions connecting to this specific database get this value.

postgres=# ALTER DATABASE postgres SET work_mem = '16MB';
ALTER DATABASE
postgres=#

-- Reconnect to "postgres" to see it take effect
postgres=# \conninfo
You are connected to database "postgres" as user "postgres" via socket in "/run/postgresql" at port "5432".
postgres=#

postgres=#
postgres=# SHOW work_mem;
 work_mem
----------
 16MB  <-------------
(1 row)

postgres=# SELECT d.datname, r.rolname, s.setconfig
FROM pg_db_role_setting s
LEFT JOIN pg_database d ON d.oid = s.setdatabase
LEFT JOIN pg_roles r ON r.oid = s.setrole
ORDER BY d.datname NULLS LAST, r.rolname NULLS LAST;
 datname  | rolname |    setconfig
----------+---------+-----------------
 postgres |         | {work_mem=16MB}
(1 row)

postgres=# \c raj
You are now connected to database "raj" as user "postgres".
raj=#
raj=# SHOW work_mem;
 work_mem
----------
 8MB  <---------------
(1 row)

raj=#

13c. USER / ROLE Level (overrides cluster and database for one role)

postgres=# ALTER ROLE postgres SET work_mem = '32MB';
ALTER ROLE
postgres=#

-- Combine ROLE + DATABASE for maximum specificity
postgres=# ALTER ROLE postgres IN DATABASE postgres SET work_mem = '64MB';
ALTER ROLE
postgres=#

-- Check the catalog
postgres=# SELECT d.datname, r.rolname, s.setconfig
FROM pg_db_role_setting s
LEFT JOIN pg_database d ON d.oid = s.setdatabase
LEFT JOIN pg_roles r ON r.oid = s.setrole
ORDER BY d.datname NULLS LAST, r.rolname NULLS LAST;
 datname  | rolname  |    setconfig
----------+----------+-----------------
 postgres | postgres | {work_mem=64MB}    <--------- ROLE(USER)+DB level
 postgres |          | {work_mem=16MB}    <--------- Database level (overrides cluster for one database)
          | postgres | {work_mem=32MB}    <--------- ROLE(USER LEVEL)  overrides cluster and database for one role
(3 rows)

postgres=#

postgres=# \c raj
You are now connected to database "raj" as user "postgres".
raj=#
raj=# SHOW work_mem;
 work_mem
----------
 8MB  <----- CLUSTER LEVEL WE SET
(1 row)

raj=#

The postgres role connecting to the postgres database gets 64MB (the combined ROLE+DATABASE row wins over the role-only row, which wins over the database-only row, which wins over the cluster-wide 8MB).

PostgreSQL checks limits in this order (from most specific to least specific):

  1. ROLE + DATABASE together = 64MB 
  2. ROLE only = 32MB
  3. DATABASE only = 16MB
  4. Whole cluster = 8MB 

13d. SESSION Level (overrides everything, but only for this connection)

[postgres@lxceftsgvdb01 ~]$ psql -d postgres -U postgres
postgres=# SHOW work_mem;
 work_mem
----------
 64MB  <-----------------
(1 row)

postgres=#


-- SET lasts for this session only
postgres=# SET work_mem = '128MB';
SET
postgres=#

postgres=# SHOW work_mem;
 work_mem
----------
 128MB <----------------
(1 row)

postgres=#

-- SET LOCAL is even narrower — lasts only for the current transaction
postgres=# BEGIN;
BEGIN
postgres=*# SET LOCAL work_mem = '256MB';
SET
postgres=*# SHOW work_mem;
 work_mem
----------
 256MB   <---------------- Changed from 128MB to 256MB
(1 row)

postgres=*# COMMIT;
COMMIT
postgres=#
postgres=# SHOW work_mem;
 work_mem
----------
 128MB  <--------------- Came back to session setting 128MB
(1 row)

postgres=#

After COMMIT: work_mem reverted to 128MB (the session-level SET), not 256MB. SET LOCAL only lives inside the transaction. Disconnecting entirely drops the session-level SET and falls back to the role/database/cluster chain.

13e. See the Full Precedence Chain at a Glance

postgres=# SELECT name, setting AS effective_value, source, sourcefile
FROM pg_settings
WHERE name = 'work_mem';
   name   | effective_value | source  | sourcefile
----------+-----------------+---------+------------
 work_mem | 131072          | session |
(1 row)

postgres=#

The source column tells you which level actually won for the current session:

  • session → a SET / SET LOCAL you ran yourself
  • database → ALTER DATABASE ... SET
  • user → ALTER ROLE ... SET
  • override → ALTER SYSTEM (cluster level, via postgresql.auto.conf)
  • configuration file → plain postgresql.conf
  • default → built-in default, nothing overrode it

13f. Classify Every Parameter by Settable Scope

postgres=# SELECT name,
       context,
       CASE context
         WHEN 'internal'           THEN 'READ-ONLY (compile-time)'
         WHEN 'postmaster'         THEN 'CLUSTER only (restart required)'
         WHEN 'sighup'             THEN 'CLUSTER only (reload required)'
         WHEN 'backend'            THEN 'CLUSTER/DATABASE/ROLE (connect time only)'
         WHEN 'superuser-backend'  THEN 'CLUSTER/DATABASE/ROLE (connect time, superuser)'
         WHEN 'superuser'          THEN 'CLUSTER/DATABASE/ROLE/SESSION/TXN (superuser)'
         WHEN 'user'               THEN 'CLUSTER/DATABASE/ROLE/SESSION/TXN (any user)'
       END AS settable_scope
FROM pg_settings
ORDER BY context, name
LIMIT 15;
         name          | context  |              settable_scope
-----------------------+----------+-------------------------------------------
 ignore_system_indexes | backend  | CLUSTER/DATABASE/ROLE (connect time only)
 post_auth_delay       | backend  | CLUSTER/DATABASE/ROLE (connect time only)
 block_size            | internal | READ-ONLY (compile-time)
 data_checksums        | internal | READ-ONLY (compile-time)
 data_directory_mode   | internal | READ-ONLY (compile-time)
 debug_assertions      | internal | READ-ONLY (compile-time)
 huge_pages_status     | internal | READ-ONLY (compile-time)
 in_hot_standby        | internal | READ-ONLY (compile-time)
 integer_datetimes     | internal | READ-ONLY (compile-time)
 max_function_args     | internal | READ-ONLY (compile-time)
 max_identifier_length | internal | READ-ONLY (compile-time)
 max_index_keys        | internal | READ-ONLY (compile-time)
 segment_size          | internal | READ-ONLY (compile-time)
 server_encoding       | internal | READ-ONLY (compile-time)
 server_version        | internal | READ-ONLY (compile-time)
(15 rows)

postgres=#

Quick counts by scope:

-- Fully flexible (all 5 levels)
postgres=# SELECT count(*) AS fully_flexible
FROM pg_settings WHERE context IN ('user','superuser');
 fully_flexible
----------------
            191
(1 row)

postgres=#


-- Cluster-only (conf file or ALTER SYSTEM, never per-session)
postgres=# SELECT count(*) AS cluster_only
FROM pg_settings WHERE context IN ('postmaster','sighup');
 cluster_only
--------------
          163
(1 row)

postgres=#


-- Connect-time only (database/role, but not SET mid-session)
postgres=# SELECT count(*) AS connect_time_only
FROM pg_settings WHERE context IN ('backend','superuser-backend');
 connect_time_only
-------------------
                 6
(1 row)

postgres=#

14. Quick Cheatsheet

TaskCommand
Find config fileSHOW config_file;
View a settingSHOW work_mem; or SELECT * FROM pg_settings WHERE name = 'work_mem';
See non-default settingsSELECT * FROM pg_settings WHERE source != 'default';
See raw file contentsSELECT * FROM pg_file_settings;
Static vs DynamicSELECT name, context FROM pg_settings WHERE context = 'postmaster';
Change at cluster levelALTER SYSTEM SET work_mem = '64MB';
Change at database levelALTER DATABASE mydb SET work_mem = '64MB';
Change at role levelALTER ROLE myuser SET work_mem = '64MB';
Change at session levelSET work_mem = '128MB';
Change for one transactionSET LOCAL work_mem = '256MB';
Remove auto.conf overrideALTER SYSTEM RESET work_mem;
Apply without restartSELECT pg_reload_conf();
Find pending restartsSELECT * FROM pg_settings WHERE pending_restart = true;
Apply with restartpg_ctl restart -D $PGDATA
Check for config errorsSELECT * FROM pg_file_settings WHERE error IS NOT NULL;

15. Sample postgresql.conf

-- Server Config
# =============================================================================
# RAM   : 128 GB & CPU(s): 8  & OS: Redhat Linux 8
# =============================================================================

-- Sample parameters

# =============================================================================
# CONNECTION SETTINGS
# =============================================================================
listen_addresses = '*'                          
port = 6543                                     
max_connections = 1500
unix_socket_permissions = 0700

# =============================================================================
# SSL/TLS SECURITY SETTINGS
# =============================================================================
ssl = on
ssl_ca_file = '/pgData/pgsql17/certs/root.crt'
ssl_cert_file = '/pgData/pgsql17/certs/server.crt'
ssl_key_file = '/pgData/pgsql17/certs/server.key'
ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL'       
ssl_prefer_server_ciphers = on
ssl_min_protocol_version = 'TLSv1.2'

# =============================================================================
# MEMORY SETTINGS
# =============================================================================
shared_buffers = 32GB                           # min 128kB
work_mem = 2796kB                               # min 64kB
maintenance_work_mem = 2GB                      # min 1MB
dynamic_shared_memory_type = posix              
effective_cache_size = 96GB
temp_tablespaces = 'pg_tstmp'

# =============================================================================
# PARALLEL EXECUTION & WORKER PROCESSES
# =============================================================================
effective_io_concurrency = 200                  # 1-1000; 0 disables prefetching
max_worker_processes = 8                        # (change requires restart)
max_parallel_workers_per_gather = 4             # taken from max_parallel_workers
max_parallel_maintenance_workers = 4            # taken from max_parallel_workers
max_parallel_workers = 8                        # maximum number of max_worker_processes that

# =============================================================================
# QUERY PLANNING & OPTIMIZATION
# =============================================================================
random_page_cost = 1.1                          # same scale as above
default_statistics_target = 1500                # range 1-10000

# =============================================================================
# WRITE-AHEAD LOGGING (WAL) SETTINGS
# =============================================================================
wal_level = replica                             
wal_buffers = 16MB                              # min 32kB, -1 sets based on shared_buffers
wal_log_hints = on                              
full_page_writes = on                           
max_wal_senders = 10                            # max number of walsender processes
wal_keep_size = 128000                          # in megabytes; 0 disables
hot_standby = on                                # 'off' disallows queries during recovery

# =============================================================================
# CHECKPOINT & WAL SIZE SETTINGS
# =============================================================================
checkpoint_completion_target = 0.9              
max_wal_size = 4GB
min_wal_size = 1GB

# =============================================================================
# ARCHIVING 
# =============================================================================
archive_mode = on                               
archive_command = 'rsync -a %p /pgArch/pgsql17/arch/%f'

#archive_command = '/pgBackup/pgsql17/backup/arch_copy.sh %p %f && pgbackup'
#archive_cleanup_command = 'pg_archivecleanup /pgArch/pgsql17/arch/ %r'

# =============================================================================
# LOGGING SETTINGS
# =============================================================================
logging_collector = on                          
log_destination = 'stderr'
log_directory = '/pgLog/pgsql17/logs'
log_filename = 'postgres-%Y-%m-%d_%HMS.log'
log_file_mode = 0600
log_connections = on
log_disconnections = on
log_error_verbosity = verbose
log_hostname = on
log_line_prefix = '%m [%p] user=%u,database=%d,app_name=%a client_host=%h '
log_lock_waits = on
log_statement = 'ddl'
log_min_duration_statement = 2000   # log statements taking longer than 2000ms
log_timezone = 'Asia/Singapore'

# Optional
#log_truncate_on_rotation = on       # truncate rather than append on rotation
#log_rotation_age = 1d               # Automatic rotation by time
#log_rotation_size = 0               # Automatic rotation by size (0=disabled)
#log_duration = off

# ========================================================================
# AUTOVACUUM SETTINGS
# ========================================================================
autovacuum_naptime = 10min
autovacuum_vacuum_threshold = 10000
autovacuum_analyze_threshold = 10000
autovacuum_vacuum_scale_factor = 0.1
autovacuum_analyze_scale_factor = 0.1
autovacuum_vacuum_cost_delay = 10ms
autovacuum_vacuum_cost_limit = 600

# ========================================================================
# QUERY TRACKING SETTINGS
# ========================================================================
track_activities = on
track_counts = on
track_io_timing = off
track_activity_query_size = 10240

# ========================================================================
# QUERY PLANNING SETTINGS
# ========================================================================
seq_page_cost = 1.0                 # measured on an arbitrary scale
random_page_cost = 2.0              # same scale as above
cpu_tuple_cost = 0.03               # same scale as above
from_collapse_limit = 20
join_collapse_limit = 20            # 1 disables collapsing of explicit JOIN clauses
Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
Thank you
Rajasekhar Amudala

Visibility Map (VM) in PostgreSQL

Visibility Map (VM) in PostgreSQL

Table of Contents



1. What is the Visibility Map?

The Visibility Map (VM) is a tiny companion file stored alongside every PostgreSQL table. It tracks two boolean flags per 8 KB page:

  • all_visible: Are all rows on this page visible to all active transactions? If yes, PostgreSQL can skip visiting the heap page entirely during index-only scans.
  • all_frozen: Are all rows on this page frozen (their transaction IDs replaced with a special “FrozenXID”)? Frozen pages never need to be vacuumed for transaction ID wraparound prevention.

2. Prerequisites & Extension Setup

-- Enable extensions for VM and page-level inspection
CREATE EXTENSION IF NOT EXISTS pg_visibility;
CREATE EXTENSION IF NOT EXISTS pageinspect;
CREATE EXTENSION IF NOT EXISTS pg_freespacemap;

3. Create Demo Table & Insert Data

-- create a demo table
postgres=# DROP TABLE IF EXISTS demo_table;
DROP TABLE
postgres=# CREATE TABLE demo_table (
    id SERIAL PRIMARY KEY,
    name TEXT,
    status TEXT DEFAULT 'active'
);
CREATE TABLE
postgres=#


-- Insert 10,000 rows
postgres=# INSERT INTO demo_table (name, status)
SELECT
    'User_' || g,
    'active'
FROM generate_series(1, 10000) g;
INSERT 0 10000
postgres=#

postgres=# SELECT pg_relation_filepath('demo_table');
 pg_relation_filepath
----------------------
 base/5/65897
(1 row)

postgres=#

[postgres@pgdb01 ~]$ ls -la /pgData/pgsql17/data/base/5/65897*
-rw-------. 1 postgres postgres 524288 Sep 23 20:09 /pgData/pgsql17/data/base/5/65897
-rw-------. 1 postgres postgres  24576 Sep 23 20:09 /pgData/pgsql17/data/base/5/65897_fsm
-rw-------. 1 postgres postgres   8192 Sep 23 20:09 /pgData/pgsql17/data/base/5/65897_vm
[postgres@pgdb01 ~]$

4. Check VM Before VACUUM

Right after inserting data, no pages have been “cleaned” by VACUUM yet. The VM should show everything as not visible.

-- Check VM status for the first 20 pages
postgres=# SELECT
    relname,
    last_vacuum,
    last_autovacuum,
    last_analyze,
    last_autoanalyze
FROM pg_stat_user_tables
WHERE relname = 'demo_table';
  relname   | last_vacuum | last_autovacuum | last_analyze | last_autoanalyze
------------+-------------+-----------------+--------------+------------------
 demo_table |             |                 |              |
(1 row)

postgres=# 
postgres=# SELECT
    blkno,
    all_visible,
    all_frozen
FROM pg_visibility('demo_table')
ORDER BY blkno
LIMIT 20;
 blkno | all_visible | all_frozen
-------+-------------+------------
     0 | f           | f
     1 | f           | f
     2 | f           | f
     3 | f           | f
     4 | f           | f
     5 | f           | f
     6 | f           | f
     7 | f           | f
     8 | f           | f
     9 | f           | f
    10 | f           | f
    11 | f           | f
    12 | f           | f
    13 | f           | f
    14 | f           | f
    15 | f           | f
    16 | f           | f
    17 | f           | f
    18 | f           | f
    19 | f           | f
(20 rows)

postgres=# 
postgres=# SELECT
    count(*) AS total_pages,
    count(*) FILTER (WHERE all_visible) AS visible_pages,
    count(*) FILTER (WHERE NOT all_visible) AS not_visible_pages,
    count(*) FILTER (WHERE all_frozen) AS frozen_pages
FROM pg_visibility('demo_table');
 total_pages | visible_pages | not_visible_pages | frozen_pages
-------------+---------------+-------------------+--------------
          64 |            0 |                 64 |            0
(1 row)

postgres=#

🔴 All pages are NOT visible. This means every index-only scan will be forced to visit the heap to verify row visibility. This is slow.

5. Run VACUUM & Watch VM Light Up

-- Run VACUUM
postgres=# VACUUM demo_table;
VACUUM
postgres=#

-- Check VM per page all pages visible now
postgres=# SELECT
    blkno,
    all_visible,
    all_frozen
FROM pg_visibility('demo_table')
ORDER BY blkno
LIMIT 20;
 blkno | all_visible | all_frozen
-------+-------------+------------
     0 | t           | f
     1 | t           | f
     2 | t           | f
     3 | t           | f
     4 | t           | f
     5 | t           | f
     6 | t           | f
     7 | t           | f
     8 | t           | f
     9 | t           | f
    10 | t           | f
    11 | t           | f
    12 | t           | f
    13 | t           | f
    14 | t           | f
    15 | t           | f
    16 | t           | f
    17 | t           | f
    18 | t           | f
    19 | t           | f
(20 rows)

postgres=#

-- Summary after VACUUM
postgres=# SELECT
    count(*) AS total_pages,
    count(*) FILTER (WHERE all_visible) AS visible_pages,
    count(*) FILTER (WHERE NOT all_visible) AS not_visible_pages,
    count(*) FILTER (WHERE all_frozen) AS frozen_pages
FROM pg_visibility('demo_table');
 total_pages | visible_pages | not_visible_pages | frozen_pages
-------------+---------------+-------------------+--------------
          64 |            64 |                 0 |            0
(1 row)

postgres=#

✅ All 64 pages are now all_visible = true! VACUUM confirmed that every row on every page is visible to all transactions, and recorded this in the VM.

6. VM Impact on Index-Only Scans

This is where the VM pays off. When all_visible = true, PostgreSQL can answer queries using only the index without ever touching the main table (heap).

-- Create an index on the name column
postgres=# CREATE INDEX idx_demo_name ON demo_table(name);
CREATE INDEX
postgres=#

-- Update planner statistics
postgres=# ANALYZE demo_table;
ANALYZE
postgres=#

-- Run an index-only scan
postgres=# EXPLAIN (ANALYZE, BUFFERS) SELECT name FROM demo_table WHERE name = 'User_500';
                                                          QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------
 Index Only Scan using idx_demo_name on demo_table  (cost=0.29..4.30 rows=1 width=9) (actual time=0.044..0.045 rows=1 loops=1)
   Index Cond: (name = 'User_500'::text)
   Heap Fetches: 0
   Buffers: shared hit=1 read=2
 Planning:
   Buffers: shared hit=8 read=1
 Planning Time: 0.243 ms
 Execution Time: 0.067 ms
(8 rows)

postgres=#

Look for these two lines in the output:

 Index Only Scan using idx_demo_name on demo_table
   ...
   Heap Fetches: 0    <-- THIS IS THE VM IN ACTION!

What Heap Fetches: 0 means:

  • The query planner found the matching row in the index.
  • It checked the VM and saw the page is all_visible = true.
  • It skipped visiting the heap entirely because the VM guaranteed the row is visible.
  • Result: faster query, fewer disk reads.

7. Update Rows & Watch VM 

When you modify rows, the affected pages are no longer guaranteed to be all-visible. The VM flags flip back to false.

-- Update the first 1,000 rows

postgres=# UPDATE demo_table SET status = 'inactive' WHERE id BETWEEN 1 AND 1000;
UPDATE 1000
postgres=#

postgres=# SELECT
    count(*) AS total_pages,
    count(*) FILTER (WHERE all_visible) AS visible_pages,
    count(*) FILTER (WHERE NOT all_visible) AS not_visible_pages
FROM pg_visibility('demo_table');
 total_pages | visible_pages | not_visible_pages
-------------+---------------+-------------------
          71 |            56 |                15
(1 row)

postgres=# 
-- Check index-only scan performance with dirty pages
postgres=# EXPLAIN (ANALYZE, BUFFERS) SELECT name FROM demo_table WHERE name = 'User_500';
                                                          QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------
 Index Only Scan using idx_demo_name on demo_table  (cost=0.29..8.30 rows=1 width=9) (actual time=0.106..0.117 rows=1 loops=1)
   Index Cond: (name = 'User_500'::text)
   Heap Fetches: 2
   Buffers: shared hit=5 dirtied=3
 Planning Time: 0.124 ms
 Execution Time: 0.142 ms
(6 rows)

postgres=#

What changed:

 Index Only Scan using idx_demo_name on demo_table
   ...
   Heap Fetches: 2    <-- Now > 0! Had to visit the heap.

⚠️ Impact: Because User_500 lives on a page that is no longer all_visible, PostgreSQL was forced to fetch the actual heap page to verify the row’s visibility. This adds extra I/O.

8. VACUUM Again to Restore Visibility

-- VACUUM to clean dead tuples and restore VM flags
postgres=# VACUUM demo_table;
VACUUM
postgres=#

postgres=# SELECT
    count(*) AS total_pages,
    count(*) FILTER (WHERE all_visible) AS visible_pages,
    count(*) FILTER (WHERE NOT all_visible) AS not_visible_pages
FROM pg_visibility('demo_table');
 total_pages | visible_pages | not_visible_pages
-------------+---------------+-------------------
          71 |            71 |                 0
(1 row)

postgres=#
-- Index-only scan should be efficient again
postgres=# EXPLAIN (ANALYZE, BUFFERS) SELECT name FROM demo_table WHERE name = 'User_500';
                                                          QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------
 Index Only Scan using idx_demo_name on demo_table  (cost=0.29..4.30 rows=1 width=9) (actual time=0.031..0.032 rows=1 loops=1)
   Index Cond: (name = 'User_500'::text)
   Heap Fetches: 0
   Buffers: shared hit=3
 Planning:
   Buffers: shared hit=11
 Planning Time: 0.235 ms
 Execution Time: 0.057 ms
(8 rows)

postgres=#
 Heap Fetches: 0    <-- Back to zero! VM restored.

9. VACUUM FREEZE & the all_frozen Flag

The all_frozen flag is about transaction ID wraparound prevention. When a page is frozen, all its row transaction IDs are replaced with a special FrozenXID (value 2), meaning those rows will be visible to all future transactions forever. Frozen pages never need anti-wraparound vacuuming.


-- Create Demo Table and Insert Data 

postgres=# CREATE TABLE employees (id INT, name TEXT, salary DECIMAL);
CREATE TABLE
postgres=#
postgres=# INSERT INTO employees
SELECT i, 'Employee ' || i, 50000 + (i * 100) FROM generate_series(1, 100000) i;
INSERT 0 100000
postgres=#

-- VACUUM

postgres=# VACUUM employees;
VACUUM
postgres=#

-- Check BEFORE Freezing

postgres=# SELECT
    count(*) FILTER (WHERE all_frozen) AS frozen_pages,
    count(*) FILTER (WHERE NOT all_frozen) AS not_frozen_pages
FROM pg_visibility('employees');
 frozen_pages | not_frozen_pages
--------------+------------------
            0 |              735
(1 row)

postgres=#
-- Freeze all pages
postgres=# VACUUM FREEZE employees;
VACUUM
postgres=#

-- Check again
postgres=# SELECT
    count(*) FILTER (WHERE all_frozen) AS frozen_pages,
    count(*) FILTER (WHERE NOT all_frozen) AS not_frozen_pages
FROM pg_visibility('employees');
 frozen_pages | not_frozen_pages
--------------+------------------
          735 |                0
(1 row)

postgres=#

postgres=# SELECT count(*) AS total_pages, count(*) FILTER (WHERE all_visible) AS visible_pages, count(*) FILTER (WHERE NOT all_visible) AS not_visible_pages, count(*) FILTER (WHERE all_frozen) AS frozen_pages FROM pg_visibility('employees');
 total_pages | visible_pages | not_visible_pages | frozen_pages
-------------+---------------+-------------------+--------------
         735 |           735 |                 0 |          735
(1 row)

postgres=#
postgres=# SELECT blkno, all_visible, all_frozen
FROM pg_visibility('employees')
LIMIT 10;
 blkno | all_visible | all_frozen
-------+-------------+------------
     0 | t           | t
     1 | t           | t
     2 | t           | t
     3 | t           | t
     4 | t           | t
     5 | t           | t
     6 | t           | t
     7 | t           | t
     8 | t           | t
     9 | t           | t
(10 rows)

postgres=#

✅ All pages are now frozen. These pages will be skipped by future anti-wraparound autovacuum runs, saving significant I/O on large tables.

10. Quick Cheatsheet

ConceptDetail
What is VM?A bitmap tracking all_visible and all_frozen per 8 KB page.
all_visibleAll rows on the page are visible to all transactions. Enables Index-Only Scans with Heap Fetches: 0.
all_frozenAll rows are frozen (transaction IDs replaced). Page is exempt from anti-wraparound vacuum.
When does VM update?VACUUM sets flags to true. INSERT/UPDATE/DELETE set flags to false.
Biggest benefitIndex-Only Scans skip heap I/O entirely when pages are all_visible.
Inspect VMSELECT * FROM pg_visibility('table');
Disk fileStored as <relfilenode>_vm next to the main table file.
Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
Thank you
Rajasekhar Amudala

Free Space Map (FSM) in PostgreSQL

Free Space Map (FSM) in PostgreSQL

Table of Contents



A. What is the Free Space Map (FSM)?

When you run an INSERT or UPDATE, how does PostgreSQL know which page on disk has enough empty space to fit the new row?

Scanning through gigabytes of table pages from disk to find empty spots would be terribly slow. Instead, PostgreSQL maintains a lightweight binary tree called the Free Space Map (FSM) for every table and index.

B. How PostgreSQL Stores Data (Pages & Blocks)

PostgreSQL splits table files on disk into chunks called Pages (or Blocks). By default, each page is 8 KB (8192 bytes).

  • Each page can hold multiple rows (tuples).
  • Each row has an address called a ctid written as (page_number, item_number). For example, (0, 1) means Page 0, 1st row.
  • The FSM records roughly how many bytes of free space remain on each 8 KB page.

1. Prerequisites & Extension Setup

To inspect the Free Space Map directly inside PostgreSQL, enable the official pg_freespacemap extension.

-- Enable extension
postgres=# CREATE EXTENSION IF NOT EXISTS pg_freespacemap;
CREATE EXTENSION
postgres=#

2. Create Demo Table & Insert Data

We will create a table and insert 10,000 rows. We explicitly set the storage of description to PLAIN to disable TOAST compression so each row consumes ~200 bytes directly on the 8 KB page.

-- 1. Create a simple table
postgres=# DROP TABLE IF EXISTS demo_table;
DROP TABLE
postgres=# CREATE TABLE demo_table (
    id SERIAL PRIMARY KEY,
    name TEXT,
    description TEXT
);
CREATE TABLE
postgres=#


-- 2. Disable compression to maintain exact byte sizes
postgres=# ALTER TABLE demo_table ALTER COLUMN description SET STORAGE PLAIN;
ALTER TABLE
postgres=#

-- 3. Insert 10,000 rows (~200 bytes per row)
postgres=# INSERT INTO demo_table (name, description)
SELECT
    'Name_' || generate_series,
    repeat('x', 200)
FROM generate_series(1, 10000);
INSERT 0 10000
postgres=#


-- 4. Check total disk size
postgres=# SELECT pg_size_pretty(pg_relation_size('demo_table')) AS table_size;
 table_size
------------
 2504 kB
(1 row)

postgres=#

-- 5. Check total 8 KB pages (blocks)
postgres=# SELECT pg_relation_size('demo_table') / 8192 AS total_pages;
 total_pages
-------------
         313
(1 row)

postgres=#

3. Inspect the Physical Files (Main, FSM, VM)

PostgreSQL splits table data on disk into multiple companion files (called forks).

-- Find the physical file path and relation filenode
postgres=# SELECT pg_relation_filepath('demo_table');
 pg_relation_filepath
----------------------
 base/5/65851
(1 row)

postgres=#

If you check your PostgreSQL data directory in the terminal, you will see three forks for this relation:

# Run in terminal inside $PGDATA
[postgres@pgdb01 ~]$ ls -la /pgData/pgsql17/data/base/5/65851*
-rw-------. 1 postgres postgres 2564096 Sep 23 17:44 /pgData/pgsql17/data/base/5/65851
-rw-------. 1 postgres postgres   24576 Sep 23 17:44 /pgData/pgsql17/data/base/5/65851_fsm  <-----------
-rw-------. 1 postgres postgres    8192 Sep 23 17:44 /pgData/pgsql17/data/base/5/65851_vm
[postgres@pgdb01 ~]$

65851        # Main data file (heap blocks/pages)
65851_fsm    # Free Space Map (tracks free bytes per block)
65851_vm     # Visibility Map (tracks all-visible / frozen blocks)

4. Check FSM Before Any Modifications

Let’s inspect the FSM to see how much room is available on each block.

-- Check free space in the first 20 pages
postgres=# SELECT
    blkno,
    avail AS free_space_bytes
FROM pg_freespace('demo_table')
ORDER BY blkno
LIMIT 20;
 blkno | free_space_bytes
-------+------------------
     0 |               96
     1 |               96
     2 |               96
     3 |               96
     4 |               96
     5 |               96
     6 |               96
     7 |               96
     8 |               96
     9 |               96
    10 |               96
    11 |               96
    12 |               96
    13 |               96
    14 |               96
    15 |               96
    16 |               96
    17 |               96
    18 |               96
    19 |               96
(20 rows)

postgres=#


-- Overall summary of free space across the entire table
postgres=# SELECT
    count(*) AS total_pages,
    avg(avail)::int AS avg_free_space,
    min(avail) AS min_free_space,
    max(avail) AS max_free_space,
    sum(avail) AS total_free_space
FROM pg_freespace('demo_table');
 total_pages | avg_free_space | min_free_space | max_free_space | total_free_space
-------------+----------------+----------------+----------------+------------------
         313 |            111 |             96 |           4864 |            34816
(1 row)

postgres=#

Observation: Most pages show very little available space (96 bytes free). The pages are packed full.

5. Delete Rows to Create Free Space (The FSM Lag)

Now let’s delete 50% of the rows (all even IDs) and immediately check the FSM.

-- Delete 50% of rows
postgres=# DELETE FROM demo_table WHERE id % 2 = 0;
DELETE 5000
postgres=#

-- Verify remaining count (should be 5,000)
postgres=# SELECT count(*) FROM demo_table;
 count
-------
  5000
(1 row)

postgres=#

-- Check FSM IMMEDIATELY after DELETE (before VACUUM)
postgres=# SELECT
    blkno,
    avail AS free_space_bytes
FROM pg_freespace('demo_table')
ORDER BY blkno
LIMIT 20;
 blkno | free_space_bytes
-------+------------------
     0 |               96
     1 |               96
     2 |               96
     3 |               96
     4 |               96
     5 |               96
     6 |               96
     7 |               96
     8 |               96
     9 |               96
    10 |               96
    11 |               96
    12 |               96
    13 |               96
    14 |               96
    15 |               96
    16 |               96
    17 |               96
    18 |               96
    19 |               96
(20 rows)

postgres=#

⚠️ Crucial Observation: The FSM still shows the exact same low free space as before! Because of MVCC, DELETE only flags rows as dead. The space has not been reclaimed, and the FSM has not been updated.

6. Run VACUUM & Observe FSM Changes

Running standard VACUUM clears dead rows and registers all newly available space into the FSM.

-- Run VACUUM to reclaim dead space and update FSM
postgres=# VACUUM demo_table;
VACUUM
postgres=#

-- Check FSM per block after VACUUM
postgres=# SELECT
    blkno,
    avail AS free_space_bytes
FROM pg_freespace('demo_table')
ORDER BY blkno
LIMIT 20;
 blkno | free_space_bytes
-------+------------------
     0 |             3936
     1 |             4192
     2 |             3936
     3 |             4064
     4 |             4064
     5 |             4064
     6 |             4064
     7 |             4064
     8 |             4064
     9 |             4064
    10 |             4064
    11 |             4064
    12 |             4064
    13 |             4064
    14 |             4064
    15 |             4064
    16 |             4064
    17 |             4064
    18 |             4064
    19 |             4064
(20 rows)

postgres=#

-- Summary after VACUUM
postgres=# SELECT
    count(*) AS total_pages,
    avg(avail)::int AS avg_free_space,
    min(avail) AS min_free_space,
    max(avail) AS max_free_space,
    sum(avail) AS total_free_space
FROM pg_freespace('demo_table');
 total_pages | avg_free_space | min_free_space | max_free_space | total_free_space
-------------+----------------+----------------+----------------+------------------
         313 |           4072 |           3936 |           6624 |          1274464
(1 row)

postgres=#

Result: Each page now reports substantial free space (roughly 3,936 to 4,064 bytes available per page).

7. Insert New Rows & Watch FSM Guide Placement

Let’s insert 2,000 new rows. Watch how PostgreSQL uses the FSM to place them inside existing pages instead of growing the file.

-- 1. Record current page count
postgres=# SELECT pg_relation_size('demo_table') / 8192 AS pages_before_insert;
 pages_before_insert
---------------------
                 313
(1 row)

postgres=#

-- 2. Insert 2,000 new rows
postgres=# INSERT INTO demo_table (name, description)
SELECT
    'NewName_' || generate_series,
    repeat('y', 200)
FROM generate_series(1, 2000);
INSERT 0 2000
postgres=#

-- 3. Check page count again
postgres=# SELECT pg_relation_size('demo_table') / 8192 AS pages_after_insert;
 pages_after_insert
--------------------
                313
(1 row)

postgres=#

What happened?

  • pages_before_insert and pages_after_insert are identical!
  • The table file did not expand at all.
  • The FSM directed PostgreSQL to pages with available free space, allowing the new rows to be inserted into the existing space.
-- Check free space reduction after inserts
postgres=# SELECT
    count(*) AS total_pages,
    avg(avail)::int AS avg_free_space,
    sum(avail) AS total_free_space
FROM pg_freespace('demo_table');
 total_pages | avg_free_space | total_free_space
-------------+----------------+------------------
         313 |           2489 |           778976
(1 row)

postgres=#

8. Compare VACUUM vs VACUUM FULL on FSM

Let’s see how standard VACUUM differs from VACUUM FULL regarding physical disk size and the FSM.

-- 1. Delete more rows
postgres=# DELETE FROM demo_table WHERE id % 3 = 0;
DELETE 2334
postgres=#

-- 2. Run standard VACUUM
postgres=# VACUUM demo_table;
VACUUM
postgres=#

-- Table size remains the same (space is kept for Postgres reuse, not given back to OS)
postgres=# SELECT pg_size_pretty(pg_relation_size('demo_table')) AS size_after_vacuum;
 size_after_vacuum
-------------------
 2504 kB
(1 row)

postgres=#
postgres=# SELECT sum(avail) AS total_free_after_vacuum FROM pg_freespace('demo_table');
 total_free_after_vacuum
-------------------------
                 1351904
(1 row)

postgres=#

-- 3. Run VACUUM FULL (Rewrites and compacts entire table)
postgres=# VACUUM FULL demo_table;
VACUUM
postgres=#

-- Physical table size shrinks on disk
postgres=# SELECT pg_size_pretty(pg_relation_size('demo_table')) AS size_after_vacuum_full;
 size_after_vacuum_full
------------------------
 1168 kB
(1 row)

postgres=#

-- The FSM free space is reset because the table has been reduced to fewer pages. As a result, PostgreSQL has fewer pages to track for free space.
Note: VACUUM FULL rewrites the entire table into a new file on disk.

postgres=# SELECT coalesce(sum(avail), 0) AS total_free_after_vacuum_full FROM pg_freespace('demo_table');
 total_free_after_vacuum_full
------------------------------
                            0
(1 row)

postgres=#
postgres=# SELECT pg_relation_filepath('demo_table');
 pg_relation_filepath
----------------------
 base/5/65859
(1 row)

postgres=#
[postgres@pgdb01 ~]$ ls -la /pgData/pgsql17/data/base/5/65859*
-rw-------. 1 postgres postgres 1196032 Sep 23 18:18 /pgData/pgsql17/data/base/5/65859
[postgres@pgdb01 ~]$

Warning: VACUUM FULL rewrites the entire table into a new file on disk. It places an EXCLUSIVE LOCK on the table, blocking all reads and writes until it finishes. Use with caution in production!

9. Quick Cheatsheet

ConceptDescription
What is FSM?A binary tree tracking free space across all 8 KB pages in a table.
PurposeSpeeds up INSERT/UPDATE by finding pages with room instantly.
Who updates it?VACUUM / autovacuum updates the FSM after cleaning dead rows.
Inspection ToolSELECT * FROM pg_freespace('table_name');
Disk FileStored alongside the main table file with the _fsm suffix.
Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
Thank you
Rajasekhar Amudala

VACUUM in PostgreSQL

VACUUM in PostgreSQL

Table of Contents



1. Why Do We Need VACUUM? (The Problem)

Because of  MVCC, PostgreSQL does not directly overwrite a row when you run an UPDATE, and it does not immediately remove the old row data when you run a DELETE.

  • An UPDATE creates a brand-new row and marks the old one as “dead”.
  • A DELETE simply marks the existing row as “dead”.

Over time, these “dead rows” (also called dead tuples) accumulate. This is called table bloat. It wastes disk space and slows down your queries.

VACUUM is PostgreSQL’s garbage collector. It cleans up dead rows so your database stays fast and lean.

2. Setting Up a Test Table

Let’s create a playground table and insert 1,00,00,000 rows to see VACUUM in action.

-- Create a sample items table
postgres=# DROP TABLE IF EXISTS items;
DROP TABLE
postgres=# CREATE TABLE items (
    id SERIAL PRIMARY KEY,
    name TEXT,
    price INT
);
CREATE TABLE
postgres=#

-- Disable autovacuum for one test table, just for DEMO

postgres=# ALTER TABLE items SET (autovacuum_enabled = false);
ALTER TABLE
postgres=#

postgres=# SELECT relname, reloptions FROM pg_class WHERE relname = 'items';
 relname |         reloptions
---------+----------------------------
 items   | {autovacuum_enabled=false}
(1 row)

postgres=#

-- Insert 1,00,00,000 rows

postgres=# INSERT INTO items (name, price)
SELECT
    'Item ' || generate_series,
    (random() * 100)::INT
FROM generate_series(1, 10000000);
INSERT 0 10000000
postgres=#

-- Table physical path
postgres=# SELECT pg_relation_filepath('public.items');
 pg_relation_filepath
----------------------
 base/5/65690
(1 row)

postgres=#

[postgres@pgdb01 5]$ ls -lrth /pgData/pgsql17/data/base/5/65690*
-rw-------. 1 postgres postgres 144K Sep 22 19:09 /pgData/pgsql17/data/base/5/65690_fsm
-rw-------. 1 postgres postgres 498M Sep 22 19:13 /pgData/pgsql17/data/base/5/65690
[postgres@pgdb01 5]$

3. Creating Table Bloat (Generating Dead Rows)

Now let’s update all 1,00,00,000 rows. This will generate 1,00,00,000 dead rows alongside the 1,00,00,000 new rows.

-- Update every row
postgres=# UPDATE items SET price = price + 10;
UPDATE 10000000
postgres=#

4. Inspecting Dead Rows & Table Size

Let’s check how many dead rows exist and how large the table has become.

-- Check dead row count

postgres=# SELECT relname, n_live_tup, n_dead_tup FROM pg_stat_user_tables WHERE relname = 'items';
 relname | n_live_tup | n_dead_tup
---------+------------+------------
 items   |   10000147 |   10000000
(1 row)

postgres=# 

-- Check physical disk size of the table

postgres=# SELECT pg_size_pretty(pg_total_relation_size('items')) AS total_size;
 total_size
------------
 1424 MB
(1 row)

postgres=#

[postgres@pgdb01 5]$ ls -lrth /pgData/pgsql17/data/base/5/65690*
-rw-------. 1 postgres postgres 272K Sep 22 19:16 /pgData/pgsql17/data/base/5/65690_fsm
-rw-------. 1 postgres postgres 996M Sep 22 19:16 /pgData/pgsql17/data/base/5/65690
[postgres@pgdb01 5]$

5. Standard VACUUM (Reclaiming Space for Reuse)

A standard VACUUM marks the dead rows as free space so future INSERT or UPDATE operations can reuse it, but it won’t release free space to the OS

-- Run standard vacuum
postgres=# VACUUM VERBOSE items;
INFO:  vacuuming "postgres.public.items"
INFO:  finished vacuuming "postgres.public.items": index scans: 1
pages: 0 removed, 127389 remain, 127389 scanned (100.00% of total)
tuples: 10000000 removed, 10000000 remain, 0 are dead but not yet removable
removable cutoff: 2178, which was 0 XIDs old when operation ended
new relfrozenxid: 2176, which is 4 XIDs ahead of previous value
frozen: 48685 pages from table (38.22% of total) had 7643430 tuples frozen
index scan needed: 63695 pages from table (50.00% of total) had 10000000 dead item identifiers removed
index "items_pkey": pages: 54839 in total, 0 newly deleted, 0 currently deleted, 0 reusable
avg read rate: 64.788 MB/s, avg write rate: 69.883 MB/s
buffer usage: 146023 hits, 227350 misses, 245229 dirtied
WAL usage: 455518 records, 245755 full page images, 1191493291 bytes
system usage: CPU: user: 10.29 s, system: 2.81 s, elapsed: 27.41 s
INFO:  vacuuming "postgres.pg_toast.pg_toast_65690"
INFO:  finished vacuuming "postgres.pg_toast.pg_toast_65690": index scans: 0
pages: 0 removed, 0 remain, 0 scanned (100.00% of total)
tuples: 0 removed, 0 remain, 0 are dead but not yet removable
removable cutoff: 2178, which was 0 XIDs old when operation ended
new relfrozenxid: 2178, which is 6 XIDs ahead of previous value
frozen: 0 pages from table (100.00% of total) had 0 tuples frozen
index scan not needed: 0 pages from table (100.00% of total) had 0 dead item identifiers removed
avg read rate: 1.178 MB/s, avg write rate: 1.178 MB/s
buffer usage: 9 hits, 1 misses, 1 dirtied
WAL usage: 1 records, 1 full page images, 7245 bytes
system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
VACUUM
postgres=#


-- Check dead rows again

postgres=# SELECT relname, n_live_tup, n_dead_tup FROM pg_stat_user_tables WHERE relname = 'items';
 relname | n_live_tup | n_dead_tup
---------+------------+------------
 items   |   10000000 |          0  <---- all dead rows deleted.
(1 row)

postgres=# SELECT pg_size_pretty(pg_total_relation_size('items')) AS total_size;
 total_size
------------
 1424 MB      <--------- free space won't release to the OS, We can only reuse the unused space.
(1 row)

postgres=#

Important Note on Standard VACUUM:

  • n_dead_tup dropped to 0 (the garbage was cleaned).
  • However, if you check pg_total_relation_size('items'), it will still show 1424 MB.
  • Standard VACUUM does not shrink the file size back to the operating system. Instead, it keeps the empty slots ready inside PostgreSQL so new inserts won’t require growing the file again.
  • Non-blocking: Standard VACUUM allows normal SELECT, INSERT, UPDATE, and DELETE queries to continue running while it works.

6. VACUUM FULL (Shrinking Disk Space to the OS)

If you deleted millions of rows and you must return the unused disk space back to your operating system, you need VACUUM FULL.

-- Check table size
postgres=# SELECT pg_size_pretty(pg_total_relation_size('items')) AS total_size;
 total_size
------------
 1424 MB
(1 row)

postgres=#

-- Run VACUUM FULL
postgres=# VACUUM FULL items;
VACUUM
postgres=#

-- Check table size again
postgres=# SELECT pg_size_pretty(pg_total_relation_size('items')) AS total_size;
 total_size
------------
 712 MB  <--- shrunk back down to original size!, free space released to the OS. 
(1 row)

postgres=#

-- VACUUM FULL rewrites the entire table into a new file on disk.

[postgres@pgdb01 5]$ ls -lrth /pgData/pgsql17/data/base/5/65690*
-rw-------. 1 postgres postgres 0 Sep 22 19:23 /pgData/pgsql17/data/base/5/65690
[postgres@pgdb01 5]$

postgres=# SELECT pg_relation_filepath('public.items');
 pg_relation_filepath
----------------------
 base/5/65698
(1 row)

postgres=#

[postgres@pgdb01 5]$ ls -lrth /pgData/pgsql17/data/base/5/65698*
-rw-------. 1 postgres postgres 498M Sep 22 19:23 /pgData/pgsql17/data/base/5/65698
[postgres@pgdb01 5]$

65690 -- This file no more availble.

Warning: VACUUM FULL rewrites the entire table into a new file on disk. It places an EXCLUSIVE LOCK on the table, blocking all reads and writes until it finishes. Use with caution in production!

7. VACUUM ANALYZE (Optimizing Query Performance)

Whenever data changes significantly, PostgreSQL’s query optimizer needs updated statistics to choose the fastest query plan.

VACUUM ANALYZE cleans up dead rows and refreshes the planner’s statistics in a single command:

-- Clean dead rows + update query planner statistics
postgres=# VACUUM ANALYZE items;
VACUUM
postgres=#

Pro Tip: Always run VACUUM ANALYZE after large bulk imports or mass data updates.

8. Autovacuum: The Background Worker

You don’t need to manually run VACUUM all day. PostgreSQL includes a daemon called Autovacuum that triggers automatically when a table exceeds a dead-tuple threshold (by default, when ~20% of rows are modified).

-- It was disabled for DEMO, enable back to ture.
postgres=# ALTER TABLE items SET (autovacuum_enabled = true);
ALTER TABLE
postgres=#

--- Confirming default autovacuum settings

postgres=# SHOW autovacuum;
 autovacuum
------------
 on
(1 row)

postgres=# SHOW autovacuum_naptime;
 autovacuum_naptime
--------------------
 1min
(1 row)

postgres=# SHOW autovacuum_vacuum_threshold;
 autovacuum_vacuum_threshold
-----------------------------
 50
(1 row)

postgres=# SHOW autovacuum_vacuum_scale_factor;
 autovacuum_vacuum_scale_factor
--------------------------------
 0.2
(1 row)

postgres=#

-- Check when autovacuum last cleaned your tables
postgres=# SELECT
    relname,
    last_vacuum,
    last_autovacuum,
    last_analyze,
    last_autoanalyze
FROM pg_stat_user_tables
WHERE relname = 'items';
 relname |         last_vacuum          | last_autovacuum |         last_analyze          | last_autoanalyze
---------+------------------------------+-----------------+-------------------------------+------------------
 items   | 2026-09-22 19:28:22.29634+08 |                 | 2026-09-22 19:28:22.992613+08 |
(1 row)

postgres=#

-- LOAD some data and check again autovacuum last cleaned status

postgres=# UPDATE items SET price = price + 20;
UPDATE 10000000
postgres=#

postgres=# SELECT
    relname,
    last_vacuum,
    last_autovacuum,
    last_analyze,
    last_autoanalyze
FROM pg_stat_user_tables
WHERE relname = 'items';
 relname |         last_vacuum          |        last_autovacuum        |         last_analyze          |       last_autoanalyze
---------+------------------------------+-------------------------------+-------------------------------+-------------------------------
 items   | 2026-09-22 19:28:22.29634+08 | 2026-09-22 19:40:56.685873+08 | 2026-09-22 19:28:22.992613+08 | 2026-09-22 19:40:58.096743+08
(1 row)

postgres=#

Note: Autovacuum automatically performs VACUUM to clean up obsolete row versions and ANALYZE to maintain optimizer statistics. It does NOT performs VACUUM FULL.

9. Quick Summary Cheatsheet

CommandWhat it DoesReclaims OS Disk?Locks Table?
VACUUMCleans dead rows; marks space reusable for PostgresNoNo (Safe)
VACUUM ANALYZECleans dead rows + updates optimizer statisticsNoNo (Safe)
VACUUM FULLRewrites table completely, shrinks file sizeYesYes (Exclusive lock)
AutovacuumRuns standard vacuum automatically in backgroundNoNo (Safe)
Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
Thank you
Rajasekhar Amudala

MVCC in PostgreSQL

MVCC in PostgreSQL

Table of Contents



1. The Core Concept (Why MVCC?)

MVCC stands for Multi-Version Concurrency Control.

Its primary goal is simple: Readers should never block Writers, and Writers should never block Readers.

Instead of locking a row when someone is updating it (which makes everyone else wait), PostgreSQL keeps multiple versions of the same row active at the same time. Different transactions see different versions depending on when they started.

2. Hidden Columns (xmin & xmax)

Every table you create in PostgreSQL has hidden system columns. The two most important ones for MVCC are:

  • xmin: The Transaction ID that created/inserted this row version.
  • xmax: The Transaction ID that deleted or updated this row version. (If it is 0, the row is still actively alive).
-- To view these columns by explicitly querying them:
SELECT xmin, xmax, * FROM table_name;

3. Create a Test Table

-- Create a simple products table and  insert our first record and see how Postgres assigns the transaction ID.

[postgres@pgdb01 ~]$ psql -c "CREATE TABLE products (id SERIAL PRIMARY KEY,name TEXT,price INT);"
CREATE TABLE
[postgres@pgdb01 ~]$

-- Insert a row
[postgres@pgdb01 ~]$ psql -c "INSERT INTO products (name, price) VALUES ('Laptop', 1000);"
INSERT 0 1
[postgres@pgdb01 ~]$ 

-- Query the row with xmin and xmax
[postgres@pgdb01 ~]$ psql -c "SELECT xmin, xmax, id, name, price FROM products;"
 xmin | xmax | id |  name  | price
------+------+----+--------+-------
 2156 |    0 |  1 | Laptop |  1000
(1 row)

[postgres@pgdb01 ~]$
  • xmin = 2156: xmin represents the transaction ID that created the row version. xmin = 2156
  • xmax = 0: xmax represents the transaction ID that deleted or updated. xmax = 0 means No one has deleted/updated it yet . It is actively visible to everyone.

4. UPDATE Creates a New Version

Now, let’s see MVCC in action. Open two separate database sessions/terminal windows.

Terminal 1 (The Writer): Start a transaction and update the price, but do not commit yet.

postgres=# BEGIN;
BEGIN
postgres=*# SELECT txid_current();
 txid_current
--------------
         2157
(1 row)

postgres=*# UPDATE products SET price = 1200 WHERE id = 1;
UPDATE 1
postgres=*#

Terminal 2 (The Reader): Check what Terminal 2 sees:

[postgres@pgdb01 ~]$ psql -c "SELECT xmin, xmax, id, name, price FROM products;"
 xmin | xmax | id |  name  | price
------+------+----+--------+-------
 2156 | 2157 |  1 | Laptop |  1000
(1 row)

[postgres@pgdb01 ~]$
Internally, PostgreSQL creates a new row version.

Before UPDATE

Row Version A
+----------------+
| id = 1         |
| price = 1000   |
+----------------+


After UPDATE

Old Version                New Version
+----------------+          +----------------+
| id = 1         |          | id = 1         |
| price = 1000   |          | price = 1200   |
| xmax = 2157    |          | xmin = 2157    |
+----------------+          +----------------+
        |                           |
        | old version               | new version
        v                           v
      xmax                         xmin

xmax = old version (xmax refers Dead rows)
xmin = new version
The old row version is not immediately physically removed.
  • The reader still sees the original price of 1000. They are not blocked!
  • The row now has an xmax of 2157. This tells Postgres: “Transaction 2157 is currently changing or deleting this row. If you aren’t Transaction 2157, keep looking at the old data.”
  • Under the hood, Postgres has already written a new row version with a price of 1200 and xmin = 2157, but it is completely invisible to Terminal 2 because transaction 2157 hasn’t committed yet.

5. After COMMIT

Let’s finalize the transaction and see the transition.

Terminal 1 (The Writer): Commit the change.

postgres=# BEGIN;
BEGIN
postgres=*# SELECT txid_current();
 txid_current
--------------
         2157
(1 row)

postgres=*# UPDATE products SET price = 1200 WHERE id = 1;
UPDATE 1
postgres=*# COMMIT;   <------------------ (only run COMMIT)
COMMIT
postgres=#

Terminal 2 (The Reader): Query the table again. What Terminal 2 sees now

[postgres@pgdb01 ~]$ psql -c "SELECT xmin, xmax, id, name, price FROM products;"
 xmin | xmax | id |  name  | price
------+------+----+--------+-------
 2157 |    0 |  1 | Laptop |  1200
(1 row)

[postgres@pgdb01 ~]$
  • The old row version (price 1000) is now marked as dead(invisible).
  • The new row version (price 1200) is now alive(current row) with xmin = 2157 and xmax = 0.

6. DELETE Doesn’t Actually Delete

In Postgres, a DELETE statement does not physically erase data from the hard drive immediately. It just changes a flag.

postgres=# BEGIN;
BEGIN
postgres=*# DELETE FROM products WHERE id = 1;
DELETE 1
postgres=*# SELECT txid_current();
 txid_current
--------------
         2158
(1 row)

postgres=*# COMMIT;
COMMIT
postgres=#


A DELETE Internally, simply marks the existing row as dead.

Before DELETE

+----------------+
| id=1           |
| pirce = 1200   |
+----------------+

After DELETE

+----------------+
| id=1           |
| price = 1200   |
| xmax = 2158    |
+----------------+

Later, VACUUM can remove dead tuples when they are no longer needed by active transactions.

Under the hood, Postgres simply updated the existing row’s xmax value to 2158. Because transaction 2158 is committed, Postgres now knows that this row is dead and shouldn’t be shown to any new queries. The actual space on the disk won’t be freed until we vacuum.

7. Dead tuples and VACUUM

Because UPDATE creates new rows and DELETE just marks them as dead, database will accumulate “dead tuples” (bloat) over time.
In simple way, Since UPDATE and DELETE don’t remove old rows, dead rows pile up. This is called bloat.

Postgres uses a process called VACUUM to find these dead rows, clear them out, and mark that space as reusable for future inserts.

-- 1. Check how many dead rows are lurking a table

[postgres@pgdb01 ~]$ psql -c "SELECT relname, n_live_tup, n_dead_tup FROM pg_stat_user_tables WHERE relname = 'products';"
 relname  | n_live_tup | n_dead_tup
----------+------------+------------
 products |          0 |          2   <--------------------
(1 row)

[postgres@pgdb01 ~]$


-- 2. Run a manual vacuum to clean up

[postgres@pgdb01 ~]$ psql -c "VACUUM VERBOSE products;"
INFO:  vacuuming "postgres.public.products"
INFO:  table "products": truncated 1 to 0 pages
INFO:  finished vacuuming "postgres.public.products": index scans: 1
pages: 1 removed, 0 remain, 1 scanned (100.00% of total)
tuples: 2 removed, 0 remain, 0 are dead but not yet removable
removable cutoff: 2159, which was 1 XIDs old when operation ended
new relfrozenxid: 2159, which is 4 XIDs ahead of previous value
frozen: 0 pages from table (0.00% of total) had 0 tuples frozen
index scan needed: 1 pages from table (100.00% of total) had 1 dead item identifiers removed
index "products_pkey": pages: 2 in total, 0 newly deleted, 0 currently deleted, 0 reusable
avg read rate: 0.000 MB/s, avg write rate: 11.905 MB/s
buffer usage: 61 hits, 0 misses, 8 dirtied
WAL usage: 11 records, 8 full page images, 47529 bytes
system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
INFO:  vacuuming "postgres.pg_toast.pg_toast_65663"
INFO:  finished vacuuming "postgres.pg_toast.pg_toast_65663": index scans: 0
pages: 0 removed, 0 remain, 0 scanned (100.00% of total)
tuples: 0 removed, 0 remain, 0 are dead but not yet removable
removable cutoff: 2160, which was 0 XIDs old when operation ended
new relfrozenxid: 2160, which is 5 XIDs ahead of previous value
frozen: 0 pages from table (100.00% of total) had 0 tuples frozen
index scan not needed: 0 pages from table (100.00% of total) had 0 dead item identifiers removed
avg read rate: 22.978 MB/s, avg write rate: 22.978 MB/s
buffer usage: 27 hits, 1 misses, 1 dirtied
WAL usage: 1 records, 1 full page images, 8097 bytes
system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
VACUUM
[postgres@pgdb01 ~]$


-- 3. Check again; dead rows should now be 0

[postgres@pgdb01 ~]$ psql -c "SELECT relname, n_live_tup, n_dead_tup FROM pg_stat_user_tables WHERE relname = 'products';"
 relname  | n_live_tup | n_dead_tup
----------+------------+------------
 products |          0 |          0  
(1 row)

[postgres@pgdb01 ~]$

Note: PostgreSQL runs an Autovacuum background process automatically, so you rarely need to run manual vacuums in production.

8. Quick Summary Cheatsheet

To keep MVCC simple, remember these four rules:

OperationWhat Postgres Actually Does
INSERTCreates a row with xmin = Current TXID.
DELETEMark row as dead, does not physically erase it. Sets xmax = Current TXID
UPDATE INSERT new version + DELETE (mark old version as dead).
VACUUMSweeps up the dead rows to reclaim storage space.
Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
Thank you
Rajasekhar Amudala

Install EDB Postgres Advanced Server 17 on Linux 8

Install EDB Postgres Advanced Server 17 on Linux 8

Table of Contents



1. Setup EDB repository

--Logon https://www.enterprisedb.com/repos and select --->  RHEL8 x86_64 then ----> EDB Postgres Advanced Server  ---> 17

[root@lxtrdedbpsgv01 ~]# curl -1sSLf 'https://downloads.enterprisedb.com/PMuvhbPsvEt9Rd4ORs5gnUT6z1L4P85R/enterprise/setup.rpm.sh' | sudo -E bash
Executing the  setup script for the 'enterprisedb/enterprise' repository ...

   OK: Checking for required executable 'curl' ...
   OK: Checking for required executable 'rpm' ...
   OK: Detecting your OS distribution and release using system methods ...
 ^^^^: ... Detected/provided for your OS/distribution, version and architecture:
 >>>>:
 >>>>: ... distro=ol  version=8.7  codename=8.7  arch=x86_64
 >>>>:
   OK: Importing 'enterprisedb/enterprise' repository GPG keys into rpm ...
   OK: Checking for available package manager (DNF/Microdnf/YUM/Zypper) ...
 ^^^^: ... Detected package manager as 'dnf'
   OK: Checking for dnf dependency 'dnf-plugins-core' ...
   OK: Checking if upstream install config is OK ...
   OK: Fetching 'enterprisedb/enterprise' repository configuration ...
   OK: Installing 'enterprisedb/enterprise' repository via dnf ...
  RUN: Updating the dnf cache to fetch the new repository metadata ...Importing GPG key 0x9F1EF813:
 Userid     : "Cloudsmith Package (enterprisedb/enterprise) <support@cloudsmith.io>"
 Fingerprint: 31A4 CF09 0B3A E265 F131 58DE E71E B082 9F1E F813
 From       : https://downloads.enterprisedb.com/PMuvhbPsvEt9Rd4ORs5gnUT6z1L4P85R/enterprise/gpg.E71EB0829F1EF813.key
Importing GPG key 0x9F1EF813:
 Userid     : "Cloudsmith Package (enterprisedb/enterprise) <support@cloudsmith.io>"
 Fingerprint: 31A4 CF09 0B3A E265 F131 58DE E71E B082 9F1E F813
 From       : https://downloads.enterprisedb.com/PMuvhbPsvEt9Rd4ORs5gnUT6z1L4P85R/enterprise/gpg.E71EB0829F1EF813.key
Importing GPG key 0x9F1EF813:
 Userid     : "Cloudsmith Package (enterprisedb/enterprise) <support@cloudsmith.io>"
 Fingerprint: 31A4 CF09 0B3A E265 F131 58DE E71E B082 9F1E F813
 From       : https://downloads.enterprisedb.com/PMuvhbPsvEt9Rd4ORs5gnUT6z1L4P85R/enterprise/gpg.E71EB0829F1EF813.key
   OK: Updating the dnf cache to fetch the new repository metadata ...
   OK: The repository has been installed successfully - You're ready to rock!

[root@lxtrdedbpsgv01 ~]#

[root@lxtrdedbpsgv01 ~]# dnf repolist | grep -i enterprisedb
enterprisedb-enterprise        enterprisedb-enterprise
enterprisedb-enterprise-noarch enterprisedb-enterprise-noarch
enterprisedb-enterprise-source enterprisedb-enterprise-source
[root@lxtrdedbpsgv01 ~]#

2. Install EDB Postgres Advanced Server 17

[root@lxtrdedbpsgv01 ~]# dnf -y install edb-as17-server
..
Dependencies resolved.
========================================================================================================================================================================================================================================
 Package                                                         Architecture                                 Version                                               Repository                                                     Size
========================================================================================================================================================================================================================================
Installing:
 edb-as17-server                                                 x86_64                                       17.11.0-1.el8                                         enterprisedb-enterprise                                        12 k
Installing dependencies:
 edb-as17-server-client                                          x86_64                                       17.11.0-1.el8                                         enterprisedb-enterprise                                       2.2 M
 edb-as17-server-contrib                                         x86_64                                       17.11.0-1.el8                                         enterprisedb-enterprise                                       831 k
 edb-as17-server-core                                            x86_64                                       17.11.0-1.el8                                         enterprisedb-enterprise                                       7.4 M
 edb-as17-server-docs                                            x86_64                                       17.11.0-1.el8                                         enterprisedb-enterprise                                        21 k
 edb-as17-server-ecpg                                            x86_64                                       17.11.0-1.el8                                         enterprisedb-enterprise                                       416 k
 edb-as17-server-libs                                            x86_64                                       17.11.0-1.el8                                         enterprisedb-enterprise                                       652 k
 edb-as17-server-plperl                                          x86_64                                       17.11.0-1.el8                                         enterprisedb-enterprise                                        76 k
 edb-as17-server-plpython3                                       x86_64                                       17.11.0-1.el8                                         enterprisedb-enterprise                                       110 k
 edb-as17-server-pltcl                                           x86_64                                       17.11.0-1.el8                                         enterprisedb-enterprise                                        49 k
 edb-libicu66                                                    x86_64                                       66.1-3.el8                                            enterprisedb-enterprise                                       9.2 M
 tcl                                                             x86_64                                       1:8.6.8-2.el8                                         ol8_baseos_latest                                             1.1 M
Installing weak dependencies:
 beacon-agent                                                    x86_64                                       1.401.5-1                                             enterprisedb-enterprise                                       115 M

Transaction Summary
========================================================================================================================================================================================================================================
Install  13 Packages

Total download size: 137 M
Installed size: 412 M
Downloading Packages:
(1/13): edb-as17-server-17.11.0-1.el8.x86_64.rpm                                                                                                                                                        9.1 kB/s |  12 kB     00:01
(2/13): edb-as17-server-client-17.11.0-1.el8.x86_64.rpm                                                                                                                                                 1.0 MB/s | 2.2 MB     00:02
(3/13): edb-as17-server-contrib-17.11.0-1.el8.x86_64.rpm                                                                                                                                                448 kB/s | 831 kB     00:01
(4/13): edb-as17-server-docs-17.11.0-1.el8.x86_64.rpm                                                                                                                                                    17 kB/s |  21 kB     00:01
(5/13): edb-as17-server-core-17.11.0-1.el8.x86_64.rpm                                                                                                                                                   2.8 MB/s | 7.4 MB     00:02
(6/13): edb-as17-server-ecpg-17.11.0-1.el8.x86_64.rpm                                                                                                                                                   273 kB/s | 416 kB     00:01
(7/13): edb-as17-server-libs-17.11.0-1.el8.x86_64.rpm                                                                                                                                                   433 kB/s | 652 kB     00:01
(8/13): edb-as17-server-plperl-17.11.0-1.el8.x86_64.rpm                                                                                                                                                  54 kB/s |  76 kB     00:01
(9/13): edb-as17-server-plpython3-17.11.0-1.el8.x86_64.rpm                                                                                                                                               72 kB/s | 110 kB     00:01
(10/13): edb-as17-server-pltcl-17.11.0-1.el8.x86_64.rpm                                                                                                                                                  50 kB/s |  49 kB     00:00
(11/13): tcl-8.6.8-2.el8.x86_64.rpm                                                                                                                                                                     1.3 MB/s | 1.1 MB     00:00
(12/13): beacon-agent-1.401.5_linux_amd64.rpm                                                                                                                                                           6.9 MB/s | 115 MB     00:16
(13/13): edb-libicu66-66.1-3.el8.x86_64.rpm                                                                                                                                                             1.1 MB/s | 9.2 MB     00:08
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                   8.2 MB/s | 137 MB     00:16
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                1/1
  Installing       : edb-libicu66-66.1-3.el8.x86_64                                                                                                                                                                                1/13
  Running scriptlet: edb-libicu66-66.1-3.el8.x86_64                                                                                                                                                                                1/13
  Installing       : edb-as17-server-libs-17.11.0-1.el8.x86_64                                                                                                                                                                     2/13
  Running scriptlet: edb-as17-server-libs-17.11.0-1.el8.x86_64                                                                                                                                                                     2/13
  Installing       : edb-as17-server-ecpg-17.11.0-1.el8.x86_64                                                                                                                                                                     3/13
  Installing       : edb-as17-server-client-17.11.0-1.el8.x86_64                                                                                                                                                                   4/13
  Running scriptlet: edb-as17-server-client-17.11.0-1.el8.x86_64                                                                                                                                                                   4/13
  Installing       : edb-as17-server-contrib-17.11.0-1.el8.x86_64                                                                                                                                                                  5/13
  Installing       : tcl-1:8.6.8-2.el8.x86_64                                                                                                                                                                                      6/13
  Running scriptlet: tcl-1:8.6.8-2.el8.x86_64                                                                                                                                                                                      6/13
  Installing       : edb-as17-server-docs-17.11.0-1.el8.x86_64                                                                                                                                                                     7/13
  Installing       : beacon-agent-1.401.5-1.x86_64                                                                                                                                                                                 8/13
  Running scriptlet: edb-as17-server-core-17.11.0-1.el8.x86_64                                                                                                                                                                     9/13
  Installing       : edb-as17-server-core-17.11.0-1.el8.x86_64                                                                                                                                                                     9/13
  Running scriptlet: edb-as17-server-core-17.11.0-1.el8.x86_64                                                                                                                                                                     9/13
  Installing       : edb-as17-server-plperl-17.11.0-1.el8.x86_64                                                                                                                                                                  10/13
  Installing       : edb-as17-server-plpython3-17.11.0-1.el8.x86_64                                                                                                                                                               11/13
  Installing       : edb-as17-server-pltcl-17.11.0-1.el8.x86_64                                                                                                                                                                   12/13
  Installing       : edb-as17-server-17.11.0-1.el8.x86_64                                                                                                                                                                         13/13
  Running scriptlet: edb-as17-server-17.11.0-1.el8.x86_64                                                                                                                                                                         13/13
  Verifying        : beacon-agent-1.401.5-1.x86_64                                                                                                                                                                                 1/13
  Verifying        : edb-as17-server-17.11.0-1.el8.x86_64                                                                                                                                                                          2/13
  Verifying        : edb-as17-server-client-17.11.0-1.el8.x86_64                                                                                                                                                                   3/13
  Verifying        : edb-as17-server-contrib-17.11.0-1.el8.x86_64                                                                                                                                                                  4/13
  Verifying        : edb-as17-server-core-17.11.0-1.el8.x86_64                                                                                                                                                                     5/13
  Verifying        : edb-as17-server-docs-17.11.0-1.el8.x86_64                                                                                                                                                                     6/13
  Verifying        : edb-as17-server-ecpg-17.11.0-1.el8.x86_64                                                                                                                                                                     7/13
  Verifying        : edb-as17-server-libs-17.11.0-1.el8.x86_64                                                                                                                                                                     8/13
  Verifying        : edb-as17-server-plperl-17.11.0-1.el8.x86_64                                                                                                                                                                   9/13
  Verifying        : edb-as17-server-plpython3-17.11.0-1.el8.x86_64                                                                                                                                                               10/13
  Verifying        : edb-as17-server-pltcl-17.11.0-1.el8.x86_64                                                                                                                                                                   11/13
  Verifying        : edb-libicu66-66.1-3.el8.x86_64                                                                                                                                                                               12/13
  Verifying        : tcl-1:8.6.8-2.el8.x86_64                                                                                                                                                                                     13/13

Installed:
  beacon-agent-1.401.5-1.x86_64                edb-as17-server-17.11.0-1.el8.x86_64        edb-as17-server-client-17.11.0-1.el8.x86_64   edb-as17-server-contrib-17.11.0-1.el8.x86_64   edb-as17-server-core-17.11.0-1.el8.x86_64
  edb-as17-server-docs-17.11.0-1.el8.x86_64    edb-as17-server-ecpg-17.11.0-1.el8.x86_64   edb-as17-server-libs-17.11.0-1.el8.x86_64     edb-as17-server-plperl-17.11.0-1.el8.x86_64    edb-as17-server-plpython3-17.11.0-1.el8.x86_64
  edb-as17-server-pltcl-17.11.0-1.el8.x86_64   edb-libicu66-66.1-3.el8.x86_64              tcl-1:8.6.8-2.el8.x86_64

Complete!
[root@lxtrdedbpsgv01 ~]#

[root@lxtrdedbpsgv01 ~]# rpm -qa | grep edb-as17
edb-as17-server-libs-17.11.0-1.el8.x86_64
edb-as17-server-plperl-17.11.0-1.el8.x86_64
edb-as17-server-docs-17.11.0-1.el8.x86_64
edb-as17-server-client-17.11.0-1.el8.x86_64
edb-as17-server-pltcl-17.11.0-1.el8.x86_64
edb-as17-server-contrib-17.11.0-1.el8.x86_64
edb-as17-server-core-17.11.0-1.el8.x86_64
edb-as17-server-17.11.0-1.el8.x86_64
edb-as17-server-ecpg-17.11.0-1.el8.x86_64
edb-as17-server-plpython3-17.11.0-1.el8.x86_64
[root@lxtrdedbpsgv01 ~]#
[root@lxtrdedbpsgv01 ~]# /usr/edb/as17/bin/psql --version
psql (EnterpriseDB) 17.11.0
[root@lxtrdedbpsgv01 ~]#

3. Check and reset EDB user password

[root@lxtrdedbpsgv01 ~]# id enterprisedb
uid=972(enterprisedb) gid=972(enterprisedb) groups=972(enterprisedb)
[root@lxtrdedbpsgv01 ~]# getent passwd enterprisedb
enterprisedb:x:972:972:EDBAS User:/var/lib/edb:/bin/bash
[root@lxtrdedbpsgv01 ~]#
[root@lxtrdedbpsgv01 ~]# passwd enterprisedb
Changing password for user enterprisedb.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
[root@lxtrdedbpsgv01 ~]#

4. Change ownership for mount points

[root@lxtrdedbpsgv01 ~]# chown -R enterprisedb:enterprisedb /edb*
[root@lxtrdedbpsgv01 ~]#
[root@lxtrdedbpsgv01 ~]# df -h /edb/*
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdf1       100G  746M  100G   1% /edb/pgArch
/dev/sdd1       100G  746M  100G   1% /edb/pgBackup
/dev/sdb1       100G  746M  100G   1% /edb/pgData
/dev/sde1       100G  746M  100G   1% /edb/pgBin
/dev/sdc1       100G  746M  100G   1% /edb/tsdata
[root@lxtrdedbpsgv01 ~]#

5. Setup custom Bin directory (Optional)

[root@lxtrdedbpsgv01 ~]# ls -l /usr/edb/as17/
total 36
drwxr-xr-x. 2 root root  4096 Aug 22 03:49 bin
-r--r--r--. 1 root root 15716 Aug 12 12:26 edb-as17-server_license.txt
drwxr-xr-x. 3 root root  8192 Aug 22 03:49 lib
drwxr-xr-x. 9 root root  4096 Aug 22 03:49 share
[root@lxtrdedbpsgv01 ~]#
[root@lxtrdedbpsgv01 ~]# cp -rp /usr/edb/as17 /edb/pgBin
[root@lxtrdedbpsgv01 ~]# 
[root@lxtrdedbpsgv01 ~]# ls -l /edb/pgBin/as17/
total 32
drwxr-xr-x. 2 root root  4096 Aug 22 03:49 bin
-r--r--r--. 1 root root 15716 Aug 12 12:26 edb-as17-server_license.txt
drwxr-xr-x. 3 root root  4096 Aug 22 03:49 lib
drwxr-xr-x. 9 root root  4096 Aug 22 03:49 share
[root@lxtrdedbpsgv01 ~]#
[root@lxtrdedbpsgv01 ~]# chown -R enterprisedb:enterprisedb /edb/pgBin/*
[root@lxtrdedbpsgv01 ~]# ls -l /edb/pgBin/as17/
total 32
drwxr-xr-x. 2 enterprisedb enterprisedb  4096 Aug 22 03:49 bin
-r--r--r--. 1 enterprisedb enterprisedb 15716 Aug 12 12:26 edb-as17-server_license.txt
drwxr-xr-x. 3 enterprisedb enterprisedb  4096 Aug 22 03:49 lib
drwxr-xr-x. 9 enterprisedb enterprisedb  4096 Aug 22 03:49 share
[root@lxtrdedbpsgv01 ~]#


One caution: simply copying /usr/edb/as17 can miss RPM-managed symlinks, configuration files, or dependencies outside that directory. Also, future dnf update operations will update /usr/edb/as17, but will not automatically update /edb/pgBase. So after an EDB RPM upgrade, you would need to copy the new binaries again. 
rsync -av /usr/edb/as17/ /edb/pgBin/as17

6. Configure environment variables

[root@lxtrdedbpsgv01 ~]# su - enterprisedb
[enterprisedb@lxtrdedbpsgv01 ~]$
[enterprisedb@lxtrdedbpsgv01 ~]$ cat .bash_profile

export PGHOME=/edb/pgBin/as17
export PGDATA=/edb/pgData/as17/data
export PATH=$PGHOME/bin:$PATH

[enterprisedb@lxtrdedbpsgv01 ~]$ . .bash_profile
[enterprisedb@lxtrdedbpsgv01 ~]$ which pg_ctl
/edb/pgBin/as17/bin/pg_ctl
[enterprisedb@lxtrdedbpsgv01 ~]$ which psql
/edb/pgBin/as17/bin/psql
[enterprisedb@lxtrdedbpsgv01 ~]$ which pg_basebackup
/edb/pgBin/as17/bin/pg_basebackup
[enterprisedb@lxtrdedbpsgv01 ~]$ which pg_rewind
/edb/pgBin/as17/bin/pg_rewind
[enterprisedb@lxtrdedbpsgv01 ~]$
[enterprisedb@lxtrdedbpsgv01 ~]$ pg_ctl --version
pg_ctl (EnterpriseDB) 17.11.0
[enterprisedb@lxtrdedbpsgv01 ~]$ psql --version
psql (EnterpriseDB) 17.11.0
[enterprisedb@lxtrdedbpsgv01 ~]$

7. Initialize the database

[enterprisedb@lxtrdedbpsgv01 ~]$ which initdb
/edb/pgBin/as17/bin/initdb
[enterprisedb@lxtrdedbpsgv01 ~]$
[enterprisedb@lxtrdedbpsgv01 ~]$ initdb --version
initdb (EnterpriseDB) 17.11.0
[enterprisedb@lxtrdedbpsgv01 ~]$
[enterprisedb@lxtrdedbpsgv01 ~]$ which edb-as-17-setup
/edb/pgBin/as17/bin/edb-as-17-setup
[enterprisedb@lxtrdedbpsgv01 ~]$

[enterprisedb@lxtrdedbpsgv01 ~]$ ls -ld /edb/pgData/as17/data
ls: cannot access '/edb/pgData/as17/data': No such file or directory
[enterprisedb@lxtrdedbpsgv01 ~]$
[enterprisedb@lxtrdedbpsgv01 ~]$ mkdir -p /edb/pgData/as17/data
[enterprisedb@lxtrdedbpsgv01 ~]$
[enterprisedb@lxtrdedbpsgv01 ~]$ chmod 700 /edb/pgData/as17/data
[enterprisedb@lxtrdedbpsgv01 ~]$ ls -ld /edb/pgData/as17/data
drwx------. 2 enterprisedb enterprisedb 6 Aug 22 06:16 /edb/pgData/as17/data
[enterprisedb@lxtrdedbpsgv01 ~]$

[enterprisedb@lxtrdedbpsgv01 ~]$ /edb/pgBin/as17/bin/initdb -D /edb/pgData/as17/data
The files belonging to this database system will be owned by user "enterprisedb".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.
Transparent data encryption is disabled.

fixing permissions on existing directory /edb/pgData/as17/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 100
selecting default "shared_buffers" ... 128MB
selecting default time zone ... America/New_York
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
creating edb sys ... ok
loading edb contrib modules ...
edb_redwood_bytea.sql
edb_redwood_date.sql
dbms_alert_public.sql
dbms_alert.plb
dbms_assert_public.sql
dbms_assert.plb
dbms_job_public.sql
dbms_job.plb
dbms_lob_public.sql
dbms_lob.plb
dbms_output_public.sql
dbms_output.plb
dbms_pipe_public.sql
dbms_pipe.plb
dbms_rls_public.sql
dbms_rls.plb
dbms_sql_public.sql
dbms_sql.plb
dbms_utility_public.sql
dbms_utility.plb
dbms_aqadm_public.sql
dbms_aqadm.plb
dbms_aq_public.sql
dbms_aq.plb
dbms_profiler_public.sql
dbms_profiler.plb
dbms_random_public.sql
dbms_random.plb
dbms_redact_public.sql
dbms_redact.plb
dbms_lock_public.sql
dbms_lock.plb
dbms_scheduler_public.sql
dbms_scheduler.plb
dbms_crypto_public.sql
dbms_crypto.plb
dbms_mview_public.sql
dbms_mview.plb
dbms_session_public.sql
dbms_session.plb
xmltype_public.sql
xmltype.plb
dbms_xmldom_public.sql
dbms_xmldom.plb
dbms_privilege_capture_public.sql
dbms_privilege_capture.plb
edb_bulkload.sql
edb_gen.sql
edb_objects.sql
edb_redwood_casts.sql
edb_redwood_nls.sql
edb_redwood_strings.sql
edb_redwood_views.sql
utl_encode_public.sql
utl_encode.plb
utl_http_public.sql
utl_http.plb
utl_file.plb
edb_ht_public.sql
edb_ht.plb
utl_tcp_public.sql
utl_tcp.plb
utl_smtp_public.sql
utl_smtp.plb
utl_mail_public.sql
utl_mail.plb
utl_url_public.sql
utl_url.plb
utl_raw_public.sql
utl_raw.plb
edb_gen_redwood.sql
waitstates.sql
installing extension edb_dblink_libpq ... ok
installing extension edb_dblink_oci ... ok
snap_tables.sql
snap_functions.sql
dblink_ora.sql
sys_stats.sql
ok
finalizing initial databases ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /edb/pgBin/as17/bin/pg_ctl -D /edb/pgData/as17/data -l logfile start

[enterprisedb@lxtrdedbpsgv01 ~]$

8. Start PostgreSQL Service

[enterprisedb@lxtrdedbpsgv01 ~]$ /edb/pgBin/as17/bin/pg_ctl -D /edb/pgData/as17/data -l /tmp/postgresql.log start
waiting for server to start.... done
server started
[enterprisedb@lxtrdedbpsgv01 ~]$

[enterprisedb@lxtrdedbpsgv01 ~]$
[enterprisedb@lxtrdedbpsgv01 ~]$ ps -ef | grep postgres
enterpr+   42936       1  0 06:25 ?        00:00:00 /edb/pgBin/as17/bin/edb-postgres -D /edb/pgData/as17/data
enterpr+   42937   42936  0 06:25 ?        00:00:00 postgres: logger
enterpr+   42938   42936  0 06:25 ?        00:00:00 postgres: checkpointer
enterpr+   42939   42936  0 06:25 ?        00:00:00 postgres: background writer
enterpr+   42941   42936  0 06:25 ?        00:00:00 postgres: walwriter
enterpr+   42942   42936  0 06:25 ?        00:00:00 postgres: autovacuum launcher
enterpr+   42943   42936  0 06:25 ?        00:00:00 postgres: dbms_aq launcher
enterpr+   42944   42936  0 06:25 ?        00:00:00 postgres: logical replication launcher
enterpr+   43022   41905  0 06:28 pts/0    00:00:00 grep --color=auto postgres
[enterprisedb@lxtrdedbpsgv01 ~]$

[enterprisedb@lxtrdedbpsgv01 ~]$ pstree -p 42936
edb-postgres(42936)─┬─edb-postgres(42937)
                    ├─edb-postgres(42938)
                    ├─edb-postgres(42939)
                    ├─edb-postgres(42941)
                    ├─edb-postgres(42942)
                    ├─edb-postgres(42943)
                    └─edb-postgres(42944)
[enterprisedb@lxtrdedbpsgv01 ~]$
[enterprisedb@lxtrdedbpsgv01 ~]$ ls -ltr /edb/pgData/as17/data
total 76
drwx------. 2 enterprisedb enterprisedb     6 Aug 22 06:24 pg_twophase
drwx------. 2 enterprisedb enterprisedb     6 Aug 22 06:24 pg_tblspc
drwx------. 2 enterprisedb enterprisedb     6 Aug 22 06:24 pg_stat_tmp
drwx------. 2 enterprisedb enterprisedb     6 Aug 22 06:24 pg_snapshots
drwx------. 2 enterprisedb enterprisedb     6 Aug 22 06:24 pg_serial
drwx------. 2 enterprisedb enterprisedb     6 Aug 22 06:24 pg_replslot
drwx------. 2 enterprisedb enterprisedb     6 Aug 22 06:24 pg_notify
drwx------. 4 enterprisedb enterprisedb    36 Aug 22 06:24 pg_multixact
drwx------. 2 enterprisedb enterprisedb     6 Aug 22 06:24 pg_dynshmem
drwx------. 2 enterprisedb enterprisedb     6 Aug 22 06:24 pg_commit_ts
-rw-------. 1 enterprisedb enterprisedb     3 Aug 22 06:24 PG_VERSION
-rw-------. 1 enterprisedb enterprisedb 38410 Aug 22 06:24 postgresql.conf
-rw-------. 1 enterprisedb enterprisedb    88 Aug 22 06:24 postgresql.auto.conf
-rw-------. 1 enterprisedb enterprisedb  2640 Aug 22 06:24 pg_ident.conf
-rw-------. 1 enterprisedb enterprisedb  5711 Aug 22 06:24 pg_hba.conf
drwx------. 2 enterprisedb enterprisedb    18 Aug 22 06:24 pg_xact
drwx------. 2 enterprisedb enterprisedb    18 Aug 22 06:24 pg_subtrans
drwx------. 4 enterprisedb enterprisedb   109 Aug 22 06:24 pg_wal
drwx------. 6 enterprisedb enterprisedb    46 Aug 22 06:24 base
drwx------. 4 enterprisedb enterprisedb    68 Aug 22 06:24 pg_logical
drwx------. 2 enterprisedb enterprisedb     6 Aug 22 06:25 dbms_pipe
drwx------. 2 enterprisedb enterprisedb    48 Aug 22 06:25 log
-rw-------. 1 enterprisedb enterprisedb    46 Aug 22 06:25 current_logfiles
-rw-------. 1 enterprisedb enterprisedb    62 Aug 22 06:25 postmaster.opts
drwx------. 2 enterprisedb enterprisedb     6 Aug 22 06:25 pg_stat
-rw-------. 1 enterprisedb enterprisedb    88 Aug 22 06:25 postmaster.pid
drwx------. 2 enterprisedb enterprisedb  4096 Aug 22 06:27 global
[enterprisedb@lxtrdedbpsgv01 ~]$


[enterprisedb@lxtrdedbpsgv01 ~]$ psql -d postgres -c "SELECT version();"
                                                                     version
-------------------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 17.11 (EnterpriseDB Advanced Server 17.11.0) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-28), 64-bit
(1 row)

[enterprisedb@lxtrdedbpsgv01 ~]$
[enterprisedb@lxtrdedbpsgv01 ~]$ psql -d postgres
psql (17.11.0)
Type "help" for help.

postgres=#
postgres=# \l
                                                              List of databases
   Name    |    Owner     | Encoding | Locale Provider |   Collate   |    Ctype    | ICU | Locale | ICU Rules |       Access privileges
-----------+--------------+----------+-----------------+-------------+-------------+-----+--------+-----------+-------------------------------
 edb       | enterprisedb | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |     |        |           |
 postgres  | enterprisedb | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |     |        |           |
 template0 | enterprisedb | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |     |        |           | =c/enterprisedb              +
           |              |          |                 |             |             |     |        |           | enterprisedb=CTc/enterprisedb
 template1 | enterprisedb | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |     |        |           | =c/enterprisedb              +
           |              |          |                 |             |             |     |        |           | enterprisedb=CTc/enterprisedb
(4 rows)

postgres=#
postgres=# \conninfo
You are connected to database "postgres" as user "enterprisedb" via socket in "/tmp" at port "5444".
postgres=#
postgres=# \du
                                     List of roles
         Role name         |                         Attributes
---------------------------+------------------------------------------------------------
 aq_administrator_role     | No inheritance, Cannot login                              +
                           | Profile default
 capture_admin             | No inheritance, Cannot login                              +
                           | Profile default
 edb_createdirectory_admin | No inheritance, Cannot login                              +
                           | Profile default
 edb_dropdirectory_admin   | No inheritance, Cannot login                              +
                           | Profile default
 enterprisedb              | Superuser, Create role, Create DB, Replication, Bypass RLS+
                           | Profile default

postgres=# ALTER USER enterprisedb PASSWORD 'oracle';
ALTER ROLE
postgres=# 
postgres=# \duS
                                      List of roles
          Role name          |                         Attributes
-----------------------------+------------------------------------------------------------
 aq_administrator_role       | No inheritance, Cannot login                              +
                             | Profile default
 capture_admin               | No inheritance, Cannot login                              +
                             | Profile default
 edb_createdirectory_admin   | No inheritance, Cannot login                              +
                             | Profile default
 edb_dropdirectory_admin     | No inheritance, Cannot login                              +
                             | Profile default
 enterprisedb                | Superuser, Create role, Create DB, Replication, Bypass RLS+
                             | Profile default
 pg_checkpoint               | Cannot login                                              +
                             | Profile default
 pg_create_subscription      | Cannot login                                              +
                             | Profile default
 pg_database_owner           | Cannot login                                              +
                             | Profile default
 pg_execute_server_program   | Cannot login                                              +
                             | Profile default
 pg_maintain                 | Cannot login                                              +
                             | Profile default
 pg_monitor                  | Cannot login                                              +
                             | Profile default
 pg_read_all_data            | Cannot login                                              +
                             | Profile default
 pg_read_all_settings        | Cannot login                                              +
                             | Profile default
 pg_read_all_stats           | Cannot login                                              +
                             | Profile default
 pg_read_server_files        | Cannot login                                              +
                             | Profile default
 pg_signal_backend           | Cannot login                                              +
                             | Profile default
 pg_stat_scan_tables         | Cannot login                                              +
                             | Profile default
 pg_use_reserved_connections | Cannot login                                              +
                             | Profile default
 pg_write_all_data           | Cannot login                                              +
                             | Profile default
 pg_write_server_files       | Cannot login                                              +
                             | Profile default

postgres=#

postgres=# \dn
      List of schemas
  Name  |       Owner
--------+-------------------
 public | pg_database_owner
(1 row)

postgres=# \dnS
            List of schemas
        Name        |       Owner
--------------------+-------------------
 information_schema | enterprisedb
 pg_catalog         | enterprisedb
 pg_temp_0          | enterprisedb
 pg_toast           | enterprisedb
 pg_toast_temp_0    | enterprisedb
 public             | pg_database_owner
 sys                | enterprisedb
(7 rows)

postgres=# \dnS+
                                                  List of schemas
        Name        |       Owner       |           Access privileges            |           Description
--------------------+-------------------+----------------------------------------+----------------------------------
 information_schema | enterprisedb      | enterprisedb=UC/enterprisedb          +|
                    |                   | =U/enterprisedb                        |
 pg_catalog         | enterprisedb      | enterprisedb=UC/enterprisedb          +| system catalog schema
                    |                   | =U/enterprisedb                        |
 pg_temp_0          | enterprisedb      |                                        |
 pg_toast           | enterprisedb      |                                        | reserved schema for TOAST tables
 pg_toast_temp_0    | enterprisedb      |                                        |
 public             | pg_database_owner | pg_database_owner=UC/pg_database_owner+| standard public schema
                    |                   | =U/pg_database_owner                   |
 sys                | enterprisedb      | enterprisedb=UC/enterprisedb          +| sys schema
                    |                   | =U/enterprisedb                        |
(7 rows)

postgres=#

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
Thank you
Rajasekhar Amudala

WAL Commit Process

PostgreSQL WAL Commit Process

1. The Modification (In-Memory)

When a user executes a data-modifying query (like INSERT, UPDATE, or DELETE):

  • The change is made to the table or index data inside the Shared Buffers (RAM). The page in memory is now marked as “dirty.”

  • Simultaneously, a record of this exact change is constructed and written sequentially into the WAL Buffers (also in RAM).

2. The COMMIT Command Issued

When the client sends the COMMIT command, PostgreSQL must guarantee that this change will survive a sudden power outage or crash before it can tell the user “Success.”

3. Flushing to Disk (XLogFlush)

To ensure durability without the massive overhead of writing entire data pages to disk immediately, Postgres uses the Write-Ahead Logging protocol:

  • The internal function XLogFlush() is called.

  • It identifies the exact position (Log Sequence Number, or LSN) of the commit record in the WAL Buffer.

  • It issues a synchronous write to flush all WAL buffers up to that LSN out of RAM and into the current 16MB WAL segment file on permanent storage.

  • An fsync() system call is issued to ensure the OS cache actually commits the data to physical disk platters or flash memory.

4. Acknowledgment to the Client

Once the operating system confirms that the WAL record is safely written to the physical storage, the transaction status is updated to “committed” in the commit log (CLOG), and PostgreSQL sends a success acknowledgment back to the client application.

Crucial Architectural Concepts

  • Write-Ahead Rule: The core rule of WAL is that changes to data pages must not be written to permanent database files on disk until the log records describing those changes have been flushed to stable storage. If the server crashes, Postgres reads the WAL from the last checkpoint forward and reapplies the changes (“redoes” them).

  • Asynchronous Commit Alternative: If you set the configuration parameter synchronous_commit = off, Postgres will acknowledge the client’s COMMIT before the WAL buffer is flushed to disk (relying on the WAL Writer background process to flush it within roughly 3 times wal_writer_delay). This massively increases write throughput but introduces a risk of losing up to a split-second of recent transactions if the server suddenly loses power.

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
Thank you
Rajasekhar Amudala

Types of Shutdown in PostgreSQL

Types of Shutdown in PostgreSQL

PostgreSQL Shutdown TypeOracleBehavior
Smart (SIGTERM)SHUTDOWN NORMALThe server stops accepting new connections but allows existing sessions to continue running normally. PostgreSQL shuts down only after all active sessions disconnect and their transactions complete successfully.
Fast (SIGINT – Default)SHUTDOWN IMMEDIATEThe server stops accepting new connections and immediately terminates all active sessions. Any uncommitted transactions are rolled back, and PostgreSQL performs a clean shutdown gracefully.
Immediate (SIGQUIT)SHUTDOWN ABORTThe server terminates all processes instantly without performing a proper shutdown. No cleanup or checkpoint occurs, so PostgreSQL performs crash recovery by replaying WAL files during the next startup.
Shutdown TypeSignalCommand ExampleBehavior
SmartSIGTERMpg_ctl stop -D /pgData -m smartStops new connections, waits for existing sessions to finish normally, then shuts down.
Fast (Default)SIGINTpg_ctl stop -D /pgdata -m fastStops new connections, terminates active sessions, rolls back uncommitted transactions, and shuts down cleanly.
ImmediateSIGQUITpg_ctl stop -D /pgdata -m immediateStops immediately without proper shutdown. Recovery from WAL files happens during next startup.

Difference Between Reload and Restart

  • When we change server configuration parameters, PostgreSQL needs to read those changes before they become active.
  • Reload applies the new configuration without stopping or restarting the database service. Existing connections and database activity continue normally.
  • Some configuration parameter changes cannot be applied through reload and will only take effect after a restart.
  • Restart stops the PostgreSQL server gracefully, ends all running activities, releases resources, closes open files, and then starts the server again with the new configuration.

 

Smart Shutdown (SIGTERM):

[postgres@pgdb02 ~]$ pg_ctl stop -D /pgData/pgsql17/data -m smart
waiting for server to shut down.... done
server stopped
[postgres@pgdb02 ~]$

2026-07-03 14:26:59.741 +08 [3476] LOG:  received smart shutdown request
2026-07-03 14:26:59.752 +08 [3476] LOG:  background worker "logical replication launcher" (PID 3483) exited with exit code 1
2026-07-03 14:26:59.753 +08 [3478] LOG:  shutting down
2026-07-03 14:26:59.755 +08 [3478] LOG:  checkpoint starting: shutdown immediate
2026-07-03 14:26:59.765 +08 [3478] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.002 s, sync=0.003 s, total=0.012 s; sync files=2, longest=0.003 s, average=0.002 s; distance=0 kB, estimate=0 kB; lsn=1/105465F0, redo lsn=1/105465F0
2026-07-03 14:26:59.771 +08 [3476] LOG:  database system is shut down


[postgres@pgdb02 ~]$ pg_ctl start -D /pgData/pgsql17/data
waiting for server to start....2026-07-03 14:27:18.394 +08 [3487] LOG:  redirecting log output to logging collector process
2026-07-03 14:27:18.394 +08 [3487] HINT:  Future log output will appear in directory "log".
 done
server started
[postgres@pgdb02 ~]$

2026-07-03 14:27:18.394 +08 [3487] LOG:  starting PostgreSQL 17.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-14), 64-bit
2026-07-03 14:27:18.396 +08 [3487] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2026-07-03 14:27:18.396 +08 [3487] LOG:  listening on IPv6 address "::", port 5432
2026-07-03 14:27:18.399 +08 [3487] LOG:  listening on Unix socket "/run/postgresql/.s.PGSQL.5432"
2026-07-03 14:27:18.404 +08 [3487] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2026-07-03 14:27:18.413 +08 [3491] LOG:  database system was shut down at 2026-07-03 14:26:59 +08
2026-07-03 14:27:18.425 +08 [3487] LOG:  database system is ready to accept connections

Fast Shutdown (SIGINT – Default):

[postgres@pgdb02 ~]$ pg_ctl stop -D /pgData/pgsql17/data -m fast
waiting for server to shut down.... done
server stopped
[postgres@pgdb02 ~]$

2026-07-03 14:28:26.839 +08 [3487] LOG:  received fast shutdown request
2026-07-03 14:28:26.844 +08 [3487] LOG:  aborting any active transactions
2026-07-03 14:28:26.854 +08 [3487] LOG:  background worker "logical replication launcher" (PID 3494) exited with exit code 1
2026-07-03 14:28:26.860 +08 [3489] LOG:  shutting down
2026-07-03 14:28:26.862 +08 [3489] LOG:  checkpoint starting: shutdown immediate
2026-07-03 14:28:26.874 +08 [3489] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.002 s, sync=0.005 s, total=0.015 s; sync files=2, longest=0.004 s, average=0.003 s; distance=0 kB, estimate=0 kB; lsn=1/105466A0, redo lsn=1/105466A0
2026-07-03 14:28:26.882 +08 [3487] LOG:  database system is shut down

[postgres@pgdb02 ~]$ pg_ctl start -D /pgData/pgsql17/data
waiting for server to start....2026-07-03 14:29:00.574 +08 [3505] LOG:  redirecting log output to logging collector process
2026-07-03 14:29:00.574 +08 [3505] HINT:  Future log output will appear in directory "log".
 done
server started
[postgres@pgdb02 ~]$

2026-07-03 14:29:00.575 +08 [3505] LOG:  starting PostgreSQL 17.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-14), 64-bit
2026-07-03 14:29:00.579 +08 [3505] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2026-07-03 14:29:00.580 +08 [3505] LOG:  listening on IPv6 address "::", port 5432
2026-07-03 14:29:00.582 +08 [3505] LOG:  listening on Unix socket "/run/postgresql/.s.PGSQL.5432"
2026-07-03 14:29:00.587 +08 [3505] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2026-07-03 14:29:00.595 +08 [3509] LOG:  database system was shut down at 2026-07-03 14:28:26 +08
2026-07-03 14:29:00.607 +08 [3505] LOG:  database system is ready to accept connections

Immediate Shutdown (SIGQUIT):

[postgres@pgdb02 ~]$ pg_ctl stop -D /pgData/pgsql17/data -m immediate
waiting for server to shut down.... done
server stopped
[postgres@pgdb02 ~]$

2026-07-03 14:29:47.471 +08 [3505] LOG:  received immediate shutdown request
2026-07-03 14:29:47.485 +08 [3505] LOG:  database system is shut down


[postgres@pgdb02 ~]$ pg_ctl start -D /pgData/pgsql17/data
waiting for server to start....2026-07-03 14:30:17.965 +08 [3520] LOG:  redirecting log output to logging collector process
2026-07-03 14:30:17.965 +08 [3520] HINT:  Future log output will appear in directory "log".
. done
server started
[postgres@pgdb02 ~]$

2026-07-03 14:30:17.966 +08 [3520] LOG:  starting PostgreSQL 17.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-14), 64-bit
2026-07-03 14:30:17.966 +08 [3520] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2026-07-03 14:30:17.966 +08 [3520] LOG:  listening on IPv6 address "::", port 5432
2026-07-03 14:30:17.970 +08 [3520] LOG:  listening on Unix socket "/run/postgresql/.s.PGSQL.5432"
2026-07-03 14:30:17.974 +08 [3520] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2026-07-03 14:30:17.983 +08 [3524] LOG:  database system was interrupted; last known up at 2026-07-03 14:29:00 +08
2026-07-03 14:30:19.211 +08 [3524] LOG:  database system was not properly shut down; automatic recovery in progress
2026-07-03 14:30:19.216 +08 [3524] LOG:  redo starts at 1/10546718
2026-07-03 14:30:19.216 +08 [3524] LOG:  invalid record length at 1/10546750: expected at least 24, got 0
2026-07-03 14:30:19.217 +08 [3524] LOG:  redo done at 1/10546718 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2026-07-03 14:30:19.221 +08 [3522] LOG:  checkpoint starting: end-of-recovery immediate wait
2026-07-03 14:30:19.231 +08 [3522] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.002 s, sync=0.003 s, total=0.012 s; sync files=2, longest=0.002 s, average=0.002 s; distance=0 kB, estimate=0 kB; lsn=1/10546750, redo lsn=1/10546750
2026-07-03 14:30:19.239 +08 [3520] LOG:  database system is ready to accept connections

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.

Thank you,
Rajasekhar Amudala
Email: br8dba@gmail.com
Linkedin: https://www.linkedin.com/in/rajasekhar-amudala/

Create a Second PostgreSQL Instance on the Same Linux Server

Create a Second PostgreSQL Instance on the Same Linux Server

Table of Contents



0. Verify existing setup

[postgres@pgdb02 ~]$ ps -ef | grep postgres
root        3641    3561  0 16:57 pts/1    00:00:00 su - postgres
postgres    3642    3641  0 16:57 pts/1    00:00:00 -bash
postgres    3711       1  0 17:03 ?        00:00:00 /pgBin/pgsql/17.4/bin/postgres -D /pgData/pgsql/17.4
postgres    3712    3711  0 17:03 ?        00:00:00 postgres: PGDB_SIT: checkpointer
postgres    3713    3711  0 17:03 ?        00:00:00 postgres: PGDB_SIT: background writer
postgres    3715    3711  0 17:03 ?        00:00:00 postgres: PGDB_SIT: walwriter
postgres    3716    3711  0 17:03 ?        00:00:00 postgres: PGDB_SIT: autovacuum launcher
postgres    3717    3711  0 17:03 ?        00:00:00 postgres: PGDB_SIT: logical replication launcher
postgres    3731    3642  0 17:03 pts/1    00:00:00 psql
postgres    3732    3711  0 17:03 ?        00:00:00 postgres: PGDB_SIT: postgres postgres [local] idle
root        3748    3164  0 17:09 pts/0    00:00:00 su - postgres
postgres    3749    3748  0 17:09 pts/0    00:00:00 -bash
postgres    3911    3749  0 17:59 pts/0    00:00:00 ps -ef
postgres    3912    3749  0 17:59 pts/0    00:00:00 grep --color=auto postgres
[postgres@pgdb02 ~]$

1. Create new directories

[root@pgdb02 ~]# mkdir -p /pgData/pgsql/17.4/dev
[root@pgdb02 ~]# mkdir -p /pgWal/pgsql/17.4/dev
[root@pgdb02 ~]# chown -R postgres:postgres /pgData /pgWal
[root@pgdb02 ~]#

2. Initialize second cluster

# As postgres user 

[postgres@pgdb02 ~]$ /pgBin/pgsql/17.4/bin/initdb -D /pgData/pgsql/17.4/dev --waldir=/pgWal/pgsql/17.4/dev --wal-segsize=128
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_SG.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /pgData/pgsql/17.4/dev ... ok
fixing permissions on existing directory /pgWal/pgsql/17.4/dev ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 100
selecting default "shared_buffers" ... 128MB
selecting default time zone ... Asia/Singapore
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /pgBin/pgsql/17.4/bin/pg_ctl -D /pgData/pgsql/17.4/dev -l logfile start

[postgres@pgdb02 ~]$

[postgres@pgdb02 ~]$ ls -ld /pgData/pgsql/17.4/dev
drwx------. 18 postgres postgres 4096 Jun 20 18:03 /pgData/pgsql/17.4/dev
[postgres@pgdb02 ~]$
[postgres@pgdb02 ~]$ ls -ltr /pgData/pgsql/17.4/dev
total 56
lrwxrwxrwx. 1 postgres postgres    21 Jun 20 18:03 pg_wal -> /pgWal/pgsql/17.4/dev
drwx------. 2 postgres postgres     6 Jun 20 18:03 pg_commit_ts
drwx------. 2 postgres postgres     6 Jun 20 18:03 pg_dynshmem
drwx------. 2 postgres postgres     6 Jun 20 18:03 pg_twophase
drwx------. 2 postgres postgres     6 Jun 20 18:03 pg_tblspc
drwx------. 2 postgres postgres     6 Jun 20 18:03 pg_stat_tmp
drwx------. 2 postgres postgres     6 Jun 20 18:03 pg_snapshots
drwx------. 2 postgres postgres     6 Jun 20 18:03 pg_serial
drwx------. 2 postgres postgres     6 Jun 20 18:03 pg_replslot
drwx------. 2 postgres postgres     6 Jun 20 18:03 pg_notify
drwx------. 4 postgres postgres    36 Jun 20 18:03 pg_multixact
-rw-------. 1 postgres postgres     3 Jun 20 18:03 PG_VERSION
-rw-------. 1 postgres postgres 30718 Jun 20 18:03 postgresql.conf
-rw-------. 1 postgres postgres    88 Jun 20 18:03 postgresql.auto.conf
-rw-------. 1 postgres postgres  5711 Jun 20 18:03 pg_hba.conf
-rw-------. 1 postgres postgres  2640 Jun 20 18:03 pg_ident.conf
drwx------. 2 postgres postgres    18 Jun 20 18:03 pg_xact
drwx------. 2 postgres postgres    18 Jun 20 18:03 pg_subtrans
drwx------. 2 postgres postgres  4096 Jun 20 18:03 global
drwx------. 5 postgres postgres    33 Jun 20 18:03 base
drwx------. 4 postgres postgres    68 Jun 20 18:03 pg_logical
drwx------. 2 postgres postgres    25 Jun 20 18:03 pg_stat
[postgres@pgdb02 ~]$

**** we can see here 700 permission set by initdb command.

3. Edit second instance config

[postgres@pgdb02 ~]$ egrep "^(#)?(port|cluster_name)" /pgData/pgsql/17.4/dev/postgresql.conf
#port = 5432                            # (change requires restart)
#cluster_name = ''                      # added to process titles if nonempty
[postgres@pgdb02 ~]$


[postgres@pgdb02 ~]$ cp /pgData/pgsql/17.4/dev/postgresql.conf /pgData/pgsql/17.4/dev/postgresql.conf.bkp
[postgres@pgdb02 ~]$

[postgres@pgdb02 ~]$ sed -i "s/^#port = 5432.*/port = 5433/" /pgData/pgsql/17.4/dev/postgresql.conf
[postgres@pgdb02 ~]$ sed -i "s/^#cluster_name = ''.*/cluster_name = 'PGDB_UAT'/" /pgData/pgsql/17.4/dev/postgresql.conf
[postgres@pgdb02 ~]$
[postgres@pgdb02 ~]$ egrep "^(#)?(port|cluster_name)" /pgData/pgsql/17.4/dev/postgresql.conf
port = 5433
cluster_name = 'PGDB_UAT'
[postgres@pgdb02 ~]$

4. Start PostgreSQL Service

[postgres@pgdb02 ~]$ /pgBin/pgsql/17.4/bin/pg_ctl -D /pgData/pgsql/17.4/dev -l logfile start
waiting for server to start.... done
server started
[postgres@pgdb02 ~]$

5. Connect to second instance

[postgres@pgdb02 ~]$ psql -p 5433
psql (17.4)
Type "help" for help.

postgres=# SHOW port;
 port
------
 5433  <-----------
(1 row)

postgres=# SHOW cluster_name;
 cluster_name
--------------
 PGDB_UAT  <---------------
(1 row)

postgres=#\q

[postgres@pgdb02 ~]$ pg_ctl stop -D /pgData/pgsql/17.4/dev
waiting for server to shut down.... done
server stopped
[postgres@pgdb02 ~]$

6. Create second systemd service

[root@pgdb02 ~]# cp /etc/systemd/system/postgresql-17.service /etc/systemd/system/postgresql-17-dev.service
[root@pgdb02 ~]#
[root@pgdb02 ~]# grep -i Environment=PGDATA /etc/systemd/system/postgresql-17-dev.service
Environment=PGDATA=/pgData/pgsql/17.4
[root@pgdb02 ~]#

[root@pgdb02 ~]# sed -i 's|Environment=PGDATA=/pgData/pgsql/17.4|Environment=PGDATA=/pgData/pgsql/17.4/dev|' /etc/systemd/system/postgresql-17-dev.service
[root@pgdb02 ~]# grep -i Environment=PGDATA /etc/systemd/system/postgresql-17-dev.service
Environment=PGDATA=/pgData/pgsql/17.4/dev
[root@pgdb02 ~]#

[root@pgdb02 ~]# systemctl daemon-reload
[root@pgdb02 ~]# systemctl start postgresql-17-dev
[root@pgdb02 ~]# systemctl enable postgresql-17-dev
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql-17-dev.service → /etc/systemd/system/postgresql-17-dev.service.
[root@pgdb02 ~]#
[root@pgdb02 ~]# systemctl status postgresql-17-dev
● postgresql-17-dev.service - PostgreSQL 17 Database Server
     Loaded: loaded (/etc/systemd/system/postgresql-17-dev.service; enabled; preset: disabled)
     Active: active (running) since Sat 2026-06-20 18:25:39 +08; 12s ago
       Docs: https://www.postgresql.org/docs/17/
   Main PID: 4106 (postgres)
      Tasks: 6 (limit: 15700)
     Memory: 15.2M
        CPU: 62ms
     CGroup: /system.slice/postgresql-17-dev.service
             ├─4106 /pgBin/pgsql/17.4/bin/postgres -D /pgData/pgsql/17.4/dev
             ├─4107 "postgres: PGDB_UAT: checkpointer "
             ├─4108 "postgres: PGDB_UAT: background writer "
             ├─4110 "postgres: PGDB_UAT: walwriter "
             ├─4111 "postgres: PGDB_UAT: autovacuum launcher "
             └─4112 "postgres: PGDB_UAT: logical replication launcher "

Jun 20 18:25:39 pgdb02 systemd[1]: Starting PostgreSQL 17 Database Server...
Jun 20 18:25:39 pgdb02 pg_ctl[4103]: waiting for server to start.... done
Jun 20 18:25:39 pgdb02 pg_ctl[4103]: server started
Jun 20 18:25:39 pgdb02 systemd[1]: Started PostgreSQL 17 Database Server.
[root@pgdb02 ~]#

7. Verify instances

[postgres@pgdb02 ~]$ ps -ef | grep postgres
postgres    3711       1  0 17:03 ?        00:00:00 /pgBin/pgsql/17.4/bin/postgres -D /pgData/pgsql/17.4
postgres    3712    3711  0 17:03 ?        00:00:00 postgres: PGDB_SIT: checkpointer
postgres    3713    3711  0 17:03 ?        00:00:00 postgres: PGDB_SIT: background writer
postgres    3715    3711  0 17:03 ?        00:00:00 postgres: PGDB_SIT: walwriter
postgres    3716    3711  0 17:03 ?        00:00:00 postgres: PGDB_SIT: autovacuum launcher
postgres    3717    3711  0 17:03 ?        00:00:00 postgres: PGDB_SIT: logical replication launcher
root        3748    3164  0 17:09 pts/0    00:00:00 su - postgres
postgres    3749    3748  0 17:09 pts/0    00:00:00 -bash
postgres    4106       1  0 18:25 ?        00:00:00 /pgBin/pgsql/17.4/bin/postgres -D /pgData/pgsql/17.4/dev
postgres    4107    4106  0 18:25 ?        00:00:00 postgres: PGDB_UAT: checkpointer
postgres    4108    4106  0 18:25 ?        00:00:00 postgres: PGDB_UAT: background writer
postgres    4110    4106  0 18:25 ?        00:00:00 postgres: PGDB_UAT: walwriter
postgres    4111    4106  0 18:25 ?        00:00:00 postgres: PGDB_UAT: autovacuum launcher
postgres    4112    4106  0 18:25 ?        00:00:00 postgres: PGDB_UAT: logical replication launcher
postgres    4157    3749 99 18:26 pts/0    00:00:00 ps -ef
postgres    4158    3749  0 18:26 pts/0    00:00:00 grep --color=auto postgres
[postgres@pgdb02 ~]$

[postgres@pgdb02 ~]$ ss -tulpn | grep 543
tcp   LISTEN 0      200        127.0.0.1:5433       0.0.0.0:*    users:(("postgres",pid=4106,fd=7))
tcp   LISTEN 0      200        127.0.0.1:5432       0.0.0.0:*    users:(("postgres",pid=3711,fd=7))
tcp   LISTEN 0      200            [::1]:5432          [::]:*    users:(("postgres",pid=3711,fd=6))
tcp   LISTEN 0      200            [::1]:5433          [::]:*    users:(("postgres",pid=4106,fd=6))
[postgres@pgdb02 ~]$

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.

Thank you,
Rajasekhar Amudala
Email: br8dba@gmail.com
Linkedin: https://www.linkedin.com/in/rajasekhar-amudala/

Uninstall PostgreSQL 17 on Linux (RPM Method)

Uninstall PostgreSQL 17 on Linux (Installed Using RPM Method)

Table of Contents



0. Important Caution Before Proceeding

** Before uninstalling PostgreSQL PostgreSQL 17, first take a logical or physical backup. **

If PostgreSQL was installed using RPM packages, removing the package does not automatically remove:

Database files
WAL files
Backup directories
Custom configuration files

1. Check Installed PostgreSQL RPM Packages

[root@pgdb02 ~]# rpm -qa | grep postgres
postgresql17-libs-17.6-1PGDG.rhel9.x86_64
postgresql17-17.6-1PGDG.rhel9.x86_64
postgresql17-server-17.6-1PGDG.rhel9.x86_64
postgresql17-contrib-17.6-1PGDG.rhel9.x86_64
[root@pgdb02 ~]#

2. Stop PostgreSQL Service

[root@pgdb02 ~]# systemctl stop postgresql-17
[root@pgdb02 ~]# systemctl status postgresql-17
○ postgresql-17.service - PostgreSQL 17 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-17.service; enabled; preset: disabled)
Active: inactive (dead)
Docs: https://www.postgresql.org/docs/17/static/
[root@pgdb02 ~]#

3. Disable PostgreSQL Service

[root@pgdb02 ~]# systemctl disable postgresql-17
Removed "/etc/systemd/system/multi-user.target.wants/postgresql-17.service".
[root@pgdb02 ~]#

4. Remove and Verify PostgreSQL RPM Packages

WARNING: This permanently deletes all binaries, libraries, and data. Ensure your data is backed up before this step.

[root@pgdb02 ~]# rpm -qa | grep postgres
postgresql17-libs-17.6-1PGDG.rhel9.x86_64
postgresql17-17.6-1PGDG.rhel9.x86_64
postgresql17-server-17.6-1PGDG.rhel9.x86_64
postgresql17-contrib-17.6-1PGDG.rhel9.x86_64
[root@pgdb02 ~]#
[root@pgdb02 ~]# rpm -e postgresql17-contrib-17.6-1PGDG.rhel9.x86_64
[root@pgdb02 ~]# rpm -e postgresql17-server-17.6-1PGDG.rhel9.x86_64
[root@pgdb02 ~]# rpm -e postgresql17-17.6-1PGDG.rhel9.x86_64
[root@pgdb02 ~]# rpm -e postgresql17-libs-17.6-1PGDG.rhel9.x86_64
[root@pgdb02 ~]#

5. Verify Packages Are Removed

[root@pgdb02 ~]# rpm -qa | grep postgres
[root@pgdb02 ~]#

6. Remove PostgreSQL System User (Optional)

[root@pgdb02 ~]# id postgres
uid=26(postgres) gid=26(postgres) groups=26(postgres)
[root@pgdb02 ~]# userdel postgres
[root@pgdb02 ~]#
[root@pgdb02 ~]# groupdel postgres
groupdel: group 'postgres' does not exist
[root@pgdb02 ~]#
[root@pgdb02 ~]# id postgres
id: ‘postgres’: no such user
[root@pgdb02 ~]#

7. Remove PostgreSQL Configuration Files

# It's already removed in step no. 3

[root@pgdb02 ~]# ls -l /usr/lib/systemd/system/postgresql-17.service
ls: cannot access '/usr/lib/systemd/system/postgresql-17.service': No such file or directory
[root@pgdb02 ~]# 
[root@pgdb02 ~]# ls -l /etc/systemd/system/postgresql-17.service
-rw-r--r--. 1 root root 588 Jun 19 21:20 /etc/systemd/system/postgresql-17.service
[root@pgdb02 ~]#
[root@pgdb02 ~]# rm -f /etc/systemd/system/postgresql-17.service
[root@pgdb02 ~]#

8. Verify Complete Removal

[root@pgdb02 ~]# id postgres
id: ‘postgres’: no such user
[root@pgdb02 ~]#
[root@pgdb02 ~]# rpm -qa | grep postgres
[root@pgdb02 ~]#
[root@pgdb02 ~]# systemctl status postgresql-17
Unit postgresql-17.service could not be found.
[root@pgdb02 ~]#

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.

Thank you,
Rajasekhar Amudala
Email: br8dba@gmail.com
Linkedin: https://www.linkedin.com/in/rajasekhar-amudala/

PostgreSQL 17 DBA Free Training Roadmap

PostgreSQL DBA Free Coaching

Free PostgreSQL DBA Training in Telugu for Beginners | Live Ongoing Batch | June 15 - July 31, 2026.
తెలుగులో నేర్చుకోండి · 5 Weeks · Online · Beginner Friendly · 100% Free

DBA Training Program
// 5-week structured training · 19 sessions · hands-on labs
5
Weeks
19
Sessions
100+
Topics
∞
Future Free
Week 01 Lab Setup, Linux & PostgreSQL Fundamentals
Session 01 Lab Setup & Storage Configuration ▾
Pre-requisites
  • Install VirtualBox on Windows (Do your self)
  • Install PgAdmin4 on Windows (Do your self)
  • Configure Oracle Linux 9.6 VM (will share link)
Linux VM Setup
  • Create Oracle Linux 9.6 VM
  • VM Hardware Sizing for PostgreSQL
  • Add Multiple Virtual Disks
Storage Configuration
  • Create Partitions
  • Create Filesystems
  • Mount Filesystems
  • Configure /etc/fstab
PostgreSQL Directory Layout
  • Create Mount Points: /pgData, /pgWal, /pgArch, /pgBackup, /pgLog
Session 02 Linux Administration for DBAs ▾
  • Basic Linux Commands
  • File and Directory Management
  • User and Group Management
  • Permissions and Ownership
  • Process Management
  • Service Management using systemctl
  • Network Commands
  • Disk and Memory Monitoring
Session 03 PostgreSQL 17 Installation ▾
Overview
  • PostgreSQL Overview and Versions
Installation Methods
  • RPM Installation
  • DNF/YUM Installation
  • Source Code Installation
Database Initialization
  • initdb
  • Custom WAL Location
  • PostgreSQL Service Configuration
Validation
  • Start PostgreSQL
  • Connect using psql
  • Connect using PgAdmin4
Session 04 PostgreSQL Architecture ▾
Memory Architecture
  • Shared Buffers
  • WAL Buffers
  • Work Memory
  • Maintenance Work Memory
Process Architecture
  • Postmaster
  • Backend Processes
  • Checkpointer
  • Background Writer
  • WAL Writer
  • Autovacuum
Physical Storage Layout
  • Base Directory
  • Global Directory
  • WAL Directory
  • Tablespaces
Session 05 PostgreSQL Configuration Files ▾
  • postgresql.conf
  • postgresql.auto.conf
  • pg_hba.conf
  • pg_ident.conf
  • Reload vs Restart
Week 02 Administration & Security
Session 06 Startup, Shutdown ▾
  • PostgreSQL Startup Process
  • Smart Shutdown
  • Fast Shutdown (default)
  • Immediate Shutdown
Session 07 Database Administration ▾
  • Creating Databases
  • Creating Schemas
  • Schema Search Path
  • Roles and Users
  • Access Control
Session 08 Tablespaces Management ▾
  • pg_default
  • pg_global
  • Custom Tablespaces
  • Move Objects Between Tablespaces
  • Tablespace Monitoring
Session 09 Security ▾
  • pg_hba.conf
  • Authentication Methods
  • pg_ident.conf
  • .pgpass
  • SSL/TLS Setup
Session 10 Vacuum and Analyze ▾
  • MVCC Concepts
  • Dead Tuples
  • VACUUM
  • VACUUM FULL
  • ANALYZE
  • Autovacuum
Week 03 Backup & Recovery
Session 11 WAL Archiving ▾
  • WAL Fundamentals
  • Archive Mode
  • Archive Command
Session 12 Logical Backup and Restore ▾
  • pg_dump
  • pg_dumpall
  • Backup Formats
  • pg_restore
  • Restore using psql
Session 13 Physical Backup and Restore ▾
  • pg_basebackup
  • Full Cluster Backup
  • Database Refresh on New Server
Session 14 PITR — Point-in-Time Recovery ▾
  • PITR Concepts and Architecture
  • PITR Demonstration (hands-on)
Session 15 Full Recovery & Disaster Recovery ▾
  • Full Database Recovery
  • Disaster Recovery Scenarios
Week 04 Replication, Failover
Session 16 Streaming Replication ▾
  • Primary Configuration
  • Replica Configuration
  • Base Backup for Replica
  • Verify Replication
Session 17 Replication Administration ▾
  • Replication Slots
  • Monitoring Replication
  • Async Replication
  • Sync Replication
  • Convert from ASYNC to SYNC
Session 18 Failover and pg_rewind ▾
  • Manual Failover
  • Promote Replica
  • pg_rewind
  • Rejoin Old Primary as Replica
Week 05 Upgrades
Session 19 PostgreSQL Upgrades & Final Lab ▾
  • Minor Version Upgrade
  • Major Version Upgrades
  • pg_upgrade
  • Upgrade using pg_dump/pg_restore
  • Upgrade Validation
  • Final End-to-End Lab
Future Batch Advanced Topics — Free Training
// Topics reserved for the next advanced batch · access is free
EXPLAIN / EXPLAIN ANALYZE Index Types & Tuning Table Partitioning Performance Tuning PostgreSQL Extensions PgBouncer pgmetrics pgcollector pgbadger Repmgr Patroni Maintenance Operations Oracle → PostgreSQL (Ora2Pg) Advanced Data Migration Logical Replication Multi-Node HA Architectures

PostgreSQL DBA Free Training Roadmap · Click any session card to expand topics

Install PostgreSQL 17.4 from Source code

Install PostgreSQL 17.4 Using Source Code (Linux 9)

Table of Contents



0. Environment

ParameterValue
Host Namepgdb01
IP192.168.2.71
OSLinux 9
PostgreSQL Version17.4
Data Directory/pgData/pgsql/17.4
PG WAL/pgWal/pgsql/17.4
BIN Directory/pgbin/pgsql/17.4/bin
Software Staging Directory/pg_Backup/stage

1. Set SELINUX to Permissive and Restart the server

# Set SELINUX to permissive

[root@pgdb02 ~]# grep ^SELINUX= /etc/selinux/config
SELINUX=enforcing
[root@pgdb02 ~]#
[root@pgdb02 ~]# sed -i 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config
[root@pgdb02 ~]#
[root@pgdb02 ~]# grep ^SELINUX= /etc/selinux/config
SELINUX=permissive
[root@pgdb02 ~]#
[root@pgdb02 ~]# shutdown -Fr now   <---- Restart the server to take effect

2. Install Dependencies

**Note:** For testing purposes, I intentionally did not install the following dependency packages: dnf install -y perl perl-core perl-ExtUtils-MakeMakerWe can see dependency-related error to be reproduced and observed during the installation process.**Caution:** If you do not want to  encounter the error described in **Step 7**, install the above packages before proceeding.As part of this exercise, the installation will be cleaned up after the error is encountered, and the installation process will then be repeated with the required dependencies installed to demonstrate a successful installation.
[root@pgdb01 ~]# dnf install -y readline-devel zlib-devel gcc make libicu-devel openssl-devel bison flex wget tar
Last metadata expiration check: 0:08:12 ago on Tue 21 Apr 2026 07:35:12 PM.
Package wget-1.21.1-8.el9_4.x86_64 is already installed.
Package tar-2:1.34-7.el9.x86_64 is already installed.
Dependencies resolved.
==============================================================================================================================================================================================================
 Package                                                 Architecture                          Version                                                 Repository                                        Size
==============================================================================================================================================================================================================
Installing:
 bison                                                   x86_64                                3.7.4-5.el9                                             ol9_appstream                                    1.0 M
 flex                                                    x86_64                                2.6.4-9.el9                                             ol9_appstream                                    341 k
 gcc                                                     x86_64                                11.5.0-11.0.2.el9                                       ol9_appstream                                     33 M
 libicu-devel                                            x86_64                                67.1-10.el9_6                                           ol9_appstream                                    1.3 M
 make                                                    x86_64                                1:4.3-8.el9                                             ol9_baseos_latest                                570 k
 openssl-devel                                           x86_64                                1:3.5.1-7.0.1.el9_7                                     ol9_appstream                                    4.2 M
 readline-devel                                          x86_64                                8.1-4.el9                                               ol9_appstream                                    238 k
 zlib-devel                                              x86_64                                1.2.11-40.el9                                           ol9_appstream                                     51 k
Upgrading:
 cpp                                                     x86_64                                11.5.0-11.0.2.el9                                       ol9_appstream                                     11 M
 glibc                                                   x86_64                                2.34-231.0.1.el9_7.10                                   ol9_baseos_latest                                2.0 M
 glibc-all-langpacks                                     x86_64                                2.34-231.0.1.el9_7.10                                   ol9_baseos_latest                                 18 M
 glibc-common                                            x86_64                                2.34-231.0.1.el9_7.10                                   ol9_baseos_latest                                330 k
 glibc-gconv-extra                                       x86_64                                2.34-231.0.1.el9_7.10                                   ol9_baseos_latest                                1.8 M
 glibc-langpack-en                                       x86_64                                2.34-231.0.1.el9_7.10                                   ol9_baseos_latest                                969 k
 libgcc                                                  x86_64                                11.5.0-11.0.2.el9                                       ol9_baseos_latest                                 94 k
 libgomp                                                 x86_64                                11.5.0-11.0.2.el9                                       ol9_baseos_latest                                263 k
 libicu                                                  x86_64                                67.1-10.el9_6                                           ol9_baseos_latest                                9.6 M
 openssl                                                 x86_64                                1:3.5.1-7.0.1.el9_7                                     ol9_baseos_latest                                1.6 M
 openssl-fips-provider                                   x86_64                                3.0.7-8.0.1.el9                                         ol9_baseos_latest                                8.3 k
 openssl-fips-provider-so                                x86_64                                3.0.7-8.0.1.el9                                         ol9_baseos_latest                                575 k
 openssl-libs                                            x86_64                                1:3.5.1-7.0.1.el9_7                                     ol9_baseos_latest                                2.3 M
 tar                                                     x86_64                                2:1.34-9.el9_7                                          ol9_baseos_latest                                927 k
Installing dependencies:
 glibc-devel                                             x86_64                                2.34-231.0.1.el9_7.10                                   ol9_appstream                                     60 k
 glibc-headers                                           x86_64                                2.34-231.0.1.el9_7.10                                   ol9_appstream                                    921 k
 kernel-headers                                          x86_64                                5.14.0-611.47.1.el9_7                                   ol9_appstream                                    3.6 M
 libxcrypt-devel                                         x86_64                                4.4.18-3.el9                                            ol9_appstream                                     42 k
 m4                                                      x86_64                                1.4.19-1.el9                                            ol9_appstream                                    333 k
 ncurses-c++-libs                                        x86_64                                6.2-10.20210508.el9                                     ol9_appstream                                     36 k
 ncurses-devel                                           x86_64                                6.2-10.20210508.el9                                     ol9_appstream                                    684 k

Transaction Summary
==============================================================================================================================================================================================================
Install  15 Packages
Upgrade  14 Packages

Total download size: 95 M
Downloading Packages:
(1/29): make-4.3-8.el9.x86_64.rpm                                                                                                                                             1.3 MB/s | 570 kB     00:00
(2/29): flex-2.6.4-9.el9.x86_64.rpm                                                                                                                                           792 kB/s | 341 kB     00:00
(3/29): bison-3.7.4-5.el9.x86_64.rpm                                                                                                                                          2.2 MB/s | 1.0 MB     00:00
(4/29): glibc-devel-2.34-231.0.1.el9_7.10.x86_64.rpm                                                                                                                          1.4 MB/s |  60 kB     00:00
(5/29): glibc-headers-2.34-231.0.1.el9_7.10.x86_64.rpm                                                                                                                        3.8 MB/s | 921 kB     00:00
(6/29): kernel-headers-5.14.0-611.47.1.el9_7.x86_64.rpm                                                                                                                       3.7 MB/s | 3.6 MB     00:00
(7/29): libicu-devel-67.1-10.el9_6.x86_64.rpm                                                                                                                                 1.6 MB/s | 1.3 MB     00:00
(8/29): libxcrypt-devel-4.4.18-3.el9.x86_64.rpm                                                                                                                               885 kB/s |  42 kB     00:00
(9/29): ncurses-c++-libs-6.2-10.20210508.el9.x86_64.rpm                                                                                                                       255 kB/s |  36 kB     00:00
(10/29): m4-1.4.19-1.el9.x86_64.rpm                                                                                                                                           1.9 MB/s | 333 kB     00:00
(11/29): ncurses-devel-6.2-10.20210508.el9.x86_64.rpm                                                                                                                         2.8 MB/s | 684 kB     00:00
(12/29): readline-devel-8.1-4.el9.x86_64.rpm                                                                                                                                  1.5 MB/s | 238 kB     00:00
(13/29): zlib-devel-1.2.11-40.el9.x86_64.rpm                                                                                                                                  425 kB/s |  51 kB     00:00
(14/29): glibc-2.34-231.0.1.el9_7.10.x86_64.rpm                                                                                                                               3.2 MB/s | 2.0 MB     00:00
(15/29): openssl-devel-3.5.1-7.0.1.el9_7.x86_64.rpm                                                                                                                           3.5 MB/s | 4.2 MB     00:01
(16/29): glibc-common-2.34-231.0.1.el9_7.10.x86_64.rpm                                                                                                                        1.9 MB/s | 330 kB     00:00
(17/29): glibc-gconv-extra-2.34-231.0.1.el9_7.10.x86_64.rpm                                                                                                                   3.0 MB/s | 1.8 MB     00:00
(18/29): glibc-langpack-en-2.34-231.0.1.el9_7.10.x86_64.rpm                                                                                                                   2.4 MB/s | 969 kB     00:00
(19/29): libgcc-11.5.0-11.0.2.el9.x86_64.rpm                                                                                                                                  921 kB/s |  94 kB     00:00
(20/29): libgomp-11.5.0-11.0.2.el9.x86_64.rpm                                                                                                                                 1.3 MB/s | 263 kB     00:00
(21/29): glibc-all-langpacks-2.34-231.0.1.el9_7.10.x86_64.rpm                                                                                                                 5.4 MB/s |  18 MB     00:03
(22/29): openssl-3.5.1-7.0.1.el9_7.x86_64.rpm                                                                                                                                 3.2 MB/s | 1.6 MB     00:00
(23/29): openssl-fips-provider-3.0.7-8.0.1.el9.x86_64.rpm                                                                                                                     273 kB/s | 8.3 kB     00:00
(24/29): libicu-67.1-10.el9_6.x86_64.rpm                                                                                                                                      3.9 MB/s | 9.6 MB     00:02
(25/29): openssl-fips-provider-so-3.0.7-8.0.1.el9.x86_64.rpm                                                                                                                  2.3 MB/s | 575 kB     00:00
(26/29): tar-1.34-9.el9_7.x86_64.rpm                                                                                                                                          3.7 MB/s | 927 kB     00:00
(27/29): openssl-libs-3.5.1-7.0.1.el9_7.x86_64.rpm                                                                                                                            3.6 MB/s | 2.3 MB     00:00
(28/29): cpp-11.5.0-11.0.2.el9.x86_64.rpm                                                                                                                                     5.4 MB/s |  11 MB     00:02
(29/29): gcc-11.5.0-11.0.2.el9.x86_64.rpm                                                                                                                                     3.5 MB/s |  33 MB     00:09
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                         9.8 MB/s |  95 MB     00:09
Oracle Linux 9 BaseOS Latest (x86_64)                                                                                                                                         3.9 MB/s | 6.2 kB     00:00
Importing GPG key 0x8D8B756F:
 Userid     : "Oracle Linux (release key 1) <secalert_us@oracle.com>"
 Fingerprint: 3E6D 826D 3FBA B389 C2F3 8E34 BC4D 06A0 8D8B 756F
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Key imported successfully
Importing GPG key 0x8B4EFBE6:
 Userid     : "Oracle Linux (backup key 1) <secalert_us@oracle.com>"
 Fingerprint: 9822 3175 9C74 6706 5D0C E9B2 A7DD 0708 8B4E FBE6
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                      1/1
  Upgrading        : glibc-all-langpacks-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                    1/43
  Upgrading        : glibc-common-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                           2/43
  Upgrading        : glibc-gconv-extra-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                      3/43
  Running scriptlet: glibc-gconv-extra-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                      3/43
  Upgrading        : glibc-langpack-en-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                      4/43
  Upgrading        : libgcc-11.5.0-11.0.2.el9.x86_64                                                                                                                                                     5/43
  Running scriptlet: libgcc-11.5.0-11.0.2.el9.x86_64                                                                                                                                                     5/43
  Running scriptlet: glibc-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                                  6/43
  Upgrading        : glibc-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                                  6/43
  Running scriptlet: glibc-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                                  6/43
  Installing       : m4-1.4.19-1.el9.x86_64                                                                                                                                                              7/43
  Installing       : make-1:4.3-8.el9.x86_64                                                                                                                                                             8/43
  Installing       : glibc-headers-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                          9/43
  Installing       : ncurses-c++-libs-6.2-10.20210508.el9.x86_64                                                                                                                                        10/43
  Installing       : ncurses-devel-6.2-10.20210508.el9.x86_64                                                                                                                                           11/43
  Upgrading        : libgomp-11.5.0-11.0.2.el9.x86_64                                                                                                                                                   12/43
  Upgrading        : libicu-67.1-10.el9_6.x86_64                                                                                                                                                        13/43
  Upgrading        : openssl-fips-provider-so-3.0.7-8.0.1.el9.x86_64                                                                                                                                    14/43
  Upgrading        : openssl-fips-provider-3.0.7-8.0.1.el9.x86_64                                                                                                                                       15/43
  Upgrading        : openssl-libs-1:3.5.1-7.0.1.el9_7.x86_64                                                                                                                                            16/43
  Upgrading        : cpp-11.5.0-11.0.2.el9.x86_64                                                                                                                                                       17/43
  Installing       : kernel-headers-5.14.0-611.47.1.el9_7.x86_64                                                                                                                                        18/43
  Installing       : libxcrypt-devel-4.4.18-3.el9.x86_64                                                                                                                                                19/43
  Installing       : glibc-devel-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                           20/43
  Installing       : gcc-11.5.0-11.0.2.el9.x86_64                                                                                                                                                       21/43
  Installing       : openssl-devel-1:3.5.1-7.0.1.el9_7.x86_64                                                                                                                                           22/43
  Upgrading        : openssl-1:3.5.1-7.0.1.el9_7.x86_64                                                                                                                                                 23/43
  Installing       : libicu-devel-67.1-10.el9_6.x86_64                                                                                                                                                  24/43
  Installing       : readline-devel-8.1-4.el9.x86_64                                                                                                                                                    25/43
  Installing       : bison-3.7.4-5.el9.x86_64                                                                                                                                                           26/43
  Installing       : flex-2.6.4-9.el9.x86_64                                                                                                                                                            27/43
  Upgrading        : tar-2:1.34-9.el9_7.x86_64                                                                                                                                                          28/43
  Installing       : zlib-devel-1.2.11-40.el9.x86_64                                                                                                                                                    29/43
  Cleanup          : openssl-1:3.2.2-6.0.1.el9_5.1.x86_64                                                                                                                                               30/43
  Cleanup          : libicu-67.1-9.el9.x86_64                                                                                                                                                           31/43
  Cleanup          : openssl-libs-1:3.2.2-6.0.1.el9_5.1.x86_64                                                                                                                                          32/43
  Cleanup          : cpp-11.5.0-5.0.1.el9.x86_64                                                                                                                                                        33/43
  Cleanup          : tar-2:1.34-7.el9.x86_64                                                                                                                                                            34/43
  Cleanup          : libgomp-11.5.0-5.0.1.el9.x86_64                                                                                                                                                    35/43
  Cleanup          : openssl-fips-provider-3.0.7-6.0.1.el9_5.x86_64                                                                                                                                     36/43
  Cleanup          : openssl-fips-provider-so-3.0.7-6.0.1.el9_5.x86_64                                                                                                                                  37/43
  Cleanup          : glibc-all-langpacks-2.34-168.0.1.el9.x86_64                                                                                                                                        38/43
  Cleanup          : glibc-gconv-extra-2.34-168.0.1.el9.x86_64                                                                                                                                          39/43
  Running scriptlet: glibc-gconv-extra-2.34-168.0.1.el9.x86_64                                                                                                                                          39/43
  Cleanup          : glibc-common-2.34-168.0.1.el9.x86_64                                                                                                                                               40/43
  Cleanup          : glibc-langpack-en-2.34-168.0.1.el9.x86_64                                                                                                                                          41/43
  Cleanup          : glibc-2.34-168.0.1.el9.x86_64                                                                                                                                                      42/43
  Cleanup          : libgcc-11.5.0-5.0.1.el9.x86_64                                                                                                                                                     43/43
  Running scriptlet: libgcc-11.5.0-5.0.1.el9.x86_64                                                                                                                                                     43/43
  Running scriptlet: glibc-all-langpacks-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                   43/43
  Running scriptlet: libgcc-11.5.0-5.0.1.el9.x86_64                                                                                                                                                     43/43
  Verifying        : make-1:4.3-8.el9.x86_64                                                                                                                                                             1/43
  Verifying        : bison-3.7.4-5.el9.x86_64                                                                                                                                                            2/43
  Verifying        : flex-2.6.4-9.el9.x86_64                                                                                                                                                             3/43
  Verifying        : gcc-11.5.0-11.0.2.el9.x86_64                                                                                                                                                        4/43
  Verifying        : glibc-devel-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                            5/43
  Verifying        : glibc-headers-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                          6/43
  Verifying        : kernel-headers-5.14.0-611.47.1.el9_7.x86_64                                                                                                                                         7/43
  Verifying        : libicu-devel-67.1-10.el9_6.x86_64                                                                                                                                                   8/43
  Verifying        : libxcrypt-devel-4.4.18-3.el9.x86_64                                                                                                                                                 9/43
  Verifying        : m4-1.4.19-1.el9.x86_64                                                                                                                                                             10/43
  Verifying        : ncurses-c++-libs-6.2-10.20210508.el9.x86_64                                                                                                                                        11/43
  Verifying        : ncurses-devel-6.2-10.20210508.el9.x86_64                                                                                                                                           12/43
  Verifying        : openssl-devel-1:3.5.1-7.0.1.el9_7.x86_64                                                                                                                                           13/43
  Verifying        : readline-devel-8.1-4.el9.x86_64                                                                                                                                                    14/43
  Verifying        : zlib-devel-1.2.11-40.el9.x86_64                                                                                                                                                    15/43
  Verifying        : glibc-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                                 16/43
  Verifying        : glibc-2.34-168.0.1.el9.x86_64                                                                                                                                                      17/43
  Verifying        : glibc-all-langpacks-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                   18/43
  Verifying        : glibc-all-langpacks-2.34-168.0.1.el9.x86_64                                                                                                                                        19/43
  Verifying        : glibc-common-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                          20/43
  Verifying        : glibc-common-2.34-168.0.1.el9.x86_64                                                                                                                                               21/43
  Verifying        : glibc-gconv-extra-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                     22/43
  Verifying        : glibc-gconv-extra-2.34-168.0.1.el9.x86_64                                                                                                                                          23/43
  Verifying        : glibc-langpack-en-2.34-231.0.1.el9_7.10.x86_64                                                                                                                                     24/43
  Verifying        : glibc-langpack-en-2.34-168.0.1.el9.x86_64                                                                                                                                          25/43
  Verifying        : libgcc-11.5.0-11.0.2.el9.x86_64                                                                                                                                                    26/43
  Verifying        : libgcc-11.5.0-5.0.1.el9.x86_64                                                                                                                                                     27/43
  Verifying        : libgomp-11.5.0-11.0.2.el9.x86_64                                                                                                                                                   28/43
  Verifying        : libgomp-11.5.0-5.0.1.el9.x86_64                                                                                                                                                    29/43
  Verifying        : libicu-67.1-10.el9_6.x86_64                                                                                                                                                        30/43
  Verifying        : libicu-67.1-9.el9.x86_64                                                                                                                                                           31/43
  Verifying        : openssl-1:3.5.1-7.0.1.el9_7.x86_64                                                                                                                                                 32/43
  Verifying        : openssl-1:3.2.2-6.0.1.el9_5.1.x86_64                                                                                                                                               33/43
  Verifying        : openssl-fips-provider-3.0.7-8.0.1.el9.x86_64                                                                                                                                       34/43
  Verifying        : openssl-fips-provider-3.0.7-6.0.1.el9_5.x86_64                                                                                                                                     35/43
  Verifying        : openssl-fips-provider-so-3.0.7-8.0.1.el9.x86_64                                                                                                                                    36/43
  Verifying        : openssl-fips-provider-so-3.0.7-6.0.1.el9_5.x86_64                                                                                                                                  37/43
  Verifying        : openssl-libs-1:3.5.1-7.0.1.el9_7.x86_64                                                                                                                                            38/43
  Verifying        : openssl-libs-1:3.2.2-6.0.1.el9_5.1.x86_64                                                                                                                                          39/43
  Verifying        : tar-2:1.34-9.el9_7.x86_64                                                                                                                                                          40/43
  Verifying        : tar-2:1.34-7.el9.x86_64                                                                                                                                                            41/43
  Verifying        : cpp-11.5.0-11.0.2.el9.x86_64                                                                                                                                                       42/43
  Verifying        : cpp-11.5.0-5.0.1.el9.x86_64                                                                                                                                                        43/43

Upgraded:
  cpp-11.5.0-11.0.2.el9.x86_64                      glibc-2.34-231.0.1.el9_7.10.x86_64                glibc-all-langpacks-2.34-231.0.1.el9_7.10.x86_64    glibc-common-2.34-231.0.1.el9_7.10.x86_64
  glibc-gconv-extra-2.34-231.0.1.el9_7.10.x86_64    glibc-langpack-en-2.34-231.0.1.el9_7.10.x86_64    libgcc-11.5.0-11.0.2.el9.x86_64                     libgomp-11.5.0-11.0.2.el9.x86_64
  libicu-67.1-10.el9_6.x86_64                       openssl-1:3.5.1-7.0.1.el9_7.x86_64                openssl-fips-provider-3.0.7-8.0.1.el9.x86_64        openssl-fips-provider-so-3.0.7-8.0.1.el9.x86_64
  openssl-libs-1:3.5.1-7.0.1.el9_7.x86_64           tar-2:1.34-9.el9_7.x86_64
Installed:
  bison-3.7.4-5.el9.x86_64                           flex-2.6.4-9.el9.x86_64                             gcc-11.5.0-11.0.2.el9.x86_64                        glibc-devel-2.34-231.0.1.el9_7.10.x86_64
  glibc-headers-2.34-231.0.1.el9_7.10.x86_64         kernel-headers-5.14.0-611.47.1.el9_7.x86_64         libicu-devel-67.1-10.el9_6.x86_64                   libxcrypt-devel-4.4.18-3.el9.x86_64
  m4-1.4.19-1.el9.x86_64                             make-1:4.3-8.el9.x86_64                             ncurses-c++-libs-6.2-10.20210508.el9.x86_64         ncurses-devel-6.2-10.20210508.el9.x86_64
  openssl-devel-1:3.5.1-7.0.1.el9_7.x86_64           readline-devel-8.1-4.el9.x86_64                     zlib-devel-1.2.11-40.el9.x86_64

Complete!
[root@pgdb01 ~]#

3. Create postgres User

[root@pgdb01 ~]# useradd postgres
[root@pgdb01 ~]# passwd postgres
Changing password for user postgres.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
[root@pgdb01 ~]#

4. Download PostgreSQL Source

[root@pgdb01 ~]# mkdir -p /pg_Backup/stage

[root@pgdb01 ~]# cd /pg_Backup/stage
[root@pgdb01 stage]# wget https://ftp.postgresql.org/pub/source/v17.4/postgresql-17.4.tar.gz
--2026-04-21 20:22:48--  https://ftp.postgresql.org/pub/source/v17.4/postgresql-17.4.tar.gz
Resolving ftp.postgresql.org (ftp.postgresql.org)... 151.101.211.52, 2a04:4e42:31::820
Connecting to ftp.postgresql.org (ftp.postgresql.org)|151.101.211.52|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 28056622 (27M) [application/gzip]
Saving to: ‘postgresql-17.4.tar.gz’

postgresql-17.4.tar.gz                              100%[=================================================================================================================>]  26.76M  10.2MB/s    in 2.6s

2026-04-21 20:22:51 (10.2 MB/s) - ‘postgresql-17.4.tar.gz’ saved [28056622/28056622]

[root@pgdb01 stage]#

5. Extract Source

[root@pgdb01 stage]# tar -xvf postgresql-17.4.tar.gz
postgresql-17.4/
postgresql-17.4/.cirrus.star
postgresql-17.4/.cirrus.tasks.yml
..
..
postgresql-17.4/src/tutorial/funcs.source
postgresql-17.4/src/tutorial/syscat.source
[root@pgdb01 stage]#
[root@pgdb01 stage]# ls -ltr
total 27404
drwxrwxr-x. 6 root root     4096 Feb 18  2025 postgresql-17.4
-rw-r--r--. 1 root root 28056622 Feb 18  2025 postgresql-17.4.tar.gz
[root@pgdb01 stage]# cd postgresql-17.4
[root@pgdb01 postgresql-17.4]# pwd
/pg_Backup/stage/postgresql-17.4
[root@pgdb01 postgresql-17.4]#

6. Configure Build

[root@pgdb01 postgresql-17.4]# ls -ltr /pg_Backup/stage/postgresql-17.4/configure
-rwxrwxr-x. 1 root root 580836 Feb 18  2025 /pg_Backup/stage/postgresql-17.4/configure
[root@pgdb01 postgresql-17.4]#

Configure do only:

-- checks system dependencies
-- prepares Makefiles
-- stores your install path (/pgbin/pgsql/17.4) internally, it won't create bin directory.
-- It does NOT install anything yet


[root@pgdb01 postgresql-17.4]# ./configure --prefix=/pgbin/pgsql/17.4 --with-pgport=5432
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking which template to use... linux
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gcc option to accept ISO C99... none needed
checking for g++... no
checking for c++... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking for gawk... gawk
checking whether gcc supports -Wdeclaration-after-statement, for CFLAGS... yes
checking whether gcc supports -Werror=vla, for CFLAGS... yes
checking whether gcc supports -Werror=unguarded-availability-new, for CFLAGS... no
checking whether g++ supports -Werror=unguarded-availability-new, for CXXFLAGS... no
checking whether gcc supports -Wendif-labels, for CFLAGS... yes
checking whether g++ supports -Wendif-labels, for CXXFLAGS... no
checking whether gcc supports -Wmissing-format-attribute, for CFLAGS... yes
checking whether g++ supports -Wmissing-format-attribute, for CXXFLAGS... no
checking whether gcc supports -Wimplicit-fallthrough=3, for CFLAGS... yes
checking whether g++ supports -Wimplicit-fallthrough=3, for CXXFLAGS... no
checking whether gcc supports -Wcast-function-type, for CFLAGS... yes
checking whether g++ supports -Wcast-function-type, for CXXFLAGS... no
checking whether gcc supports -Wshadow=compatible-local, for CFLAGS... yes
checking whether g++ supports -Wshadow=compatible-local, for CXXFLAGS... no
checking whether gcc supports -Wformat-security, for CFLAGS... yes
checking whether g++ supports -Wformat-security, for CXXFLAGS... no
checking whether gcc supports -fno-strict-aliasing, for CFLAGS... yes
checking whether g++ supports -fno-strict-aliasing, for CXXFLAGS... no
checking whether gcc supports -fwrapv, for CFLAGS... yes
checking whether g++ supports -fwrapv, for CXXFLAGS... no
checking whether gcc supports -fexcess-precision=standard, for CFLAGS... yes
checking whether g++ supports -fexcess-precision=standard, for CXXFLAGS... no
checking whether gcc supports -funroll-loops, for CFLAGS_UNROLL_LOOPS... yes
checking whether gcc supports -ftree-vectorize, for CFLAGS_VECTORIZE... yes
checking whether gcc supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... no
checking whether gcc supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... no
checking whether gcc supports -Wformat-truncation, for NOT_THE_CFLAGS... yes
checking whether gcc supports -Wstringop-truncation, for NOT_THE_CFLAGS... yes
checking whether gcc supports -Wcast-function-type-strict, for NOT_THE_CFLAGS... no
checking whether gcc supports -fvisibility=hidden, for CFLAGS_SL_MODULE... yes
checking whether g++ supports -fvisibility=hidden, for CXXFLAGS_SL_MODULE... no
checking whether g++ supports -fvisibility-inlines-hidden, for CXXFLAGS_SL_MODULE... no
checking whether the C compiler still works... yes
checking how to run the C preprocessor... gcc -E
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking whether to build with ICU support... yes
checking for icu-uc icu-i18n... yes
checking whether to build with Tcl... no
checking whether to build Perl modules... no
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with PAM support... no
checking whether to build with BSD Authentication support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with SELinux support... no
checking whether to build with systemd support... no
checking whether to build with XML support... no
checking whether to build with LZ4 support... no
checking whether to build with ZSTD support... no
checking for strip... strip
checking whether it is possible to strip libraries... yes
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for tar... /usr/bin/tar
checking whether ln -s works... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for bison... /usr/bin/bison
configure: using bison (GNU Bison) 3.7.4
checking for flex... /usr/bin/flex
configure: using flex 2.6.4
checking for perl... /usr/bin/perl
configure: using perl 5.32.1
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether gcc is Clang... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for strerror_r... yes
checking whether strerror_r returns int... no
checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlsym... none required
checking for library containing socket... none required
checking for library containing getopt_long... none required
checking for library containing shm_open... none required
checking for library containing shm_unlink... none required
checking for library containing clock_gettime... none required
checking for library containing shmget... none required
checking for library containing backtrace_symbols... none required
checking for library containing pthread_barrier_wait... none required
checking for library containing readline... -lreadline
checking for inflate in -lz... yes
checking atomic.h usability... no
checking atomic.h presence... no
checking for atomic.h... no
checking copyfile.h usability... no
checking copyfile.h presence... no
checking for copyfile.h... no
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking mbarrier.h usability... no
checking mbarrier.h presence... no
checking for mbarrier.h... no
checking sys/epoll.h usability... yes
checking sys/epoll.h presence... yes
checking for sys/epoll.h... yes
checking sys/event.h usability... no
checking sys/event.h presence... no
checking for sys/event.h... no
checking sys/personality.h usability... yes
checking sys/personality.h presence... yes
checking for sys/personality.h... yes
checking sys/prctl.h usability... yes
checking sys/prctl.h presence... yes
checking for sys/prctl.h... yes
checking sys/procctl.h usability... no
checking sys/procctl.h presence... no
checking for sys/procctl.h... no
checking sys/signalfd.h usability... yes
checking sys/signalfd.h presence... yes
checking for sys/signalfd.h... yes
checking sys/ucred.h usability... no
checking sys/ucred.h presence... no
checking for sys/ucred.h... no
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking ucred.h usability... no
checking ucred.h presence... no
checking for ucred.h... no
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for lz4... no
checking for zstd... no
checking for openssl... /usr/bin/openssl
configure: using openssl: OpenSSL 3.5.1 1 Jul 2025 (Library: OpenSSL 3.5.1 1 Jul 2025)
checking whether byte ordering is bigendian... no
checking for inline... inline
checking for printf format archetype... gnu_printf
checking for _Static_assert... yes
checking for typeof... typeof
checking for __builtin_types_compatible_p... yes
checking for __builtin_constant_p... yes
checking for __builtin_unreachable... yes
checking for computed goto support... yes
checking for struct tm.tm_zone... yes
checking for union semun... no
checking for socklen_t... yes
checking for struct sockaddr.sa_len... no
checking for locale_t... yes
checking for C/C++ restrict keyword... __restrict
checking for struct option... yes
checking whether assembler supports x86_64 popcntq... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of off_t... 8
checking size of bool... 1
checking for int timezone... yes
checking for wcstombs_l declaration... no
checking for backtrace_symbols... yes
checking for copyfile... no
checking for copy_file_range... yes
checking for getifaddrs... yes
checking for getpeerucred... no
checking for inet_pton... yes
checking for kqueue... no
checking for mbstowcs_l... no
checking for memset_s... no
checking for posix_fallocate... yes
checking for ppoll... yes
checking for pthread_is_threaded_np... no
checking for setproctitle... no
checking for setproctitle_fast... no
checking for strchrnul... yes
checking for strsignal... yes
checking for syncfs... yes
checking for sync_file_range... yes
checking for uselocale... yes
checking for wcstombs_l... no
checking for __builtin_bswap16... yes
checking for __builtin_bswap32... yes
checking for __builtin_bswap64... yes
checking for __builtin_clz... yes
checking for __builtin_ctz... yes
checking for __builtin_popcount... yes
checking for __builtin_frame_address... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking how gcc reports undeclared, standard C functions... error
checking for posix_fadvise... yes
checking whether posix_fadvise is declared... yes
checking whether fdatasync is declared... yes
checking whether strlcat is declared... no
checking whether strlcpy is declared... no
checking whether strnlen is declared... yes
checking whether preadv is declared... yes
checking whether pwritev is declared... yes
checking whether F_FULLFSYNC is declared... no
checking for explicit_bzero... yes
checking for getopt... yes
checking for getpeereid... no
checking for inet_aton... yes
checking for mkdtemp... yes
checking for strlcat... no
checking for strlcpy... no
checking for strnlen... yes
checking for pthread_barrier_wait... yes
checking for getopt_long... yes
checking for syslog... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for opterr... yes
checking for optreset... no
checking unicode/ucol.h usability... yes
checking unicode/ucol.h presence... yes
checking for unicode/ucol.h... yes
checking for rl_completion_suppress_quote... yes
checking for rl_filename_quote_characters... yes
checking for rl_filename_quoting_function... yes
checking for append_history... yes
checking for history_truncate_file... yes
checking for rl_completion_matches... yes
checking for rl_filename_completion_function... yes
checking for rl_reset_screen_size... yes
checking for rl_variable_bind... yes
checking test program... ok
checking whether long int is 64 bits... yes
checking for __builtin_mul_overflow... yes
checking size of void *... 8
checking size of size_t... 8
checking size of long... 8
checking alignment of short... 2
checking alignment of int... 4
checking alignment of long... 8
checking alignment of double... 8
checking for int8... no
checking for uint8... no
checking for int64... no
checking for uint64... no
checking for __int128... yes
checking for __int128 alignment bug... ok
checking alignment of PG_INT128_TYPE... 16
checking for builtin __sync char locking functions... yes
checking for builtin __sync int32 locking functions... yes
checking for builtin __sync int32 atomic operations... yes
checking for builtin __sync int64 atomic operations... yes
checking for builtin __atomic int32 atomic operations... yes
checking for builtin __atomic int64 atomic operations... yes
checking for __get_cpuid... yes
checking for __get_cpuid_count... yes
checking for __cpuid... no
checking for __cpuidex... no
checking for _xgetbv with CFLAGS=... no
checking for _xgetbv with CFLAGS=-mxsave... yes
checking for _mm512_popcnt_epi64 with CFLAGS=... no
checking for _mm512_popcnt_epi64 with CFLAGS=-mavx512vpopcntdq -mavx512bw... yes
checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... yes
checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=... no
checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc+simd... no
checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc... no
checking for __builtin_loongarch_crcc_w_b_w, __builtin_loongarch_crcc_w_h_w, __builtin_loongarch_crcc_w_w_w and __builtin_loongarch_crcc_w_d_w... no
checking which CRC-32C implementation to use... SSE 4.2
checking for library containing sem_init... none required
checking which semaphore API to use... unnamed POSIX
checking which random number source to use... /dev/urandom
checking for /dev/urandom... yes
checking for xmllint... /usr/bin/xmllint
checking for xsltproc... /usr/bin/xsltproc
checking for fop... no
checking for dbtoepub... no
checking whether gcc supports -Wl,--as-needed, for LDFLAGS... yes
checking whether gcc supports -Wl,--export-dynamic, for LDFLAGS_EX_BE... yes
configure: using compiler=gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-11.0.2)
configure: using CFLAGS=-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2
configure: using CPPFLAGS= -D_GNU_SOURCE
configure: using LDFLAGS=  -Wl,--as-needed
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
config.status: creating src/include/pg_config_ext.h
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s
config.status: linking src/backend/port/posix_sema.c to src/backend/port/pg_sema.c
config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c
config.status: linking src/include/port/linux.h to src/include/pg_config_os.h
config.status: linking src/makefiles/Makefile.linux to src/Makefile.port
[root@pgdb01 postgresql-17.4]#

7. Compile Source

A Makefile is a special text configuration file used by the make build automation tool to automatically compile and link C programs. Instead of manually typing long gcc compilation commands every time you modify your code, a Makefile lets you build your entire project by simply typing make into your terminal. make compiles source code into executable binary files, while make install copies those compiled files into your system directories so the program can be run from anywhere.
[root@pgdb01 postgresql-17.4]# which make
/usr/bin/make
[root@pgdb01 postgresql-17.4]#
[root@pgdb01 postgresql-17.4]# ls -ltr Makefile
-rw-rw-r--. 1 root root 1822 Feb 18  2025 Makefile
[root@pgdb01 postgresql-17.4]#

[root@pgdb01 postgresql-17.4]# make
make -C ./src/backend generated-headers
make[1]: Entering directory '/pg_Backup/stage/postgresql-17.4/src/backend'
make -C ../include/catalog generated-headers
make[2]: Entering directory '/pg_Backup/stage/postgresql-17.4/src/include/catalog'
'/usr/bin/perl' ../../../src/backend/catalog/genbki.pl --include-path=../../../src/include/ \
        --set-version=17 ../../../src/include/catalog/pg_proc.h ../../../src/include/catalog/pg_type.h ../../../src/include/catalog/pg_attribute.h ../../../src/include/catalog/pg_class.h ../../../src/include/catalog/pg_attrdef.h ../../../src/include/catalog/pg_constraint.h ../../../src/include/catalog/pg_inherits.h ../../../src/include/catalog/pg_index.h ../../../src/include/catalog/pg_operator.h ../../../src/include/catalog/pg_opfamily.h ../../../src/include/catalog/pg_opclass.h ../../../src/include/catalog/pg_am.h ../../../src/include/catalog/pg_amop.h ../../../src/include/catalog/pg_amproc.h ../../../src/include/catalog/pg_language.h ../../../src/include/catalog/pg_largeobject_metadata.h ../../../src/include/catalog/pg_largeobject.h ../../../src/include/catalog/pg_aggregate.h ../../../src/include/catalog/pg_statistic.h ../../../src/include/catalog/pg_statistic_ext.h ../../../src/include/catalog/pg_statistic_ext_data.h ../../../src/include/catalog/pg_rewrite.h ../../../src/include/catalog/pg_trigger.h ../../../src/include/catalog/pg_event_trigger.h ../../../src/include/catalog/pg_description.h ../../../src/include/catalog/pg_cast.h ../../../src/include/catalog/pg_enum.h ../../../src/include/catalog/pg_namespace.h ../../../src/include/catalog/pg_conversion.h ../../../src/include/catalog/pg_depend.h ../../../src/include/catalog/pg_database.h ../../../src/include/catalog/pg_db_role_setting.h ../../../src/include/catalog/pg_tablespace.h ../../../src/include/catalog/pg_authid.h ../../../src/include/catalog/pg_auth_members.h ../../../src/include/catalog/pg_shdepend.h ../../../src/include/catalog/pg_shdescription.h ../../../src/include/catalog/pg_ts_config.h ../../../src/include/catalog/pg_ts_config_map.h ../../../src/include/catalog/pg_ts_dict.h ../../../src/include/catalog/pg_ts_parser.h ../../../src/include/catalog/pg_ts_template.h ../../../src/include/catalog/pg_extension.h ../../../src/include/catalog/pg_foreign_data_wrapper.h ../../../src/include/catalog/pg_foreign_server.h ../../../src/include/catalog/pg_user_mapping.h ../../../src/include/catalog/pg_foreign_table.h ../../../src/include/catalog/pg_policy.h ../../../src/include/catalog/pg_replication_origin.h ../../../src/include/catalog/pg_default_acl.h ../../../src/include/catalog/pg_init_privs.h ../../../src/include/catalog/pg_seclabel.h ../../../src/include/catalog/pg_shseclabel.h ../../../src/include/catalog/pg_collation.h ../../../src/include/catalog/pg_parameter_acl.h ../../../src/include/catalog/pg_partitioned_table.h ../../../src/include/catalog/pg_range.h ../../../src/include/catalog/pg_transform.h ../../../src/include/catalog/pg_sequence.h ../../../src/include/catalog/pg_publication.h ../../../src/include/catalog/pg_publication_namespace.h ../../../src/include/catalog/pg_publication_rel.h ../../../src/include/catalog/pg_subscription.h ../../../src/include/catalog/pg_subscription_rel.h
Can't locate FindBin.pm in @INC (you may need to install the FindBin module) (@INC contains: /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ../../../src/backend/catalog/genbki.pl line 20.
BEGIN failed--compilation aborted at ../../../src/backend/catalog/genbki.pl line 20.
make[2]: *** [Makefile:141: bki-stamp] Error 2
make[2]: Leaving directory '/pg_Backup/stage/postgresql-17.4/src/include/catalog'
make[1]: *** [Makefile:121: submake-catalog-headers] Error 2
make[1]: Leaving directory '/pg_Backup/stage/postgresql-17.4/src/backend'
make: *** [src/Makefile.global:384: submake-generated-headers] Error 2
[root@pgdb01 postgresql-17.4]#

*** The FindBin module is a core Perl library used to locate the absolute directory path of the currently executing script. It is primarily used in conjunction with the lib module to dynamically load local, relative modules without hardcoding paths. ****

[root@pgdb01 postgresql-17.4]# dnf install -y perl perl-core perl-ExtUtils-MakeMaker
Last metadata expiration check: 1:17:45 ago on Tue 21 Apr 2026 07:35:12 PM.
Dependencies resolved.
==============================================================================================================================================================================================================
 Package                                                    Architecture                         Version                                                Repository                                       Size
==============================================================================================================================================================================================================
Installing:
 perl                                                       x86_64                               4:5.32.1-481.1.el9_6                                   ol9_appstream                                    11 k
 perl-ExtUtils-MakeMaker                                    noarch                               2:7.60-3.el9                                           ol9_appstream                                   352 k
Upgrading:
 libstdc++                                                  x86_64                               11.5.0-11.0.2.el9                                      ol9_baseos_latest                               757 k
 perl-Errno                                                 x86_64                               1.30-481.1.el9_6                                       ol9_appstream                                    13 k
 perl-interpreter                                           x86_64                               4:5.32.1-481.1.el9_6                                   ol9_appstream                                    76 k
 perl-libs                                                  x86_64                               4:5.32.1-481.1.el9_6                                   ol9_appstream                                   2.7 M
Installing dependencies:
 annobin                                                    x86_64                               12.92-1.el9                                            ol9_appstream                                   1.1 M
 dwz                                                        x86_64                               0.16-1.el9                                             ol9_appstream                                   139 k
 efi-srpm-macros                                            noarch                               6-4.0.1.el9                                            ol9_appstream                                    26 k
 fonts-srpm-macros                                          noarch                               1:2.0.5-7.el9.1                                        ol9_appstream                                    32 k
 gcc-c++                                                    x86_64                               11.5.0-11.0.2.el9                                      ol9_appstream                                    13 M
 gcc-plugin-annobin                                         x86_64                               11.5.0-11.0.2.el9                                      ol9_appstream                                    38 k
 ghc-srpm-macros                                            noarch                               1.5.0-6.el9                                            ol9_appstream                                   8.7 k
 go-srpm-macros                                             noarch                               3.6.0-14.el9_7                                         ol9_appstream                                    31 k
 kernel-srpm-macros                                         noarch                               1.0-14.0.1.el9                                         ol9_appstream                                    20 k
 libstdc++-devel                                            x86_64                               11.5.0-11.0.2.el9                                      ol9_appstream                                   3.1 M
 lua-srpm-macros                                            noarch                               1-6.el9                                                ol9_appstream                                   9.4 k
 ocaml-srpm-macros                                          noarch                               6-6.el9                                                ol9_appstream                                   8.7 k
 openblas-srpm-macros                                       noarch                               2-11.el9                                               ol9_appstream                                   8.3 k
 perl-Algorithm-Diff                                        noarch                               1.2010-4.el9                                           ol9_appstream                                    58 k
 perl-Archive-Tar                                           noarch                               2.38-6.el9                                             ol9_appstream                                    85 k
 perl-Archive-Zip                                           noarch                               1.68-6.el9                                             ol9_appstream                                   144 k
 perl-Attribute-Handlers                                    noarch                               1.01-481.1.el9_6                                       ol9_appstream                                    26 k
 perl-AutoSplit                                             noarch                               5.74-481.1.el9_6                                       ol9_appstream                                    20 k
 perl-Benchmark                                             noarch                               1.23-481.1.el9_6                                       ol9_appstream                                    25 k
 perl-CPAN                                                  noarch                               2.29-5.el9_6                                           ol9_appstream                                   630 k
 perl-CPAN-Meta                                             noarch                               2.150010-460.el9                                       ol9_appstream                                   292 k
 perl-CPAN-Meta-Requirements                                noarch                               2.140-461.el9                                          ol9_appstream                                    38 k
 perl-CPAN-Meta-YAML                                        noarch                               0.018-461.el9                                          ol9_appstream                                    31 k
 perl-Compress-Bzip2                                        x86_64                               2.28-5.el9                                             ol9_appstream                                    78 k
 perl-Compress-Raw-Bzip2                                    x86_64                               2.101-5.el9                                            ol9_appstream                                    40 k
 perl-Compress-Raw-Lzma                                     x86_64                               2.101-3.el9                                            ol9_appstream                                    57 k
 perl-Compress-Raw-Zlib                                     x86_64                               2.101-5.el9                                            ol9_appstream                                    66 k
 perl-Config-Extensions                                     noarch                               0.03-481.1.el9_6                                       ol9_appstream                                    11 k
 perl-Config-Perl-V                                         noarch                               0.33-4.el9                                             ol9_appstream                                    28 k
 perl-DBM_Filter                                            noarch                               0.06-481.1.el9_6                                       ol9_appstream                                    43 k
 perl-DB_File                                               x86_64                               1.855-4.el9                                            ol9_appstream                                    87 k
 perl-Data-OptList                                          noarch                               0.110-17.el9                                           ol9_appstream                                    36 k
 perl-Data-Section                                          noarch                               0.200007-14.el9                                        ol9_appstream                                    30 k
 perl-Devel-PPPort                                          x86_64                               3.62-4.el9                                             ol9_appstream                                   220 k
 perl-Devel-Peek                                            x86_64                               1.28-481.1.el9_6                                       ol9_appstream                                    30 k
 perl-Devel-SelfStubber                                     noarch                               1.06-481.1.el9_6                                       ol9_appstream                                    13 k
 perl-Devel-Size                                            x86_64                               0.83-10.el9                                            ol9_appstream                                    32 k
 perl-Digest-SHA                                            x86_64                               1:6.02-461.el9                                         ol9_appstream                                    70 k
 perl-Digest-SHA1                                           x86_64                               2.13-34.el9                                            ol9_appstream                                    60 k
 perl-DirHandle                                             noarch                               1.05-481.1.el9_6                                       ol9_appstream                                    11 k
 perl-Dumpvalue                                             noarch                               2.27-481.1.el9_6                                       ol9_appstream                                    17 k
 perl-Encode-devel                                          x86_64                               4:3.08-462.el9                                         ol9_appstream                                    51 k
 perl-English                                               noarch                               1.11-481.1.el9_6                                       ol9_appstream                                    12 k
 perl-Env                                                   noarch                               1.04-460.el9                                           ol9_appstream                                    25 k
 perl-ExtUtils-CBuilder                                     noarch                               1:0.280236-4.el9                                       ol9_appstream                                    69 k
 perl-ExtUtils-Command                                      noarch                               2:7.60-3.el9                                           ol9_appstream                                    15 k
 perl-ExtUtils-Constant                                     noarch                               0.25-481.1.el9_6                                       ol9_appstream                                    55 k
 perl-ExtUtils-Embed                                        noarch                               1.35-481.1.el9_6                                       ol9_appstream                                    16 k
 perl-ExtUtils-Install                                      noarch                               2.20-4.el9                                             ol9_appstream                                    53 k
 perl-ExtUtils-MM-Utils                                     noarch                               2:7.60-3.el9                                           ol9_appstream                                    13 k
 perl-ExtUtils-Manifest                                     noarch                               1:1.73-4.el9                                           ol9_appstream                                    40 k
 perl-ExtUtils-Miniperl                                     noarch                               1.09-481.1.el9_6                                       ol9_appstream                                    14 k
 perl-ExtUtils-ParseXS                                      noarch                               1:3.40-460.el9                                         ol9_appstream                                   212 k
 perl-File-Compare                                          noarch                               1.100.600-481.1.el9_6                                  ol9_appstream                                    12 k
 perl-File-Copy                                             noarch                               2.34-481.1.el9_6                                       ol9_appstream                                    19 k
 perl-File-DosGlob                                          x86_64                               1.12-481.1.el9_6                                       ol9_appstream                                    18 k
 perl-File-Fetch                                            noarch                               1.00-4.el9                                             ol9_appstream                                    31 k
 perl-File-HomeDir                                          noarch                               1.006-4.el9                                            ol9_appstream                                    81 k
 perl-File-Which                                            noarch                               1.23-10.el9                                            ol9_appstream                                    22 k
 perl-FileCache                                             noarch                               1.10-481.1.el9_6                                       ol9_appstream                                    13 k
 perl-Filter                                                x86_64                               2:1.60-4.el9                                           ol9_appstream                                   121 k
 perl-Filter-Simple                                         noarch                               0.96-460.el9                                           ol9_appstream                                    28 k
 perl-FindBin                                               noarch                               1.51-481.1.el9_6                                       ol9_appstream                                    12 k
 perl-GDBM_File                                             x86_64                               1.18-481.1.el9_6                                       ol9_appstream                                    21 k
 perl-Hash-Util                                             x86_64                               0.23-481.1.el9_6                                       ol9_appstream                                    33 k
 perl-Hash-Util-FieldHash                                   x86_64                               1.20-481.1.el9_6                                       ol9_appstream                                    36 k
 perl-I18N-Collate                                          noarch                               1.02-481.1.el9_6                                       ol9_appstream                                    13 k
 perl-I18N-LangTags                                         noarch                               0.44-481.1.el9_6                                       ol9_appstream                                    59 k
 perl-I18N-Langinfo                                         x86_64                               0.19-481.1.el9_6                                       ol9_appstream                                    21 k
 perl-IO-Compress                                           noarch                               2.102-4.el9                                            ol9_appstream                                   321 k
 perl-IO-Compress-Lzma                                      noarch                               2.101-4.el9                                            ol9_appstream                                   101 k
 perl-IO-Zlib                                               noarch                               1:1.11-4.el9                                           ol9_appstream                                    20 k
 perl-IPC-Cmd                                               noarch                               2:1.04-461.el9                                         ol9_appstream                                    40 k
 perl-IPC-SysV                                              x86_64                               2.09-4.el9                                             ol9_appstream                                    55 k
 perl-IPC-System-Simple                                     noarch                               1.30-6.el9                                             ol9_appstream                                    46 k
 perl-Importer                                              noarch                               0.026-4.el9                                            ol9_appstream                                    45 k
 perl-JSON-PP                                               noarch                               1:4.06-4.el9                                           ol9_appstream                                    74 k
 perl-Locale-Maketext                                       noarch                               1.29-461.el9                                           ol9_appstream                                   108 k
 perl-Locale-Maketext-Simple                                noarch                               1:0.21-481.1.el9_6                                     ol9_appstream                                    16 k
 perl-MIME-Charset                                          noarch                               1.012.2-15.el9                                         ol9_appstream                                    60 k
 perl-MRO-Compat                                            noarch                               0.13-15.el9                                            ol9_appstream                                    27 k
 perl-Math-BigInt-FastCalc                                  x86_64                               0.500.900-460.el9                                      ol9_appstream                                    35 k
 perl-Math-BigRat                                           noarch                               0.2614-460.el9                                         ol9_appstream                                    46 k
 perl-Memoize                                               noarch                               1.03-481.1.el9_6                                       ol9_appstream                                    72 k
 perl-Module-Build                                          noarch                               2:0.42.31-9.el9                                        ol9_appstream                                   305 k
 perl-Module-CoreList                                       noarch                               1:5.20240609-1.el9                                     ol9_appstream                                    95 k
 perl-Module-CoreList-tools                                 noarch                               1:5.20240609-1.el9                                     ol9_appstream                                    16 k
 perl-Module-Load                                           noarch                               1:0.36-4.el9                                           ol9_appstream                                    18 k
 perl-Module-Load-Conditional                               noarch                               0.74-4.el9                                             ol9_appstream                                    23 k
 perl-Module-Loaded                                         noarch                               1:0.08-481.1.el9_6                                     ol9_appstream                                    12 k
 perl-Module-Metadata                                       noarch                               1.000037-460.el9                                       ol9_appstream                                    42 k
 perl-Module-Signature                                      noarch                               0.88-1.el9                                             ol9_appstream                                    95 k
 perl-NEXT                                                  noarch                               0.67-481.1.el9_6                                       ol9_appstream                                    19 k
 perl-Net                                                   noarch                               1.02-481.1.el9_6                                       ol9_appstream                                    33 k
 perl-Net-Ping                                              noarch                               2.74-5.el9                                             ol9_appstream                                    55 k
 perl-ODBM_File                                             x86_64                               1.16-481.1.el9_6                                       ol9_appstream                                    21 k
 perl-Object-HashBase                                       noarch                               0.009-7.el9                                            ol9_appstream                                    31 k
 perl-Opcode                                                x86_64                               1.48-481.1.el9_6                                       ol9_appstream                                    40 k
 perl-Package-Generator                                     noarch                               1.106-23.el9                                           ol9_appstream                                    31 k
 perl-Params-Check                                          noarch                               1:0.38-461.el9                                         ol9_appstream                                    23 k
 perl-Params-Util                                           x86_64                               1.102-5.el9                                            ol9_appstream                                    41 k
 perl-Perl-OSType                                           noarch                               1.010-461.el9                                          ol9_appstream                                    29 k
 perl-PerlIO-via-QuotedPrint                                noarch                               0.09-4.el9                                             ol9_appstream                                    29 k
 perl-Pod-Checker                                           noarch                               4:1.74-4.el9                                           ol9_appstream                                    38 k
 perl-Pod-Functions                                         noarch                               1.13-481.1.el9_6                                       ol9_appstream                                    12 k
 perl-Pod-Html                                              noarch                               1.25-481.1.el9_6                                       ol9_appstream                                    31 k
 perl-Safe                                                  noarch                               2.41-481.1.el9_6                                       ol9_appstream                                    23 k
 perl-Search-Dict                                           noarch                               1.07-481.1.el9_6                                       ol9_appstream                                    11 k
 perl-SelfLoader                                            noarch                               1.26-481.1.el9_6                                       ol9_appstream                                    20 k
 perl-Software-License                                      noarch                               0.103014-12.el9                                        ol9_appstream                                   196 k
 perl-Sub-Exporter                                          noarch                               0.987-27.el9                                           ol9_appstream                                   103 k
 perl-Sub-Install                                           noarch                               0.928-28.el9                                           ol9_appstream                                    28 k
 perl-Sys-Hostname                                          x86_64                               1.23-481.1.el9_6                                       ol9_appstream                                    15 k
 perl-Sys-Syslog                                            x86_64                               0.36-461.el9                                           ol9_appstream                                    54 k
 perl-Term-Complete                                         noarch                               1.403-481.1.el9_6                                      ol9_appstream                                    11 k
 perl-Term-ReadLine                                         noarch                               1.17-481.1.el9_6                                       ol9_appstream                                    17 k
 perl-Term-Size-Perl                                        x86_64                               0.031-12.el9                                           ol9_appstream                                    28 k
 perl-Term-Table                                            noarch                               0.015-8.el9                                            ol9_appstream                                    50 k
 perl-Test                                                  noarch                               1.31-481.1.el9_6                                       ol9_appstream                                    27 k
 perl-Test-Harness                                          noarch                               1:3.42-461.el9                                         ol9_appstream                                   387 k
 perl-Test-Simple                                           noarch                               3:1.302183-4.el9                                       ol9_appstream                                   949 k
 perl-Text-Abbrev                                           noarch                               1.02-481.1.el9_6                                       ol9_appstream                                    11 k
 perl-Text-Balanced                                         noarch                               2.04-4.el9                                             ol9_appstream                                    53 k
 perl-Text-Diff                                             noarch                               1.45-13.el9                                            ol9_appstream                                    50 k
 perl-Text-Glob                                             noarch                               0.11-15.el9                                            ol9_appstream                                    14 k
 perl-Text-Template                                         noarch                               1.59-5.el9                                             ol9_appstream                                    66 k
 perl-Thread                                                noarch                               3.05-481.1.el9_6                                       ol9_appstream                                    16 k
 perl-Thread-Queue                                          noarch                               3.14-460.el9                                           ol9_appstream                                    28 k
 perl-Thread-Semaphore                                      noarch                               2.13-481.1.el9_6                                       ol9_appstream                                    14 k
 perl-Tie                                                   noarch                               4.6-481.1.el9_6                                        ol9_appstream                                    41 k
 perl-Tie-File                                              noarch                               1.06-481.1.el9_6                                       ol9_appstream                                    42 k
 perl-Tie-Memoize                                           noarch                               1.1-481.1.el9_6                                        ol9_appstream                                    13 k
 perl-Tie-RefHash                                           noarch                               1.40-4.el9                                             ol9_appstream                                    29 k
 perl-Time                                                  noarch                               1.03-481.1.el9_6                                       ol9_appstream                                    24 k
 perl-Time-HiRes                                            x86_64                               4:1.9764-462.el9                                       ol9_appstream                                    64 k
 perl-Time-Piece                                            x86_64                               1.3401-481.1.el9_6                                     ol9_appstream                                    45 k
 perl-Unicode-Collate                                       x86_64                               1.29-4.el9                                             ol9_appstream                                   849 k
 perl-Unicode-Normalize                                     x86_64                               1.27-461.el9                                           ol9_appstream                                    96 k
 perl-Unicode-UCD                                           noarch                               0.75-481.1.el9_6                                       ol9_appstream                                    77 k
 perl-User-pwent                                            noarch                               1.03-481.1.el9_6                                       ol9_appstream                                    24 k
 perl-autodie                                               noarch                               2.34-4.el9                                             ol9_appstream                                   117 k
 perl-autouse                                               noarch                               1.11-481.1.el9_6                                       ol9_appstream                                    12 k
 perl-bignum                                                noarch                               0.51-460.el9                                           ol9_appstream                                    56 k
 perl-blib                                                  noarch                               1.07-481.1.el9_6                                       ol9_appstream                                    11 k
 perl-debugger                                              noarch                               1.56-481.1.el9_6                                       ol9_appstream                                   139 k
 perl-deprecate                                             noarch                               0.04-481.1.el9_6                                       ol9_appstream                                    13 k
 perl-devel                                                 x86_64                               4:5.32.1-481.1.el9_6                                   ol9_appstream                                   748 k
 perl-diagnostics                                           noarch                               1.37-481.1.el9_6                                       ol9_appstream                                   216 k
 perl-doc                                                   noarch                               5.32.1-481.1.el9_6                                     ol9_appstream                                   4.9 M
 perl-encoding                                              x86_64                               4:3.00-462.el9                                         ol9_appstream                                    68 k
 perl-encoding-warnings                                     noarch                               0.13-481.1.el9_6                                       ol9_appstream                                    15 k
 perl-experimental                                          noarch                               0.022-6.el9                                            ol9_appstream                                    27 k
 perl-fields                                                noarch                               2.27-481.1.el9_6                                       ol9_appstream                                    15 k
 perl-filetest                                              noarch                               1.03-481.1.el9_6                                       ol9_appstream                                    13 k
 perl-inc-latest                                            noarch                               2:0.500-20.el9                                         ol9_appstream                                    31 k
 perl-less                                                  noarch                               0.03-481.1.el9_6                                       ol9_appstream                                    12 k
 perl-lib                                                   x86_64                               0.65-481.1.el9_6                                       ol9_appstream                                    13 k
 perl-libnetcfg                                             noarch                               4:5.32.1-481.1.el9_6                                   ol9_appstream                                    15 k
 perl-local-lib                                             noarch                               2.000024-13.el9                                        ol9_appstream                                    76 k
 perl-macros                                                noarch                               4:5.32.1-481.1.el9_6                                   ol9_appstream                                   9.2 k
 perl-meta-notation                                         noarch                               5.32.1-481.1.el9_6                                     ol9_appstream                                   8.2 k
 perl-open                                                  noarch                               1.12-481.1.el9_6                                       ol9_appstream                                    15 k
 perl-perlfaq                                               noarch                               5.20210520-1.el9                                       ol9_appstream                                   399 k
 perl-ph                                                    x86_64                               5.32.1-481.1.el9_6                                     ol9_appstream                                    67 k
 perl-sigtrap                                               noarch                               1.09-481.1.el9_6                                       ol9_appstream                                    14 k
 perl-sort                                                  noarch                               2.04-481.1.el9_6                                       ol9_appstream                                    12 k
 perl-srpm-macros                                           noarch                               1-41.el9                                               ol9_appstream                                   9.1 k
 perl-threads                                               x86_64                               1:2.25-460.el9                                         ol9_appstream                                    65 k
 perl-threads-shared                                        x86_64                               1.61-460.el9                                           ol9_appstream                                    50 k
 perl-utils                                                 noarch                               5.32.1-481.1.el9_6                                     ol9_appstream                                    64 k
 perl-version                                               x86_64                               7:0.99.28-4.el9                                        ol9_appstream                                    74 k
 perl-vmsish                                                noarch                               1.04-481.1.el9_6                                       ol9_appstream                                    13 k
 pyproject-srpm-macros                                      noarch                               1.16.2-1.el9                                           ol9_appstream                                    13 k
 python-srpm-macros                                         noarch                               3.9-54.el9                                             ol9_appstream                                    16 k
 qt5-srpm-macros                                            noarch                               5.15.9-1.el9                                           ol9_appstream                                   7.7 k
 redhat-rpm-config                                          noarch                               210-1.0.1.el9                                          ol9_appstream                                   101 k
 rust-srpm-macros                                           noarch                               17-4.el9                                               ol9_appstream                                    10 k
 sombok                                                     x86_64                               2.4.0-16.el9                                           ol9_appstream                                    55 k
 systemtap-sdt-devel                                        x86_64                               5.3-3.0.1.el9                                          ol9_appstream                                    76 k
 systemtap-sdt-dtrace                                       x86_64                               5.3-3.0.1.el9                                          ol9_appstream                                    75 k
Installing weak dependencies:
 perl-CPAN-DistnameInfo                                     noarch                               0.12-23.el9                                            ol9_appstream                                    15 k
 perl-Encode-Locale                                         noarch                               1.05-21.el9                                            ol9_appstream                                    20 k
 perl-Term-Size-Any                                         noarch                               0.002-35.el9                                           ol9_appstream                                    19 k
 perl-TermReadKey                                           x86_64                               2.38-11.el9                                            ol9_appstream                                    42 k
 perl-Unicode-LineBreak                                     x86_64                               2019.001-11.el9                                        ol9_appstream                                   144 k

Transaction Summary
==============================================================================================================================================================================================================
Install  187 Packages
Upgrade    4 Packages

Total download size: 38 M
Downloading Packages:
(1/191): annobin-12.92-1.el9.x86_64.rpm                                                      2.9 MB/s | 1.1 MB     00:00
(2/191): fonts-srpm-macros-2.0.5-7.el9.1.noarch.rpm                                          849 kB/s |  32 kB     00:00
(3/191): efi-srpm-macros-6-4.0.1.el9.noarch.rpm                                               21 kB/s |  26 kB     00:01
(4/191): gcc-plugin-annobin-11.5.0-11.0.2.el9.x86_64.rpm                                     535 kB/s |  38 kB     00:00
(5/191): ghc-srpm-macros-1.5.0-6.el9.noarch.rpm                                              149 kB/s | 8.7 kB     00:00
(6/191): go-srpm-macros-3.6.0-14.el9_7.noarch.rpm                                            332 kB/s |  31 kB     00:00
(7/191): gcc-c++-11.5.0-11.0.2.el9.x86_64.rpm                                                9.7 MB/s |  13 MB     00:01
(8/191): libstdc++-devel-11.5.0-11.0.2.el9.x86_64.rpm                                        9.0 MB/s | 3.1 MB     00:00
(9/191): lua-srpm-macros-1-6.el9.noarch.rpm                                                  268 kB/s | 9.4 kB     00:00
(10/191): kernel-srpm-macros-1.0-14.0.1.el9.noarch.rpm                                        10 kB/s |  20 kB     00:01
(11/191): ocaml-srpm-macros-6-6.el9.noarch.rpm                                               4.7 kB/s | 8.7 kB     00:01
(12/191): perl-5.32.1-481.1.el9_6.x86_64.rpm                                                 316 kB/s |  11 kB     00:00
(13/191): perl-Algorithm-Diff-1.2010-4.el9.noarch.rpm                                                                                                                         229 kB/s |  58 kB     00:00
(14/191): perl-Archive-Tar-2.38-6.el9.noarch.rpm                                                                                                                              878 kB/s |  85 kB     00:00
(15/191): perl-Archive-Zip-1.68-6.el9.noarch.rpm                                                                                                                              2.3 MB/s | 144 kB     00:00
(16/191): perl-Attribute-Handlers-1.01-481.1.el9_6.noarch.rpm                                                                                                                 277 kB/s |  26 kB     00:00
(17/191): perl-AutoSplit-5.74-481.1.el9_6.noarch.rpm                                                                                                                          219 kB/s |  20 kB     00:00
(18/191): openblas-srpm-macros-2-11.el9.noarch.rpm                                                                                                                            4.4 kB/s | 8.3 kB     00:01
(19/191): perl-CPAN-2.29-5.el9_6.noarch.rpm                                                                                                                                   3.2 MB/s | 630 kB     00:00
(20/191): perl-Benchmark-1.23-481.1.el9_6.noarch.rpm                                                                                                                           13 kB/s |  25 kB     00:01
(21/191): dwz-0.16-1.el9.x86_64.rpm                                                                                                                                            21 kB/s | 139 kB     00:06
(22/191): perl-CPAN-Meta-Requirements-2.140-461.el9.noarch.rpm                                                                                                                370 kB/s |  38 kB     00:00
(23/191): perl-CPAN-Meta-YAML-0.018-461.el9.noarch.rpm                                                                                                                        326 kB/s |  31 kB     00:00
(24/191): perl-CPAN-Meta-2.150010-460.el9.noarch.rpm                                                                                                                          1.1 MB/s | 292 kB     00:00
(25/191): perl-Compress-Raw-Bzip2-2.101-5.el9.x86_64.rpm                                                                                                                      448 kB/s |  40 kB     00:00
(26/191): perl-Compress-Bzip2-2.28-5.el9.x86_64.rpm                                                                                                                           512 kB/s |  78 kB     00:00
(27/191): perl-Compress-Raw-Lzma-2.101-3.el9.x86_64.rpm                                                                                                                       1.2 MB/s |  57 kB     00:00
(28/191): perl-Config-Extensions-0.03-481.1.el9_6.noarch.rpm                                                                                                                  303 kB/s |  11 kB     00:00
(29/191): perl-Compress-Raw-Zlib-2.101-5.el9.x86_64.rpm                                                                                                                       604 kB/s |  66 kB     00:00
(30/191): perl-Config-Perl-V-0.33-4.el9.noarch.rpm                                                                                                                            275 kB/s |  28 kB     00:00
(31/191): perl-DB_File-1.855-4.el9.x86_64.rpm                                                                                                                                 1.5 MB/s |  87 kB     00:00
(32/191): perl-DBM_Filter-0.06-481.1.el9_6.noarch.rpm                                                                                                                         374 kB/s |  43 kB     00:00
(33/191): perl-Data-Section-0.200007-14.el9.noarch.rpm                                                                                                                        714 kB/s |  30 kB     00:00
(34/191): perl-Devel-PPPort-3.62-4.el9.x86_64.rpm                                                                                                                             3.1 MB/s | 220 kB     00:00
(35/191): perl-CPAN-DistnameInfo-0.12-23.el9.noarch.rpm                                                                                                                       8.0 kB/s |  15 kB     00:01
(36/191): perl-Devel-SelfStubber-1.06-481.1.el9_6.noarch.rpm                                                                                                                  336 kB/s |  13 kB     00:00
(37/191): perl-Devel-Size-0.83-10.el9.x86_64.rpm                                                                                                                              814 kB/s |  32 kB     00:00
(38/191): perl-Devel-Peek-1.28-481.1.el9_6.x86_64.rpm                                                                                                                         349 kB/s |  30 kB     00:00
(39/191): perl-Digest-SHA1-2.13-34.el9.x86_64.rpm                                                                                                                             1.3 MB/s |  60 kB     00:00
(40/191): perl-Digest-SHA-6.02-461.el9.x86_64.rpm                                                                                                                             852 kB/s |  70 kB     00:00
(41/191): perl-DirHandle-1.05-481.1.el9_6.noarch.rpm                                                                                                                          269 kB/s |  11 kB     00:00
(42/191): perl-Dumpvalue-2.27-481.1.el9_6.noarch.rpm                                                                                                                          446 kB/s |  17 kB     00:00
(43/191): perl-Encode-Locale-1.05-21.el9.noarch.rpm                                                                                                                           500 kB/s |  20 kB     00:00
(44/191): perl-English-1.11-481.1.el9_6.noarch.rpm                                                                                                                            422 kB/s |  12 kB     00:00
(45/191): perl-Encode-devel-3.08-462.el9.x86_64.rpm                                                                                                                           783 kB/s |  51 kB     00:00
(46/191): perl-Env-1.04-460.el9.noarch.rpm                                                                                                                                    606 kB/s |  25 kB     00:00
(47/191): perl-ExtUtils-CBuilder-0.280236-4.el9.noarch.rpm                                                                                                                    1.5 MB/s |  69 kB     00:00
(48/191): perl-ExtUtils-Command-7.60-3.el9.noarch.rpm                                                                                                                         374 kB/s |  15 kB     00:00
(49/191): perl-ExtUtils-Constant-0.25-481.1.el9_6.noarch.rpm                                                                                                                  1.2 MB/s |  55 kB     00:00
(50/191): perl-ExtUtils-Embed-1.35-481.1.el9_6.noarch.rpm                                                                                                                     433 kB/s |  16 kB     00:00
(51/191): perl-ExtUtils-Install-2.20-4.el9.noarch.rpm                                                                                                                         1.1 MB/s |  53 kB     00:00
(52/191): perl-ExtUtils-MakeMaker-7.60-3.el9.noarch.rpm                                                                                                                       1.7 MB/s | 352 kB     00:00
(53/191): perl-ExtUtils-Manifest-1.73-4.el9.noarch.rpm                                                                                                                        1.0 MB/s |  40 kB     00:00
(54/191): perl-ExtUtils-Miniperl-1.09-481.1.el9_6.noarch.rpm                                                                                                                  373 kB/s |  14 kB     00:00
(55/191): perl-ExtUtils-ParseXS-3.40-460.el9.noarch.rpm                                                                                                                       572 kB/s | 212 kB     00:00
(56/191): perl-File-Compare-1.100.600-481.1.el9_6.noarch.rpm                                                                                                                  139 kB/s |  12 kB     00:00
(57/191): perl-File-Copy-2.34-481.1.el9_6.noarch.rpm                                                                                                                          395 kB/s |  19 kB     00:00
(58/191): perl-File-DosGlob-1.12-481.1.el9_6.x86_64.rpm                                                                                                                       151 kB/s |  18 kB     00:00
(59/191): perl-File-Fetch-1.00-4.el9.noarch.rpm                                                                                                                               730 kB/s |  31 kB     00:00
(60/191): perl-File-HomeDir-1.006-4.el9.noarch.rpm                                                                                                                            1.8 MB/s |  81 kB     00:00
(61/191): perl-Data-OptList-0.110-17.el9.noarch.rpm                                                                                                                            19 kB/s |  36 kB     00:01
(62/191): perl-FileCache-1.10-481.1.el9_6.noarch.rpm                                                                                                                          365 kB/s |  13 kB     00:00
(63/191): perl-Filter-1.60-4.el9.x86_64.rpm                                                                                                                                   2.4 MB/s | 121 kB     00:00
(64/191): perl-Filter-Simple-0.96-460.el9.noarch.rpm                                                                                                                          200 kB/s |  28 kB     00:00
(65/191): perl-FindBin-1.51-481.1.el9_6.noarch.rpm                                                                                                                            111 kB/s |  12 kB     00:00
(66/191): perl-GDBM_File-1.18-481.1.el9_6.x86_64.rpm                                                                                                                          164 kB/s |  21 kB     00:00
(67/191): perl-ExtUtils-MM-Utils-7.60-3.el9.noarch.rpm                                                                                                                        6.9 kB/s |  13 kB     00:01
(68/191): perl-Hash-Util-0.23-481.1.el9_6.x86_64.rpm                                                                                                                          344 kB/s |  33 kB     00:00
(69/191): perl-I18N-Collate-1.02-481.1.el9_6.noarch.rpm                                                                                                                       287 kB/s |  13 kB     00:00
(70/191): perl-Hash-Util-FieldHash-1.20-481.1.el9_6.x86_64.rpm                                                                                                                275 kB/s |  36 kB     00:00
(71/191): perl-I18N-LangTags-0.44-481.1.el9_6.noarch.rpm                                                                                                                      1.3 MB/s |  59 kB     00:00
(72/191): perl-I18N-Langinfo-0.19-481.1.el9_6.x86_64.rpm                                                                                                                      475 kB/s |  21 kB     00:00
(73/191): perl-IO-Compress-Lzma-2.101-4.el9.noarch.rpm                                                                                                                        2.0 MB/s | 101 kB     00:00
(74/191): perl-IO-Zlib-1.11-4.el9.noarch.rpm                                                                                                                                  487 kB/s |  20 kB     00:00
(75/191): perl-IPC-Cmd-1.04-461.el9.noarch.rpm                                                                                                                                895 kB/s |  40 kB     00:00
(76/191): perl-IO-Compress-2.102-4.el9.noarch.rpm                                                                                                                             2.1 MB/s | 321 kB     00:00
(77/191): perl-IPC-SysV-2.09-4.el9.x86_64.rpm                                                                                                                                 625 kB/s |  55 kB     00:00
(78/191): perl-IPC-System-Simple-1.30-6.el9.noarch.rpm                                                                                                                        431 kB/s |  46 kB     00:00
(79/191): perl-Importer-0.026-4.el9.noarch.rpm                                                                                                                                475 kB/s |  45 kB     00:00
(80/191): perl-JSON-PP-4.06-4.el9.noarch.rpm                                                                                                                                  862 kB/s |  74 kB     00:00
(81/191): perl-Locale-Maketext-1.29-461.el9.noarch.rpm                                                                                                                        2.3 MB/s | 108 kB     00:00
(82/191): perl-Locale-Maketext-Simple-0.21-481.1.el9_6.noarch.rpm                                                                                                             237 kB/s |  16 kB     00:00
(83/191): perl-MRO-Compat-0.13-15.el9.noarch.rpm                                                                                                                              701 kB/s |  27 kB     00:00
(84/191): perl-MIME-Charset-1.012.2-15.el9.noarch.rpm                                                                                                                         679 kB/s |  60 kB     00:00
(85/191): perl-Math-BigRat-0.2614-460.el9.noarch.rpm                                                                                                                          743 kB/s |  46 kB     00:00
(86/191): perl-Math-BigInt-FastCalc-0.500.900-460.el9.x86_64.rpm                                                                                                              418 kB/s |  35 kB     00:00
(87/191): perl-Memoize-1.03-481.1.el9_6.noarch.rpm                                                                                                                            2.0 MB/s |  72 kB     00:00
(88/191): perl-Module-CoreList-5.20240609-1.el9.noarch.rpm                                                                                                                    802 kB/s |  95 kB     00:00
(89/191): perl-Module-Build-0.42.31-9.el9.noarch.rpm                                                                                                                          1.8 MB/s | 305 kB     00:00
(90/191): perl-Module-Load-0.36-4.el9.noarch.rpm                                                                                                                              495 kB/s |  18 kB     00:00
(91/191): perl-Module-CoreList-tools-5.20240609-1.el9.noarch.rpm                                                                                                              182 kB/s |  16 kB     00:00
(92/191): perl-Module-Loaded-0.08-481.1.el9_6.noarch.rpm                                                                                                                      305 kB/s |  12 kB     00:00
(93/191): perl-Module-Load-Conditional-0.74-4.el9.noarch.rpm                                                                                                                  229 kB/s |  23 kB     00:00
(94/191): perl-Module-Metadata-1.000037-460.el9.noarch.rpm                                                                                                                    461 kB/s |  42 kB     00:00
(95/191): perl-File-Which-1.23-10.el9.noarch.rpm                                                                                                                               12 kB/s |  22 kB     00:01
(96/191): perl-NEXT-0.67-481.1.el9_6.noarch.rpm                                                                                                                               473 kB/s |  19 kB     00:00
(97/191): perl-Net-1.02-481.1.el9_6.noarch.rpm                                                                                                                                796 kB/s |  33 kB     00:00
(98/191): perl-Module-Signature-0.88-1.el9.noarch.rpm                                                                                                                         706 kB/s |  95 kB     00:00
(99/191): perl-Object-HashBase-0.009-7.el9.noarch.rpm                                                                                                                         787 kB/s |  31 kB     00:00
(100/191): perl-Net-Ping-2.74-5.el9.noarch.rpm                                                                                                                                439 kB/s |  55 kB     00:00
(101/191): perl-ODBM_File-1.16-481.1.el9_6.x86_64.rpm                                                                                                                         175 kB/s |  21 kB     00:00
(102/191): perl-Params-Check-0.38-461.el9.noarch.rpm                                                                                                                          535 kB/s |  23 kB     00:00
(103/191): perl-Opcode-1.48-481.1.el9_6.x86_64.rpm                                                                                                                            353 kB/s |  40 kB     00:00
(104/191): perl-Package-Generator-1.106-23.el9.noarch.rpm                                                                                                                     253 kB/s |  31 kB     00:00
(105/191): perl-Perl-OSType-1.010-461.el9.noarch.rpm                                                                                                                          376 kB/s |  29 kB     00:00
(106/191): perl-Pod-Checker-1.74-4.el9.noarch.rpm                                                                                                                             961 kB/s |  38 kB     00:00
(107/191): perl-PerlIO-via-QuotedPrint-0.09-4.el9.noarch.rpm                                                                                                                  332 kB/s |  29 kB     00:00
(108/191): perl-Pod-Html-1.25-481.1.el9_6.noarch.rpm                                                                                                                          633 kB/s |  31 kB     00:00
(109/191): perl-Pod-Functions-1.13-481.1.el9_6.noarch.rpm                                                                                                                     148 kB/s |  12 kB     00:00
(110/191): perl-Search-Dict-1.07-481.1.el9_6.noarch.rpm                                                                                                                       307 kB/s |  11 kB     00:00
(111/191): perl-Safe-2.41-481.1.el9_6.noarch.rpm                                                                                                                              493 kB/s |  23 kB     00:00
(112/191): perl-SelfLoader-1.26-481.1.el9_6.noarch.rpm                                                                                                                        368 kB/s |  20 kB     00:00
(113/191): perl-Software-License-0.103014-12.el9.noarch.rpm                                                                                                                   2.9 MB/s | 196 kB     00:00
(114/191): perl-Sub-Install-0.928-28.el9.noarch.rpm                                                                                                                           556 kB/s |  28 kB     00:00
(115/191): perl-Sys-Hostname-1.23-481.1.el9_6.x86_64.rpm                                                                                                                      499 kB/s |  15 kB     00:00
(116/191): perl-Sub-Exporter-0.987-27.el9.noarch.rpm                                                                                                                          975 kB/s | 103 kB     00:00
(117/191): perl-Term-Complete-1.403-481.1.el9_6.noarch.rpm                                                                                                                    308 kB/s |  11 kB     00:00
(118/191): perl-Sys-Syslog-0.36-461.el9.x86_64.rpm                                                                                                                            1.0 MB/s |  54 kB     00:00
(119/191): perl-Term-ReadLine-1.17-481.1.el9_6.noarch.rpm                                                                                                                     465 kB/s |  17 kB     00:00
(120/191): perl-Term-Size-Perl-0.031-12.el9.x86_64.rpm                                                                                                                        573 kB/s |  28 kB     00:00
(121/191): perl-Params-Util-1.102-5.el9.x86_64.rpm                                                                                                                             22 kB/s |  41 kB     00:01
(122/191): perl-Term-Size-Any-0.002-35.el9.noarch.rpm                                                                                                                         9.7 kB/s |  19 kB     00:01
(123/191): perl-Test-1.31-481.1.el9_6.noarch.rpm                                                                                                                              702 kB/s |  27 kB     00:00
(124/191): perl-Term-Table-0.015-8.el9.noarch.rpm                                                                                                                              26 kB/s |  50 kB     00:01
(125/191): perl-Test-Harness-3.42-461.el9.noarch.rpm                                                                                                                          4.7 MB/s | 387 kB     00:00
(126/191): perl-Text-Abbrev-1.02-481.1.el9_6.noarch.rpm                                                                                                                       223 kB/s |  11 kB     00:00
(127/191): perl-Text-Balanced-2.04-4.el9.noarch.rpm                                                                                                                           548 kB/s |  53 kB     00:00
(128/191): perl-Test-Simple-1.302183-4.el9.noarch.rpm                                                                                                                         3.6 MB/s | 949 kB     00:00
(129/191): perl-Text-Diff-1.45-13.el9.noarch.rpm                                                                                                                              919 kB/s |  50 kB     00:00
(130/191): perl-Text-Template-1.59-5.el9.noarch.rpm                                                                                                                           1.0 MB/s |  66 kB     00:00
(131/191): perl-Text-Glob-0.11-15.el9.noarch.rpm                                                                                                                              167 kB/s |  14 kB     00:00
(132/191): perl-Thread-3.05-481.1.el9_6.noarch.rpm                                                                                                                            185 kB/s |  16 kB     00:00
(133/191): perl-Thread-Semaphore-2.13-481.1.el9_6.noarch.rpm                                                                                                                  201 kB/s |  14 kB     00:00
(134/191): perl-Tie-4.6-481.1.el9_6.noarch.rpm                                                                                                                                414 kB/s |  41 kB     00:00
(135/191): perl-Tie-File-1.06-481.1.el9_6.noarch.rpm                                                                                                                          903 kB/s |  42 kB     00:00
(136/191): perl-Tie-Memoize-1.1-481.1.el9_6.noarch.rpm                                                                                                                        133 kB/s |  13 kB     00:00
(137/191): perl-Tie-RefHash-1.40-4.el9.noarch.rpm                                                                                                                             737 kB/s |  29 kB     00:00
(138/191): perl-Time-1.03-481.1.el9_6.noarch.rpm                                                                                                                              804 kB/s |  24 kB     00:00
(139/191): perl-Time-HiRes-1.9764-462.el9.x86_64.rpm                                                                                                                          1.9 MB/s |  64 kB     00:00
(140/191): perl-Time-Piece-1.3401-481.1.el9_6.x86_64.rpm                                                                                                                      796 kB/s |  45 kB     00:00
(141/191): perl-Unicode-Collate-1.29-4.el9.x86_64.rpm                                                                                                                         6.8 MB/s | 849 kB     00:00
(142/191): perl-Unicode-LineBreak-2019.001-11.el9.x86_64.rpm                                                                                                                  1.5 MB/s | 144 kB     00:00
(143/191): perl-Unicode-Normalize-1.27-461.el9.x86_64.rpm                                                                                                                     683 kB/s |  96 kB     00:00
(144/191): perl-TermReadKey-2.38-11.el9.x86_64.rpm                                                                                                                             22 kB/s |  42 kB     00:01
(145/191): perl-Unicode-UCD-0.75-481.1.el9_6.noarch.rpm                                                                                                                       1.2 MB/s |  77 kB     00:00
(146/191): perl-User-pwent-1.03-481.1.el9_6.noarch.rpm                                                                                                                        242 kB/s |  24 kB     00:00
(147/191): perl-autodie-2.34-4.el9.noarch.rpm                                                                                                                                 1.1 MB/s | 117 kB     00:00
(148/191): perl-bignum-0.51-460.el9.noarch.rpm                                                                                                                                1.1 MB/s |  56 kB     00:00
(149/191): perl-blib-1.07-481.1.el9_6.noarch.rpm                                                                                                                              262 kB/s |  11 kB     00:00
(150/191): perl-autouse-1.11-481.1.el9_6.noarch.rpm                                                                                                                            70 kB/s |  12 kB     00:00
(151/191): perl-deprecate-0.04-481.1.el9_6.noarch.rpm                                                                                                                         163 kB/s |  13 kB     00:00
(152/191): perl-devel-5.32.1-481.1.el9_6.x86_64.rpm                                                                                                                           6.2 MB/s | 748 kB     00:00
(153/191): perl-diagnostics-1.37-481.1.el9_6.noarch.rpm                                                                                                                       1.9 MB/s | 216 kB     00:00
(154/191): perl-Thread-Queue-3.14-460.el9.noarch.rpm                                                                                                                           14 kB/s |  28 kB     00:01
(155/191): perl-doc-5.32.1-481.1.el9_6.noarch.rpm                                                                                                                             9.1 MB/s | 4.9 MB     00:00
(156/191): perl-encoding-3.00-462.el9.x86_64.rpm                                                                                                                              349 kB/s |  68 kB     00:00
(157/191): perl-encoding-warnings-0.13-481.1.el9_6.noarch.rpm                                                                                                                 374 kB/s |  15 kB     00:00
(158/191): perl-experimental-0.022-6.el9.noarch.rpm                                                                                                                           667 kB/s |  27 kB     00:00
(159/191): perl-filetest-1.03-481.1.el9_6.noarch.rpm                                                                                                                          352 kB/s |  13 kB     00:00
(160/191): perl-inc-latest-0.500-20.el9.noarch.rpm                                                                                                                            768 kB/s |  31 kB     00:00
(161/191): perl-fields-2.27-481.1.el9_6.noarch.rpm                                                                                                                            162 kB/s |  15 kB     00:00
(162/191): perl-less-0.03-481.1.el9_6.noarch.rpm                                                                                                                              307 kB/s |  12 kB     00:00
(163/191): perl-lib-0.65-481.1.el9_6.x86_64.rpm                                                                                                                               208 kB/s |  13 kB     00:00
(164/191): perl-libnetcfg-5.32.1-481.1.el9_6.noarch.rpm                                                                                                                       403 kB/s |  15 kB     00:00
(165/191): perl-macros-5.32.1-481.1.el9_6.noarch.rpm                                                                                                                          261 kB/s | 9.2 kB     00:00
(166/191): perl-local-lib-2.000024-13.el9.noarch.rpm                                                                                                                          839 kB/s |  76 kB     00:00
(167/191): perl-meta-notation-5.32.1-481.1.el9_6.noarch.rpm                                                                                                                   102 kB/s | 8.2 kB     00:00
(168/191): perl-open-1.12-481.1.el9_6.noarch.rpm                                                                                                                              369 kB/s |  15 kB     00:00
(169/191): perl-ph-5.32.1-481.1.el9_6.x86_64.rpm                                                                                                                              745 kB/s |  67 kB     00:00
(170/191): perl-perlfaq-5.20210520-1.el9.noarch.rpm                                                                                                                           2.7 MB/s | 399 kB     00:00
(171/191): perl-sigtrap-1.09-481.1.el9_6.noarch.rpm                                                                                                                           299 kB/s |  14 kB     00:00
(172/191): perl-srpm-macros-1-41.el9.noarch.rpm                                                                                                                               110 kB/s | 9.1 kB     00:00
(173/191): perl-sort-2.04-481.1.el9_6.noarch.rpm                                                                                                                               98 kB/s |  12 kB     00:00
(174/191): perl-threads-2.25-460.el9.x86_64.rpm                                                                                                                               698 kB/s |  65 kB     00:00
(175/191): perl-threads-shared-1.61-460.el9.x86_64.rpm                                                                                                                        589 kB/s |  50 kB     00:00
(176/191): perl-utils-5.32.1-481.1.el9_6.noarch.rpm                                                                                                                           1.4 MB/s |  64 kB     00:00
(177/191): perl-version-0.99.28-4.el9.x86_64.rpm                                                                                                                              1.6 MB/s |  74 kB     00:00
(178/191): pyproject-srpm-macros-1.16.2-1.el9.noarch.rpm                                                                                                                      353 kB/s |  13 kB     00:00
(179/191): perl-vmsish-1.04-481.1.el9_6.noarch.rpm                                                                                                                            132 kB/s |  13 kB     00:00
(180/191): qt5-srpm-macros-5.15.9-1.el9.noarch.rpm                                                                                                                            208 kB/s | 7.7 kB     00:00
(181/191): redhat-rpm-config-210-1.0.1.el9.noarch.rpm                                                                                                                         2.0 MB/s | 101 kB     00:00
(182/191): perl-debugger-1.56-481.1.el9_6.noarch.rpm                                                                                                                           75 kB/s | 139 kB     00:01
(183/191): sombok-2.4.0-16.el9.x86_64.rpm                                                                                                                                     1.3 MB/s |  55 kB     00:00
(184/191): rust-srpm-macros-17-4.el9.noarch.rpm                                                                                                                               107 kB/s |  10 kB     00:00
(185/191): python-srpm-macros-3.9-54.el9.noarch.rpm                                                                                                                           8.2 kB/s |  16 kB     00:02
(186/191): libstdc++-11.5.0-11.0.2.el9.x86_64.rpm                                                                                                                             6.4 MB/s | 757 kB     00:00
(187/191): systemtap-sdt-devel-5.3-3.0.1.el9.x86_64.rpm                                                                                                                        39 kB/s |  76 kB     00:01
(188/191): perl-Errno-1.30-481.1.el9_6.x86_64.rpm                                                                                                                             366 kB/s |  13 kB     00:00
(189/191): perl-interpreter-5.32.1-481.1.el9_6.x86_64.rpm                                                                                                                     858 kB/s |  76 kB     00:00
(190/191): perl-libs-5.32.1-481.1.el9_6.x86_64.rpm                                                                                                                            8.5 MB/s | 2.7 MB     00:00
(191/191): systemtap-sdt-dtrace-5.3-3.0.1.el9.x86_64.rpm                                                                                                                       22 kB/s |  75 kB     00:03
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                         1.9 MB/s |  38 MB     00:20
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                      1/1
  Upgrading        : libstdc++-11.5.0-11.0.2.el9.x86_64                                                                                                                                                 1/195
  Installing       : perl-GDBM_File-1.18-481.1.el9_6.x86_64                                                                                                                                             2/195
  Installing       : perl-ODBM_File-1.16-481.1.el9_6.x86_64                                                                                                                                             3/195
  Upgrading        : perl-libs-4:5.32.1-481.1.el9_6.x86_64                                                                                                                                              4/195
  Installing       : perl-DB_File-1.855-4.el9.x86_64                                                                                                                                                    5/195
  Installing       : perl-version-7:0.99.28-4.el9.x86_64                                                                                                                                                6/195
  Installing       : perl-File-Copy-2.34-481.1.el9_6.noarch                                                                                                                                             7/195
  Installing       : perl-ExtUtils-Manifest-1:1.73-4.el9.noarch                                                                                                                                         8/195
  Installing       : perl-Time-HiRes-4:1.9764-462.el9.x86_64                                                                                                                                            9/195
  Installing       : perl-CPAN-Meta-Requirements-2.140-461.el9.noarch                                                                                                                                  10/195
  Installing       : perl-Compress-Raw-Zlib-2.101-5.el9.x86_64                                                                                                                                         11/195
  Installing       : perl-File-Compare-1.100.600-481.1.el9_6.noarch                                                                                                                                    12/195
  Installing       : perl-lib-0.65-481.1.el9_6.x86_64                                                                                                                                                  13/195
  Installing       : perl-threads-1:2.25-460.el9.x86_64                                                                                                                                                14/195
  Installing       : perl-threads-shared-1.61-460.el9.x86_64                                                                                                                                           15/195
  Installing       : perl-Module-CoreList-1:5.20240609-1.el9.noarch                                                                                                                                    16/195
  Installing       : perl-Module-Metadata-1.000037-460.el9.noarch                                                                                                                                      17/195
  Installing       : perl-Devel-Peek-1.28-481.1.el9_6.x86_64                                                                                                                                           18/195
  Installing       : perl-Filter-2:1.60-4.el9.x86_64                                                                                                                                                   19/195
  Installing       : perl-Module-Load-1:0.36-4.el9.noarch                                                                                                                                              20/195
  Installing       : perl-Perl-OSType-1.010-461.el9.noarch                                                                                                                                             21/195
  Installing       : perl-Term-ReadLine-1.17-481.1.el9_6.noarch                                                                                                                                        22/195
  Installing       : perl-Tie-4.6-481.1.el9_6.noarch                                                                                                                                                   23/195
  Installing       : perl-Unicode-Normalize-1.27-461.el9.x86_64                                                                                                                                        24/195
  Installing       : perl-doc-5.32.1-481.1.el9_6.noarch                                                                                                                                                25/195
  Upgrading        : perl-interpreter-4:5.32.1-481.1.el9_6.x86_64                                                                                                                                      26/195
  Installing       : perl-ExtUtils-ParseXS-1:3.40-460.el9.noarch                                                                                                                                       27/195
  Installing       : perl-JSON-PP-1:4.06-4.el9.noarch                                                                                                                                                  28/195
  Installing       : perl-Digest-SHA-1:6.02-461.el9.x86_64                                                                                                                                             29/195
  Installing       : perl-meta-notation-5.32.1-481.1.el9_6.noarch                                                                                                                                      30/195
  Installing       : perl-Pod-Html-1.25-481.1.el9_6.noarch                                                                                                                                             31/195
  Installing       : perl-encoding-4:3.00-462.el9.x86_64                                                                                                                                               32/195
  Installing       : perl-Dumpvalue-2.27-481.1.el9_6.noarch                                                                                                                                            33/195
  Installing       : perl-Net-Ping-2.74-5.el9.noarch                                                                                                                                                   34/195
  Installing       : perl-ExtUtils-Command-2:7.60-3.el9.noarch                                                                                                                                         35/195
  Installing       : perl-AutoSplit-5.74-481.1.el9_6.noarch                                                                                                                                            36/195
  Installing       : perl-Benchmark-1.23-481.1.el9_6.noarch                                                                                                                                            37/195
  Installing       : perl-Test-Harness-1:3.42-461.el9.noarch                                                                                                                                           38/195
  Installing       : perl-CPAN-Meta-YAML-0.018-461.el9.noarch                                                                                                                                          39/195
  Installing       : perl-CPAN-Meta-2.150010-460.el9.noarch                                                                                                                                            40/195
  Installing       : perl-Compress-Raw-Bzip2-2.101-5.el9.x86_64                                                                                                                                        41/195
  Installing       : perl-IO-Compress-2.102-4.el9.noarch                                                                                                                                               42/195
  Installing       : perl-IO-Zlib-1:1.11-4.el9.noarch                                                                                                                                                  43/195
  Installing       : perl-Devel-PPPort-3.62-4.el9.x86_64                                                                                                                                               44/195
  Installing       : perl-DirHandle-1.05-481.1.el9_6.noarch                                                                                                                                            45/195
  Installing       : perl-ExtUtils-Constant-0.25-481.1.el9_6.noarch                                                                                                                                    46/195
  Installing       : perl-ExtUtils-MM-Utils-2:7.60-3.el9.noarch                                                                                                                                        47/195
  Installing       : perl-Hash-Util-FieldHash-1.20-481.1.el9_6.x86_64                                                                                                                                  48/195
  Installing       : perl-Hash-Util-0.23-481.1.el9_6.x86_64                                                                                                                                            49/195
  Installing       : perl-I18N-LangTags-0.44-481.1.el9_6.noarch                                                                                                                                        50/195
  Installing       : perl-Locale-Maketext-1.29-461.el9.noarch                                                                                                                                          51/195
  Installing       : perl-Locale-Maketext-Simple-1:0.21-481.1.el9_6.noarch                                                                                                                             52/195
  Installing       : perl-Params-Check-1:0.38-461.el9.noarch                                                                                                                                           53/195
  Installing       : perl-Module-Load-Conditional-0.74-4.el9.noarch                                                                                                                                    54/195
  Installing       : perl-IPC-Cmd-2:1.04-461.el9.noarch                                                                                                                                                55/195
  Installing       : perl-I18N-Langinfo-0.19-481.1.el9_6.x86_64                                                                                                                                        56/195
  Installing       : perl-Math-BigRat-0.2614-460.el9.noarch                                                                                                                                            57/195
  Installing       : perl-Opcode-1.48-481.1.el9_6.x86_64                                                                                                                                               58/195
  Installing       : perl-Safe-2.41-481.1.el9_6.noarch                                                                                                                                                 59/195
  Installing       : perl-Params-Util-1.102-5.el9.x86_64                                                                                                                                               60/195
  Installing       : perl-SelfLoader-1.26-481.1.el9_6.noarch                                                                                                                                           61/195
  Installing       : perl-Sub-Install-0.928-28.el9.noarch                                                                                                                                              62/195
  Installing       : perl-Sys-Hostname-1.23-481.1.el9_6.x86_64                                                                                                                                         63/195
  Installing       : perl-TermReadKey-2.38-11.el9.x86_64                                                                                                                                               64/195
  Installing       : perl-Text-Balanced-2.04-4.el9.noarch                                                                                                                                              65/195
  Installing       : perl-Tie-RefHash-1.40-4.el9.noarch                                                                                                                                                66/195
  Installing       : perl-User-pwent-1.03-481.1.el9_6.noarch                                                                                                                                           67/195
  Installing       : perl-autouse-1.11-481.1.el9_6.noarch                                                                                                                                              68/195
  Upgrading        : perl-Errno-1.30-481.1.el9_6.x86_64                                                                                                                                                69/195
  Installing       : perl-Filter-Simple-0.96-460.el9.noarch                                                                                                                                            70/195
  Installing       : perl-Data-OptList-0.110-17.el9.noarch                                                                                                                                             71/195
  Installing       : perl-Devel-SelfStubber-1.06-481.1.el9_6.noarch                                                                                                                                    72/195
  Installing       : perl-bignum-0.51-460.el9.noarch                                                                                                                                                   73/195
  Installing       : perl-Encode-Locale-1.05-21.el9.noarch                                                                                                                                             74/195
  Installing       : perl-File-Fetch-1.00-4.el9.noarch                                                                                                                                                 75/195
  Installing       : perl-fields-2.27-481.1.el9_6.noarch                                                                                                                                               76/195
  Installing       : perl-DBM_Filter-0.06-481.1.el9_6.noarch                                                                                                                                           77/195
  Installing       : perl-open-1.12-481.1.el9_6.noarch                                                                                                                                                 78/195
  Installing       : perl-debugger-1.56-481.1.el9_6.noarch                                                                                                                                             79/195
  Installing       : perl-sigtrap-1.09-481.1.el9_6.noarch                                                                                                                                              80/195
  Installing       : kernel-srpm-macros-1.0-14.0.1.el9.noarch                                                                                                                                          81/195
  Installing       : perl-Archive-Zip-1.68-6.el9.noarch                                                                                                                                                82/195
  Installing       : perl-Module-CoreList-tools-1:5.20240609-1.el9.noarch                                                                                                                              83/195
  Installing       : perl-Pod-Checker-4:1.74-4.el9.noarch                                                                                                                                              84/195
  Installing       : perl-diagnostics-1.37-481.1.el9_6.noarch                                                                                                                                          85/195
  Installing       : perl-macros-4:5.32.1-481.1.el9_6.noarch                                                                                                                                           86/195
  Installing       : perl-utils-5.32.1-481.1.el9_6.noarch                                                                                                                                              87/195
  Installing       : perl-Unicode-Collate-1.29-4.el9.x86_64                                                                                                                                            88/195
  Installing       : perl-Unicode-UCD-0.75-481.1.el9_6.noarch                                                                                                                                          89/195
  Installing       : perl-Env-1.04-460.el9.noarch                                                                                                                                                      90/195
  Installing       : perl-Thread-3.05-481.1.el9_6.noarch                                                                                                                                               91/195
  Installing       : perl-Thread-Queue-3.14-460.el9.noarch                                                                                                                                             92/195
  Installing       : perl-Thread-Semaphore-2.13-481.1.el9_6.noarch                                                                                                                                     93/195
  Installing       : perl-experimental-0.022-6.el9.noarch                                                                                                                                              94/195
  Installing       : perl-Algorithm-Diff-1.2010-4.el9.noarch                                                                                                                                           95/195
  Installing       : perl-Text-Diff-1.45-13.el9.noarch                                                                                                                                                 96/195
  Installing       : perl-Attribute-Handlers-1.01-481.1.el9_6.noarch                                                                                                                                   97/195
  Installing       : perl-CPAN-DistnameInfo-0.12-23.el9.noarch                                                                                                                                         98/195
  Installing       : perl-Compress-Bzip2-2.28-5.el9.x86_64                                                                                                                                             99/195
  Installing       : perl-Compress-Raw-Lzma-2.101-3.el9.x86_64                                                                                                                                        100/195
  Installing       : perl-IO-Compress-Lzma-2.101-4.el9.noarch                                                                                                                                         101/195
  Installing       : perl-Archive-Tar-2.38-6.el9.noarch                                                                                                                                               102/195
  Installing       : perl-Config-Extensions-0.03-481.1.el9_6.noarch                                                                                                                                   103/195
  Installing       : perl-Config-Perl-V-0.33-4.el9.noarch                                                                                                                                             104/195
  Installing       : perl-Devel-Size-0.83-10.el9.x86_64                                                                                                                                               105/195
  Installing       : perl-Digest-SHA1-2.13-34.el9.x86_64                                                                                                                                              106/195
  Installing       : perl-Module-Signature-0.88-1.el9.noarch                                                                                                                                          107/195
  Installing       : perl-English-1.11-481.1.el9_6.noarch                                                                                                                                             108/195
  Installing       : perl-File-DosGlob-1.12-481.1.el9_6.x86_64                                                                                                                                        109/195
  Installing       : perl-File-Which-1.23-10.el9.noarch                                                                                                                                               110/195
  Installing       : perl-File-HomeDir-1.006-4.el9.noarch                                                                                                                                             111/195
  Installing       : perl-FileCache-1.10-481.1.el9_6.noarch                                                                                                                                           112/195
  Installing       : perl-FindBin-1.51-481.1.el9_6.noarch                                                                                                                                             113/195
  Installing       : perl-I18N-Collate-1.02-481.1.el9_6.noarch                                                                                                                                        114/195
  Installing       : perl-IPC-SysV-2.09-4.el9.x86_64                                                                                                                                                  115/195
  Installing       : perl-IPC-System-Simple-1.30-6.el9.noarch                                                                                                                                         116/195
  Installing       : perl-autodie-2.34-4.el9.noarch                                                                                                                                                   117/195
  Installing       : perl-Importer-0.026-4.el9.noarch                                                                                                                                                 118/195
  Installing       : perl-MIME-Charset-1.012.2-15.el9.noarch                                                                                                                                          119/195
  Installing       : perl-MRO-Compat-0.13-15.el9.noarch                                                                                                                                               120/195
  Installing       : perl-Math-BigInt-FastCalc-0.500.900-460.el9.x86_64                                                                                                                               121/195
  Installing       : perl-Memoize-1.03-481.1.el9_6.noarch                                                                                                                                             122/195
  Installing       : perl-Module-Loaded-1:0.08-481.1.el9_6.noarch                                                                                                                                     123/195
  Installing       : perl-NEXT-0.67-481.1.el9_6.noarch                                                                                                                                                124/195
  Installing       : perl-Net-1.02-481.1.el9_6.noarch                                                                                                                                                 125/195
  Installing       : perl-Object-HashBase-0.009-7.el9.noarch                                                                                                                                          126/195
  Installing       : perl-Package-Generator-1.106-23.el9.noarch                                                                                                                                       127/195
  Installing       : perl-Sub-Exporter-0.987-27.el9.noarch                                                                                                                                            128/195
  Installing       : perl-Data-Section-0.200007-14.el9.noarch                                                                                                                                         129/195
  Installing       : perl-PerlIO-via-QuotedPrint-0.09-4.el9.noarch                                                                                                                                    130/195
  Installing       : perl-Pod-Functions-1.13-481.1.el9_6.noarch                                                                                                                                       131/195
  Installing       : perl-Search-Dict-1.07-481.1.el9_6.noarch                                                                                                                                         132/195
  Installing       : perl-Sys-Syslog-0.36-461.el9.x86_64                                                                                                                                              133/195
  Installing       : perl-Term-Complete-1.403-481.1.el9_6.noarch                                                                                                                                      134/195
  Installing       : perl-Term-Size-Perl-0.031-12.el9.x86_64                                                                                                                                          135/195
  Installing       : perl-Term-Size-Any-0.002-35.el9.noarch                                                                                                                                           136/195
  Installing       : perl-Test-1.31-481.1.el9_6.noarch                                                                                                                                                137/195
  Installing       : perl-Text-Abbrev-1.02-481.1.el9_6.noarch                                                                                                                                         138/195
  Installing       : perl-Text-Glob-0.11-15.el9.noarch                                                                                                                                                139/195
  Installing       : perl-Text-Template-1.59-5.el9.noarch                                                                                                                                             140/195
  Installing       : perl-Software-License-0.103014-12.el9.noarch                                                                                                                                     141/195
  Installing       : perl-Tie-File-1.06-481.1.el9_6.noarch                                                                                                                                            142/195
  Installing       : perl-Tie-Memoize-1.1-481.1.el9_6.noarch                                                                                                                                          143/195
  Installing       : perl-Time-1.03-481.1.el9_6.noarch                                                                                                                                                144/195
  Installing       : perl-Time-Piece-1.3401-481.1.el9_6.x86_64                                                                                                                                        145/195
  Installing       : perl-blib-1.07-481.1.el9_6.noarch                                                                                                                                                146/195
  Installing       : perl-deprecate-0.04-481.1.el9_6.noarch                                                                                                                                           147/195
  Installing       : perl-encoding-warnings-0.13-481.1.el9_6.noarch                                                                                                                                   148/195
  Installing       : perl-filetest-1.03-481.1.el9_6.noarch                                                                                                                                            149/195
  Installing       : perl-less-0.03-481.1.el9_6.noarch                                                                                                                                                150/195
  Installing       : perl-local-lib-2.000024-13.el9.noarch                                                                                                                                            151/195
  Installing       : perl-perlfaq-5.20210520-1.el9.noarch                                                                                                                                             152/195
  Installing       : perl-ph-5.32.1-481.1.el9_6.x86_64                                                                                                                                                153/195
  Installing       : perl-sort-2.04-481.1.el9_6.noarch                                                                                                                                                154/195
  Installing       : perl-vmsish-1.04-481.1.el9_6.noarch                                                                                                                                              155/195
  Installing       : annobin-12.92-1.el9.x86_64                                                                                                                                                       156/195
  Installing       : gcc-plugin-annobin-11.5.0-11.0.2.el9.x86_64                                                                                                                                      157/195
  Installing       : libstdc++-devel-11.5.0-11.0.2.el9.x86_64                                                                                                                                         158/195
  Installing       : gcc-c++-11.5.0-11.0.2.el9.x86_64                                                                                                                                                 159/195
  Installing       : systemtap-sdt-dtrace-5.3-3.0.1.el9.x86_64                                                                                                                                        160/195
  Installing       : systemtap-sdt-devel-5.3-3.0.1.el9.x86_64                                                                                                                                         161/195
  Installing       : sombok-2.4.0-16.el9.x86_64                                                                                                                                                       162/195
  Installing       : perl-Unicode-LineBreak-2019.001-11.el9.x86_64                                                                                                                                    163/195
  Installing       : perl-Term-Table-0.015-8.el9.noarch                                                                                                                                               164/195
  Installing       : perl-Test-Simple-3:1.302183-4.el9.noarch                                                                                                                                         165/195
  Installing       : rust-srpm-macros-17-4.el9.noarch                                                                                                                                                 166/195
  Installing       : qt5-srpm-macros-5.15.9-1.el9.noarch                                                                                                                                              167/195
  Installing       : pyproject-srpm-macros-1.16.2-1.el9.noarch                                                                                                                                        168/195
  Installing       : perl-srpm-macros-1-41.el9.noarch                                                                                                                                                 169/195
  Installing       : openblas-srpm-macros-2-11.el9.noarch                                                                                                                                             170/195
  Installing       : ocaml-srpm-macros-6-6.el9.noarch                                                                                                                                                 171/195
  Installing       : lua-srpm-macros-1-6.el9.noarch                                                                                                                                                   172/195
  Installing       : ghc-srpm-macros-1.5.0-6.el9.noarch                                                                                                                                               173/195
  Installing       : efi-srpm-macros-6-4.0.1.el9.noarch                                                                                                                                               174/195
  Installing       : dwz-0.16-1.el9.x86_64                                                                                                                                                            175/195
  Installing       : fonts-srpm-macros-1:2.0.5-7.el9.1.noarch                                                                                                                                         176/195
  Installing       : go-srpm-macros-3.6.0-14.el9_7.noarch                                                                                                                                             177/195
  Installing       : python-srpm-macros-3.9-54.el9.noarch                                                                                                                                             178/195
  Installing       : redhat-rpm-config-210-1.0.1.el9.noarch                                                                                                                                           179/195
  Running scriptlet: redhat-rpm-config-210-1.0.1.el9.noarch                                                                                                                                           179/195
  Installing       : perl-ExtUtils-Install-2.20-4.el9.noarch                                                                                                                                          180/195
  Installing       : perl-devel-4:5.32.1-481.1.el9_6.x86_64                                                                                                                                           181/195
  Installing       : perl-ExtUtils-MakeMaker-2:7.60-3.el9.noarch                                                                                                                                      182/195
  Installing       : perl-ExtUtils-CBuilder-1:0.280236-4.el9.noarch                                                                                                                                   183/195
  Installing       : perl-ExtUtils-Embed-1.35-481.1.el9_6.noarch                                                                                                                                      184/195
  Installing       : perl-ExtUtils-Miniperl-1.09-481.1.el9_6.noarch                                                                                                                                   185/195
  Installing       : perl-libnetcfg-4:5.32.1-481.1.el9_6.noarch                                                                                                                                       186/195
  Installing       : perl-Encode-devel-4:3.08-462.el9.x86_64                                                                                                                                          187/195
  Installing       : perl-inc-latest-2:0.500-20.el9.noarch                                                                                                                                            188/195
  Installing       : perl-Module-Build-2:0.42.31-9.el9.noarch                                                                                                                                         189/195
  Installing       : perl-CPAN-2.29-5.el9_6.noarch                                                                                                                                                    190/195
  Installing       : perl-4:5.32.1-481.1.el9_6.x86_64                                                                                                                                                 191/195
  Cleanup          : perl-Errno-1.30-481.el9.x86_64                                                                                                                                                   192/195
  Cleanup          : perl-interpreter-4:5.32.1-481.el9.x86_64                                                                                                                                         193/195
  Cleanup          : perl-libs-4:5.32.1-481.el9.x86_64                                                                                                                                                194/195
  Cleanup          : libstdc++-11.5.0-5.0.1.el9.x86_64                                                                                                                                                195/195
  Running scriptlet: libstdc++-11.5.0-5.0.1.el9.x86_64                                                                                                                                                195/195
  Verifying        : annobin-12.92-1.el9.x86_64                                                                                                                                                         1/195
  Verifying        : dwz-0.16-1.el9.x86_64                                                                                                                                                              2/195
  Verifying        : efi-srpm-macros-6-4.0.1.el9.noarch                                                                                                                                                 3/195
  Verifying        : fonts-srpm-macros-1:2.0.5-7.el9.1.noarch                                                                                                                                           4/195
  Verifying        : gcc-c++-11.5.0-11.0.2.el9.x86_64                                                                                                                                                   5/195
  Verifying        : gcc-plugin-annobin-11.5.0-11.0.2.el9.x86_64                                                                                                                                        6/195
  Verifying        : ghc-srpm-macros-1.5.0-6.el9.noarch                                                                                                                                                 7/195
  Verifying        : go-srpm-macros-3.6.0-14.el9_7.noarch                                                                                                                                               8/195
  Verifying        : kernel-srpm-macros-1.0-14.0.1.el9.noarch                                                                                                                                           9/195
  Verifying        : libstdc++-devel-11.5.0-11.0.2.el9.x86_64                                                                                                                                          10/195
  Verifying        : lua-srpm-macros-1-6.el9.noarch                                                                                                                                                    11/195
  Verifying        : ocaml-srpm-macros-6-6.el9.noarch                                                                                                                                                  12/195
  Verifying        : openblas-srpm-macros-2-11.el9.noarch                                                                                                                                              13/195
  Verifying        : perl-4:5.32.1-481.1.el9_6.x86_64                                                                                                                                                  14/195
  Verifying        : perl-Algorithm-Diff-1.2010-4.el9.noarch                                                                                                                                           15/195
  Verifying        : perl-Archive-Tar-2.38-6.el9.noarch                                                                                                                                                16/195
  Verifying        : perl-Archive-Zip-1.68-6.el9.noarch                                                                                                                                                17/195
  Verifying        : perl-Attribute-Handlers-1.01-481.1.el9_6.noarch                                                                                                                                   18/195
  Verifying        : perl-AutoSplit-5.74-481.1.el9_6.noarch                                                                                                                                            19/195
  Verifying        : perl-Benchmark-1.23-481.1.el9_6.noarch                                                                                                                                            20/195
  Verifying        : perl-CPAN-2.29-5.el9_6.noarch                                                                                                                                                     21/195
  Verifying        : perl-CPAN-DistnameInfo-0.12-23.el9.noarch                                                                                                                                         22/195
  Verifying        : perl-CPAN-Meta-2.150010-460.el9.noarch                                                                                                                                            23/195
  Verifying        : perl-CPAN-Meta-Requirements-2.140-461.el9.noarch                                                                                                                                  24/195
  Verifying        : perl-CPAN-Meta-YAML-0.018-461.el9.noarch                                                                                                                                          25/195
  Verifying        : perl-Compress-Bzip2-2.28-5.el9.x86_64                                                                                                                                             26/195
  Verifying        : perl-Compress-Raw-Bzip2-2.101-5.el9.x86_64                                                                                                                                        27/195
  Verifying        : perl-Compress-Raw-Lzma-2.101-3.el9.x86_64                                                                                                                                         28/195
  Verifying        : perl-Compress-Raw-Zlib-2.101-5.el9.x86_64                                                                                                                                         29/195
  Verifying        : perl-Config-Extensions-0.03-481.1.el9_6.noarch                                                                                                                                    30/195
  Verifying        : perl-Config-Perl-V-0.33-4.el9.noarch                                                                                                                                              31/195
  Verifying        : perl-DBM_Filter-0.06-481.1.el9_6.noarch                                                                                                                                           32/195
  Verifying        : perl-DB_File-1.855-4.el9.x86_64                                                                                                                                                   33/195
  Verifying        : perl-Data-OptList-0.110-17.el9.noarch                                                                                                                                             34/195
  Verifying        : perl-Data-Section-0.200007-14.el9.noarch                                                                                                                                          35/195
  Verifying        : perl-Devel-PPPort-3.62-4.el9.x86_64                                                                                                                                               36/195
  Verifying        : perl-Devel-Peek-1.28-481.1.el9_6.x86_64                                                                                                                                           37/195
  Verifying        : perl-Devel-SelfStubber-1.06-481.1.el9_6.noarch                                                                                                                                    38/195
  Verifying        : perl-Devel-Size-0.83-10.el9.x86_64                                                                                                                                                39/195
  Verifying        : perl-Digest-SHA-1:6.02-461.el9.x86_64                                                                                                                                             40/195
  Verifying        : perl-Digest-SHA1-2.13-34.el9.x86_64                                                                                                                                               41/195
  Verifying        : perl-DirHandle-1.05-481.1.el9_6.noarch                                                                                                                                            42/195
  Verifying        : perl-Dumpvalue-2.27-481.1.el9_6.noarch                                                                                                                                            43/195
  Verifying        : perl-Encode-Locale-1.05-21.el9.noarch                                                                                                                                             44/195
  Verifying        : perl-Encode-devel-4:3.08-462.el9.x86_64                                                                                                                                           45/195
  Verifying        : perl-English-1.11-481.1.el9_6.noarch                                                                                                                                              46/195
  Verifying        : perl-Env-1.04-460.el9.noarch                                                                                                                                                      47/195
  Verifying        : perl-ExtUtils-CBuilder-1:0.280236-4.el9.noarch                                                                                                                                    48/195
  Verifying        : perl-ExtUtils-Command-2:7.60-3.el9.noarch                                                                                                                                         49/195
  Verifying        : perl-ExtUtils-Constant-0.25-481.1.el9_6.noarch                                                                                                                                    50/195
  Verifying        : perl-ExtUtils-Embed-1.35-481.1.el9_6.noarch                                                                                                                                       51/195
  Verifying        : perl-ExtUtils-Install-2.20-4.el9.noarch                                                                                                                                           52/195
  Verifying        : perl-ExtUtils-MM-Utils-2:7.60-3.el9.noarch                                                                                                                                        53/195
  Verifying        : perl-ExtUtils-MakeMaker-2:7.60-3.el9.noarch                                                                                                                                       54/195
  Verifying        : perl-ExtUtils-Manifest-1:1.73-4.el9.noarch                                                                                                                                        55/195
  Verifying        : perl-ExtUtils-Miniperl-1.09-481.1.el9_6.noarch                                                                                                                                    56/195
  Verifying        : perl-ExtUtils-ParseXS-1:3.40-460.el9.noarch                                                                                                                                       57/195
  Verifying        : perl-File-Compare-1.100.600-481.1.el9_6.noarch                                                                                                                                    58/195
  Verifying        : perl-File-Copy-2.34-481.1.el9_6.noarch                                                                                                                                            59/195
  Verifying        : perl-File-DosGlob-1.12-481.1.el9_6.x86_64                                                                                                                                         60/195
  Verifying        : perl-File-Fetch-1.00-4.el9.noarch                                                                                                                                                 61/195
  Verifying        : perl-File-HomeDir-1.006-4.el9.noarch                                                                                                                                              62/195
  Verifying        : perl-File-Which-1.23-10.el9.noarch                                                                                                                                                63/195
  Verifying        : perl-FileCache-1.10-481.1.el9_6.noarch                                                                                                                                            64/195
  Verifying        : perl-Filter-2:1.60-4.el9.x86_64                                                                                                                                                   65/195
  Verifying        : perl-Filter-Simple-0.96-460.el9.noarch                                                                                                                                            66/195
  Verifying        : perl-FindBin-1.51-481.1.el9_6.noarch                                                                                                                                              67/195
  Verifying        : perl-GDBM_File-1.18-481.1.el9_6.x86_64                                                                                                                                            68/195
  Verifying        : perl-Hash-Util-0.23-481.1.el9_6.x86_64                                                                                                                                            69/195
  Verifying        : perl-Hash-Util-FieldHash-1.20-481.1.el9_6.x86_64                                                                                                                                  70/195
  Verifying        : perl-I18N-Collate-1.02-481.1.el9_6.noarch                                                                                                                                         71/195
  Verifying        : perl-I18N-LangTags-0.44-481.1.el9_6.noarch                                                                                                                                        72/195
  Verifying        : perl-I18N-Langinfo-0.19-481.1.el9_6.x86_64                                                                                                                                        73/195
  Verifying        : perl-IO-Compress-2.102-4.el9.noarch                                                                                                                                               74/195
  Verifying        : perl-IO-Compress-Lzma-2.101-4.el9.noarch                                                                                                                                          75/195
  Verifying        : perl-IO-Zlib-1:1.11-4.el9.noarch                                                                                                                                                  76/195
  Verifying        : perl-IPC-Cmd-2:1.04-461.el9.noarch                                                                                                                                                77/195
  Verifying        : perl-IPC-SysV-2.09-4.el9.x86_64                                                                                                                                                   78/195
  Verifying        : perl-IPC-System-Simple-1.30-6.el9.noarch                                                                                                                                          79/195
  Verifying        : perl-Importer-0.026-4.el9.noarch                                                                                                                                                  80/195
  Verifying        : perl-JSON-PP-1:4.06-4.el9.noarch                                                                                                                                                  81/195
  Verifying        : perl-Locale-Maketext-1.29-461.el9.noarch                                                                                                                                          82/195
  Verifying        : perl-Locale-Maketext-Simple-1:0.21-481.1.el9_6.noarch                                                                                                                             83/195
  Verifying        : perl-MIME-Charset-1.012.2-15.el9.noarch                                                                                                                                           84/195
  Verifying        : perl-MRO-Compat-0.13-15.el9.noarch                                                                                                                                                85/195
  Verifying        : perl-Math-BigInt-FastCalc-0.500.900-460.el9.x86_64                                                                                                                                86/195
  Verifying        : perl-Math-BigRat-0.2614-460.el9.noarch                                                                                                                                            87/195
  Verifying        : perl-Memoize-1.03-481.1.el9_6.noarch                                                                                                                                              88/195
  Verifying        : perl-Module-Build-2:0.42.31-9.el9.noarch                                                                                                                                          89/195
  Verifying        : perl-Module-CoreList-1:5.20240609-1.el9.noarch                                                                                                                                    90/195
  Verifying        : perl-Module-CoreList-tools-1:5.20240609-1.el9.noarch                                                                                                                              91/195
  Verifying        : perl-Module-Load-1:0.36-4.el9.noarch                                                                                                                                              92/195
  Verifying        : perl-Module-Load-Conditional-0.74-4.el9.noarch                                                                                                                                    93/195
  Verifying        : perl-Module-Loaded-1:0.08-481.1.el9_6.noarch                                                                                                                                      94/195
  Verifying        : perl-Module-Metadata-1.000037-460.el9.noarch                                                                                                                                      95/195
  Verifying        : perl-Module-Signature-0.88-1.el9.noarch                                                                                                                                           96/195
  Verifying        : perl-NEXT-0.67-481.1.el9_6.noarch                                                                                                                                                 97/195
  Verifying        : perl-Net-1.02-481.1.el9_6.noarch                                                                                                                                                  98/195
  Verifying        : perl-Net-Ping-2.74-5.el9.noarch                                                                                                                                                   99/195
  Verifying        : perl-ODBM_File-1.16-481.1.el9_6.x86_64                                                                                                                                           100/195
  Verifying        : perl-Object-HashBase-0.009-7.el9.noarch                                                                                                                                          101/195
  Verifying        : perl-Opcode-1.48-481.1.el9_6.x86_64                                                                                                                                              102/195
  Verifying        : perl-Package-Generator-1.106-23.el9.noarch                                                                                                                                       103/195
  Verifying        : perl-Params-Check-1:0.38-461.el9.noarch                                                                                                                                          104/195
  Verifying        : perl-Params-Util-1.102-5.el9.x86_64                                                                                                                                              105/195
  Verifying        : perl-Perl-OSType-1.010-461.el9.noarch                                                                                                                                            106/195
  Verifying        : perl-PerlIO-via-QuotedPrint-0.09-4.el9.noarch                                                                                                                                    107/195
  Verifying        : perl-Pod-Checker-4:1.74-4.el9.noarch                                                                                                                                             108/195
  Verifying        : perl-Pod-Functions-1.13-481.1.el9_6.noarch                                                                                                                                       109/195
  Verifying        : perl-Pod-Html-1.25-481.1.el9_6.noarch                                                                                                                                            110/195
  Verifying        : perl-Safe-2.41-481.1.el9_6.noarch                                                                                                                                                111/195
  Verifying        : perl-Search-Dict-1.07-481.1.el9_6.noarch                                                                                                                                         112/195
  Verifying        : perl-SelfLoader-1.26-481.1.el9_6.noarch                                                                                                                                          113/195
  Verifying        : perl-Software-License-0.103014-12.el9.noarch                                                                                                                                     114/195
  Verifying        : perl-Sub-Exporter-0.987-27.el9.noarch                                                                                                                                            115/195
  Verifying        : perl-Sub-Install-0.928-28.el9.noarch                                                                                                                                             116/195
  Verifying        : perl-Sys-Hostname-1.23-481.1.el9_6.x86_64                                                                                                                                        117/195
  Verifying        : perl-Sys-Syslog-0.36-461.el9.x86_64                                                                                                                                              118/195
  Verifying        : perl-Term-Complete-1.403-481.1.el9_6.noarch                                                                                                                                      119/195
  Verifying        : perl-Term-ReadLine-1.17-481.1.el9_6.noarch                                                                                                                                       120/195
  Verifying        : perl-Term-Size-Any-0.002-35.el9.noarch                                                                                                                                           121/195
  Verifying        : perl-Term-Size-Perl-0.031-12.el9.x86_64                                                                                                                                          122/195
  Verifying        : perl-Term-Table-0.015-8.el9.noarch                                                                                                                                               123/195
  Verifying        : perl-TermReadKey-2.38-11.el9.x86_64                                                                                                                                              124/195
  Verifying        : perl-Test-1.31-481.1.el9_6.noarch                                                                                                                                                125/195
  Verifying        : perl-Test-Harness-1:3.42-461.el9.noarch                                                                                                                                          126/195
  Verifying        : perl-Test-Simple-3:1.302183-4.el9.noarch                                                                                                                                         127/195
  Verifying        : perl-Text-Abbrev-1.02-481.1.el9_6.noarch                                                                                                                                         128/195
  Verifying        : perl-Text-Balanced-2.04-4.el9.noarch                                                                                                                                             129/195
  Verifying        : perl-Text-Diff-1.45-13.el9.noarch                                                                                                                                                130/195
  Verifying        : perl-Text-Glob-0.11-15.el9.noarch                                                                                                                                                131/195
  Verifying        : perl-Text-Template-1.59-5.el9.noarch                                                                                                                                             132/195
  Verifying        : perl-Thread-3.05-481.1.el9_6.noarch                                                                                                                                              133/195
  Verifying        : perl-Thread-Queue-3.14-460.el9.noarch                                                                                                                                            134/195
  Verifying        : perl-Thread-Semaphore-2.13-481.1.el9_6.noarch                                                                                                                                    135/195
  Verifying        : perl-Tie-4.6-481.1.el9_6.noarch                                                                                                                                                  136/195
  Verifying        : perl-Tie-File-1.06-481.1.el9_6.noarch                                                                                                                                            137/195
  Verifying        : perl-Tie-Memoize-1.1-481.1.el9_6.noarch                                                                                                                                          138/195
  Verifying        : perl-Tie-RefHash-1.40-4.el9.noarch                                                                                                                                               139/195
  Verifying        : perl-Time-1.03-481.1.el9_6.noarch                                                                                                                                                140/195
  Verifying        : perl-Time-HiRes-4:1.9764-462.el9.x86_64                                                                                                                                          141/195
  Verifying        : perl-Time-Piece-1.3401-481.1.el9_6.x86_64                                                                                                                                        142/195
  Verifying        : perl-Unicode-Collate-1.29-4.el9.x86_64                                                                                                                                           143/195
  Verifying        : perl-Unicode-LineBreak-2019.001-11.el9.x86_64                                                                                                                                    144/195
  Verifying        : perl-Unicode-Normalize-1.27-461.el9.x86_64                                                                                                                                       145/195
  Verifying        : perl-Unicode-UCD-0.75-481.1.el9_6.noarch                                                                                                                                         146/195
  Verifying        : perl-User-pwent-1.03-481.1.el9_6.noarch                                                                                                                                          147/195
  Verifying        : perl-autodie-2.34-4.el9.noarch                                                                                                                                                   148/195
  Verifying        : perl-autouse-1.11-481.1.el9_6.noarch                                                                                                                                             149/195
  Verifying        : perl-bignum-0.51-460.el9.noarch                                                                                                                                                  150/195
  Verifying        : perl-blib-1.07-481.1.el9_6.noarch                                                                                                                                                151/195
  Verifying        : perl-debugger-1.56-481.1.el9_6.noarch                                                                                                                                            152/195
  Verifying        : perl-deprecate-0.04-481.1.el9_6.noarch                                                                                                                                           153/195
  Verifying        : perl-devel-4:5.32.1-481.1.el9_6.x86_64                                                                                                                                           154/195
  Verifying        : perl-diagnostics-1.37-481.1.el9_6.noarch                                                                                                                                         155/195
  Verifying        : perl-doc-5.32.1-481.1.el9_6.noarch                                                                                                                                               156/195
  Verifying        : perl-encoding-4:3.00-462.el9.x86_64                                                                                                                                              157/195
  Verifying        : perl-encoding-warnings-0.13-481.1.el9_6.noarch                                                                                                                                   158/195
  Verifying        : perl-experimental-0.022-6.el9.noarch                                                                                                                                             159/195
  Verifying        : perl-fields-2.27-481.1.el9_6.noarch                                                                                                                                              160/195
  Verifying        : perl-filetest-1.03-481.1.el9_6.noarch                                                                                                                                            161/195
  Verifying        : perl-inc-latest-2:0.500-20.el9.noarch                                                                                                                                            162/195
  Verifying        : perl-less-0.03-481.1.el9_6.noarch                                                                                                                                                163/195
  Verifying        : perl-lib-0.65-481.1.el9_6.x86_64                                                                                                                                                 164/195
  Verifying        : perl-libnetcfg-4:5.32.1-481.1.el9_6.noarch                                                                                                                                       165/195
  Verifying        : perl-local-lib-2.000024-13.el9.noarch                                                                                                                                            166/195
  Verifying        : perl-macros-4:5.32.1-481.1.el9_6.noarch                                                                                                                                          167/195
  Verifying        : perl-meta-notation-5.32.1-481.1.el9_6.noarch                                                                                                                                     168/195
  Verifying        : perl-open-1.12-481.1.el9_6.noarch                                                                                                                                                169/195
  Verifying        : perl-perlfaq-5.20210520-1.el9.noarch                                                                                                                                             170/195
  Verifying        : perl-ph-5.32.1-481.1.el9_6.x86_64                                                                                                                                                171/195
  Verifying        : perl-sigtrap-1.09-481.1.el9_6.noarch                                                                                                                                             172/195
  Verifying        : perl-sort-2.04-481.1.el9_6.noarch                                                                                                                                                173/195
  Verifying        : perl-srpm-macros-1-41.el9.noarch                                                                                                                                                 174/195
  Verifying        : perl-threads-1:2.25-460.el9.x86_64                                                                                                                                               175/195
  Verifying        : perl-threads-shared-1.61-460.el9.x86_64                                                                                                                                          176/195
  Verifying        : perl-utils-5.32.1-481.1.el9_6.noarch                                                                                                                                             177/195
  Verifying        : perl-version-7:0.99.28-4.el9.x86_64                                                                                                                                              178/195
  Verifying        : perl-vmsish-1.04-481.1.el9_6.noarch                                                                                                                                              179/195
  Verifying        : pyproject-srpm-macros-1.16.2-1.el9.noarch                                                                                                                                        180/195
  Verifying        : python-srpm-macros-3.9-54.el9.noarch                                                                                                                                             181/195
  Verifying        : qt5-srpm-macros-5.15.9-1.el9.noarch                                                                                                                                              182/195
  Verifying        : redhat-rpm-config-210-1.0.1.el9.noarch                                                                                                                                           183/195
  Verifying        : rust-srpm-macros-17-4.el9.noarch                                                                                                                                                 184/195
  Verifying        : sombok-2.4.0-16.el9.x86_64                                                                                                                                                       185/195
  Verifying        : systemtap-sdt-devel-5.3-3.0.1.el9.x86_64                                                                                                                                         186/195
  Verifying        : systemtap-sdt-dtrace-5.3-3.0.1.el9.x86_64                                                                                                                                        187/195
  Verifying        : libstdc++-11.5.0-11.0.2.el9.x86_64                                                                                                                                               188/195
  Verifying        : libstdc++-11.5.0-5.0.1.el9.x86_64                                                                                                                                                189/195
  Verifying        : perl-Errno-1.30-481.1.el9_6.x86_64                                                                                                                                               190/195
  Verifying        : perl-Errno-1.30-481.el9.x86_64                                                                                                                                                   191/195
  Verifying        : perl-interpreter-4:5.32.1-481.1.el9_6.x86_64                                                                                                                                     192/195
  Verifying        : perl-interpreter-4:5.32.1-481.el9.x86_64                                                                                                                                         193/195
  Verifying        : perl-libs-4:5.32.1-481.1.el9_6.x86_64                                                                                                                                            194/195
  Verifying        : perl-libs-4:5.32.1-481.el9.x86_64                                                                                                                                                195/195

Upgraded:
  libstdc++-11.5.0-11.0.2.el9.x86_64              perl-Errno-1.30-481.1.el9_6.x86_64              perl-interpreter-4:5.32.1-481.1.el9_6.x86_64              perl-libs-4:5.32.1-481.1.el9_6.x86_64
Installed:
  annobin-12.92-1.el9.x86_64                      dwz-0.16-1.el9.x86_64                               efi-srpm-macros-6-4.0.1.el9.noarch                     fonts-srpm-macros-1:2.0.5-7.el9.1.noarch
  gcc-c++-11.5.0-11.0.2.el9.x86_64                gcc-plugin-annobin-11.5.0-11.0.2.el9.x86_64         ghc-srpm-macros-1.5.0-6.el9.noarch                     go-srpm-macros-3.6.0-14.el9_7.noarch
  kernel-srpm-macros-1.0-14.0.1.el9.noarch        libstdc++-devel-11.5.0-11.0.2.el9.x86_64            lua-srpm-macros-1-6.el9.noarch                         ocaml-srpm-macros-6-6.el9.noarch
  openblas-srpm-macros-2-11.el9.noarch            perl-4:5.32.1-481.1.el9_6.x86_64                    perl-Algorithm-Diff-1.2010-4.el9.noarch                perl-Archive-Tar-2.38-6.el9.noarch
  perl-Archive-Zip-1.68-6.el9.noarch              perl-Attribute-Handlers-1.01-481.1.el9_6.noarch     perl-AutoSplit-5.74-481.1.el9_6.noarch                 perl-Benchmark-1.23-481.1.el9_6.noarch
  perl-CPAN-2.29-5.el9_6.noarch                   perl-CPAN-DistnameInfo-0.12-23.el9.noarch           perl-CPAN-Meta-2.150010-460.el9.noarch                 perl-CPAN-Meta-Requirements-2.140-461.el9.noarch
  perl-CPAN-Meta-YAML-0.018-461.el9.noarch        perl-Compress-Bzip2-2.28-5.el9.x86_64               perl-Compress-Raw-Bzip2-2.101-5.el9.x86_64             perl-Compress-Raw-Lzma-2.101-3.el9.x86_64
  perl-Compress-Raw-Zlib-2.101-5.el9.x86_64       perl-Config-Extensions-0.03-481.1.el9_6.noarch      perl-Config-Perl-V-0.33-4.el9.noarch                   perl-DBM_Filter-0.06-481.1.el9_6.noarch
  perl-DB_File-1.855-4.el9.x86_64                 perl-Data-OptList-0.110-17.el9.noarch               perl-Data-Section-0.200007-14.el9.noarch               perl-Devel-PPPort-3.62-4.el9.x86_64
  perl-Devel-Peek-1.28-481.1.el9_6.x86_64         perl-Devel-SelfStubber-1.06-481.1.el9_6.noarch      perl-Devel-Size-0.83-10.el9.x86_64                     perl-Digest-SHA-1:6.02-461.el9.x86_64
  perl-Digest-SHA1-2.13-34.el9.x86_64             perl-DirHandle-1.05-481.1.el9_6.noarch              perl-Dumpvalue-2.27-481.1.el9_6.noarch                 perl-Encode-Locale-1.05-21.el9.noarch
  perl-Encode-devel-4:3.08-462.el9.x86_64         perl-English-1.11-481.1.el9_6.noarch                perl-Env-1.04-460.el9.noarch                           perl-ExtUtils-CBuilder-1:0.280236-4.el9.noarch
  perl-ExtUtils-Command-2:7.60-3.el9.noarch       perl-ExtUtils-Constant-0.25-481.1.el9_6.noarch      perl-ExtUtils-Embed-1.35-481.1.el9_6.noarch            perl-ExtUtils-Install-2.20-4.el9.noarch
  perl-ExtUtils-MM-Utils-2:7.60-3.el9.noarch      perl-ExtUtils-MakeMaker-2:7.60-3.el9.noarch         perl-ExtUtils-Manifest-1:1.73-4.el9.noarch             perl-ExtUtils-Miniperl-1.09-481.1.el9_6.noarch
  perl-ExtUtils-ParseXS-1:3.40-460.el9.noarch     perl-File-Compare-1.100.600-481.1.el9_6.noarch      perl-File-Copy-2.34-481.1.el9_6.noarch                 perl-File-DosGlob-1.12-481.1.el9_6.x86_64
  perl-File-Fetch-1.00-4.el9.noarch               perl-File-HomeDir-1.006-4.el9.noarch                perl-File-Which-1.23-10.el9.noarch                     perl-FileCache-1.10-481.1.el9_6.noarch
  perl-Filter-2:1.60-4.el9.x86_64                 perl-Filter-Simple-0.96-460.el9.noarch              perl-FindBin-1.51-481.1.el9_6.noarch                   perl-GDBM_File-1.18-481.1.el9_6.x86_64
  perl-Hash-Util-0.23-481.1.el9_6.x86_64          perl-Hash-Util-FieldHash-1.20-481.1.el9_6.x86_64    perl-I18N-Collate-1.02-481.1.el9_6.noarch              perl-I18N-LangTags-0.44-481.1.el9_6.noarch
  perl-I18N-Langinfo-0.19-481.1.el9_6.x86_64      perl-IO-Compress-2.102-4.el9.noarch                 perl-IO-Compress-Lzma-2.101-4.el9.noarch               perl-IO-Zlib-1:1.11-4.el9.noarch
  perl-IPC-Cmd-2:1.04-461.el9.noarch              perl-IPC-SysV-2.09-4.el9.x86_64                     perl-IPC-System-Simple-1.30-6.el9.noarch               perl-Importer-0.026-4.el9.noarch
  perl-JSON-PP-1:4.06-4.el9.noarch                perl-Locale-Maketext-1.29-461.el9.noarch            perl-Locale-Maketext-Simple-1:0.21-481.1.el9_6.noarch  perl-MIME-Charset-1.012.2-15.el9.noarch
  perl-MRO-Compat-0.13-15.el9.noarch              perl-Math-BigInt-FastCalc-0.500.900-460.el9.x86_64  perl-Math-BigRat-0.2614-460.el9.noarch                 perl-Memoize-1.03-481.1.el9_6.noarch
  perl-Module-Build-2:0.42.31-9.el9.noarch        perl-Module-CoreList-1:5.20240609-1.el9.noarch      perl-Module-CoreList-tools-1:5.20240609-1.el9.noarch   perl-Module-Load-1:0.36-4.el9.noarch
  perl-Module-Load-Conditional-0.74-4.el9.noarch  perl-Module-Loaded-1:0.08-481.1.el9_6.noarch        perl-Module-Metadata-1.000037-460.el9.noarch           perl-Module-Signature-0.88-1.el9.noarch
  perl-NEXT-0.67-481.1.el9_6.noarch               perl-Net-1.02-481.1.el9_6.noarch                    perl-Net-Ping-2.74-5.el9.noarch                        perl-ODBM_File-1.16-481.1.el9_6.x86_64
  perl-Object-HashBase-0.009-7.el9.noarch         perl-Opcode-1.48-481.1.el9_6.x86_64                 perl-Package-Generator-1.106-23.el9.noarch             perl-Params-Check-1:0.38-461.el9.noarch
  perl-Params-Util-1.102-5.el9.x86_64             perl-Perl-OSType-1.010-461.el9.noarch               perl-PerlIO-via-QuotedPrint-0.09-4.el9.noarch          perl-Pod-Checker-4:1.74-4.el9.noarch
  perl-Pod-Functions-1.13-481.1.el9_6.noarch      perl-Pod-Html-1.25-481.1.el9_6.noarch               perl-Safe-2.41-481.1.el9_6.noarch                      perl-Search-Dict-1.07-481.1.el9_6.noarch
  perl-SelfLoader-1.26-481.1.el9_6.noarch         perl-Software-License-0.103014-12.el9.noarch        perl-Sub-Exporter-0.987-27.el9.noarch                  perl-Sub-Install-0.928-28.el9.noarch
  perl-Sys-Hostname-1.23-481.1.el9_6.x86_64       perl-Sys-Syslog-0.36-461.el9.x86_64                 perl-Term-Complete-1.403-481.1.el9_6.noarch            perl-Term-ReadLine-1.17-481.1.el9_6.noarch
  perl-Term-Size-Any-0.002-35.el9.noarch          perl-Term-Size-Perl-0.031-12.el9.x86_64             perl-Term-Table-0.015-8.el9.noarch                     perl-TermReadKey-2.38-11.el9.x86_64
  perl-Test-1.31-481.1.el9_6.noarch               perl-Test-Harness-1:3.42-461.el9.noarch             perl-Test-Simple-3:1.302183-4.el9.noarch               perl-Text-Abbrev-1.02-481.1.el9_6.noarch
  perl-Text-Balanced-2.04-4.el9.noarch            perl-Text-Diff-1.45-13.el9.noarch                   perl-Text-Glob-0.11-15.el9.noarch                      perl-Text-Template-1.59-5.el9.noarch
  perl-Thread-3.05-481.1.el9_6.noarch             perl-Thread-Queue-3.14-460.el9.noarch               perl-Thread-Semaphore-2.13-481.1.el9_6.noarch          perl-Tie-4.6-481.1.el9_6.noarch
  perl-Tie-File-1.06-481.1.el9_6.noarch           perl-Tie-Memoize-1.1-481.1.el9_6.noarch             perl-Tie-RefHash-1.40-4.el9.noarch                     perl-Time-1.03-481.1.el9_6.noarch
  perl-Time-HiRes-4:1.9764-462.el9.x86_64         perl-Time-Piece-1.3401-481.1.el9_6.x86_64           perl-Unicode-Collate-1.29-4.el9.x86_64                 perl-Unicode-LineBreak-2019.001-11.el9.x86_64
  perl-Unicode-Normalize-1.27-461.el9.x86_64      perl-Unicode-UCD-0.75-481.1.el9_6.noarch            perl-User-pwent-1.03-481.1.el9_6.noarch                perl-autodie-2.34-4.el9.noarch
  perl-autouse-1.11-481.1.el9_6.noarch            perl-bignum-0.51-460.el9.noarch                     perl-blib-1.07-481.1.el9_6.noarch                      perl-debugger-1.56-481.1.el9_6.noarch
  perl-deprecate-0.04-481.1.el9_6.noarch          perl-devel-4:5.32.1-481.1.el9_6.x86_64              perl-diagnostics-1.37-481.1.el9_6.noarch               perl-doc-5.32.1-481.1.el9_6.noarch
  perl-encoding-4:3.00-462.el9.x86_64             perl-encoding-warnings-0.13-481.1.el9_6.noarch      perl-experimental-0.022-6.el9.noarch                   perl-fields-2.27-481.1.el9_6.noarch
  perl-filetest-1.03-481.1.el9_6.noarch           perl-inc-latest-2:0.500-20.el9.noarch               perl-less-0.03-481.1.el9_6.noarch                      perl-lib-0.65-481.1.el9_6.x86_64
  perl-libnetcfg-4:5.32.1-481.1.el9_6.noarch      perl-local-lib-2.000024-13.el9.noarch               perl-macros-4:5.32.1-481.1.el9_6.noarch                perl-meta-notation-5.32.1-481.1.el9_6.noarch
  perl-open-1.12-481.1.el9_6.noarch               perl-perlfaq-5.20210520-1.el9.noarch                perl-ph-5.32.1-481.1.el9_6.x86_64                      perl-sigtrap-1.09-481.1.el9_6.noarch
  perl-sort-2.04-481.1.el9_6.noarch               perl-srpm-macros-1-41.el9.noarch                    perl-threads-1:2.25-460.el9.x86_64                     perl-threads-shared-1.61-460.el9.x86_64
  perl-utils-5.32.1-481.1.el9_6.noarch            perl-version-7:0.99.28-4.el9.x86_64                 perl-vmsish-1.04-481.1.el9_6.noarch                    pyproject-srpm-macros-1.16.2-1.el9.noarch
  python-srpm-macros-3.9-54.el9.noarch            qt5-srpm-macros-5.15.9-1.el9.noarch                 redhat-rpm-config-210-1.0.1.el9.noarch                 rust-srpm-macros-17-4.el9.noarch
  sombok-2.4.0-16.el9.x86_64                      systemtap-sdt-devel-5.3-3.0.1.el9.x86_64            systemtap-sdt-dtrace-5.3-3.0.1.el9.x86_64

Complete!
[root@pgdb01 postgresql-17.4]#

[root@pgdb01 postgresql-17.4]# make clean   <--- Cleanup due to error out
make -C doc clean
make[1]: Entering directory '/pg_Backup/stage/postgresql-17.4/doc'
make -C src clean
..
..
make[1]: Entering directory '/pg_Backup/stage/postgresql-17.4/config'
make[1]: Nothing to be done for 'clean'.
make[1]: Leaving directory '/pg_Backup/stage/postgresql-17.4/config'
rm -rf tmp_install/ portlock/
[root@pgdb01 postgresql-17.4]#

# Rerun make command
[root@pgdb01 postgresql-17.4]# make
make -C ./src/backend generated-headers
make[1]: Entering directory '/pg_Backup/stage/postgresql-17.4/src/backend'
make -C ../include/catalog generated-headers
make[2]: Entering directory '/pg_Backup/stage/postgresql-17.4/src/include/catalog'
..
..
port -L../../../src/common   -Wl,--as-needed -Wl,-rpath,'/pgbin/pgsql/17.4/lib',--enable-new-dtags  -lpgcommon -lpgport -lz -lreadline -lm  -o pg_isolation_regress
make[2]: Leaving directory '/pg_Backup/stage/postgresql-17.4/src/test/isolation'
make -C test/perl all
make[2]: Entering directory '/pg_Backup/stage/postgresql-17.4/src/test/perl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/pg_Backup/stage/postgresql-17.4/src/test/perl'
make[1]: Leaving directory '/pg_Backup/stage/postgresql-17.4/src'
make -C config all
make[1]: Entering directory '/pg_Backup/stage/postgresql-17.4/config'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/pg_Backup/stage/postgresql-17.4/config'
[root@pgdb01 postgresql-17.4]#

8. Install PostgreSQL

# Bin directory /pgbin/pgsql/17.4/ will get created by make install command. 

[root@pgdb01 postgresql-17.4]# make install
make -C ./src/backend generated-headers
make[1]: Entering directory '/pg_Backup/stage/postgresql-17.4/src/backend'
make -C ../include/catalog generated-headers
..
..
make -C config install
make[1]: Entering directory '/pg_Backup/stage/postgresql-17.4/config'
/usr/bin/mkdir -p '/pgbin/pgsql/17.4/lib/pgxs/config'
/usr/bin/install -c -m 755 ./install-sh '/pgbin/pgsql/17.4/lib/pgxs/config/install-sh'
/usr/bin/install -c -m 755 ./missing '/pgbin/pgsql/17.4/lib/pgxs/config/missing'
make[1]: Leaving directory '/pg_Backup/stage/postgresql-17.4/config'
[root@pgdb01 postgresql-17.4]#

[root@pgdb01 postgresql-17.4]# cd /pgbin/pgsql/17.4/
[root@pgdb01 17.4]# ll
total 16
drwxr-xr-x. 2 root root 4096 Apr 21 21:06 bin
drwxr-xr-x. 6 root root 4096 Apr 21 21:06 include
drwxr-xr-x. 4 root root 4096 Apr 21 21:06 lib
drwxr-xr-x. 6 root root 4096 Apr 21 21:06 share
[root@pgdb01 17.4]#

9. Install PostgreSQL Contrib for extensions

#Install Contrib

cd /pg_Backup/stage/postgresql-17.4
make -C contrib install

--- OR ----

cd /pg_Backup/stage/postgresql-17.4/contrib
make
make install

[root@pgdb01 ~]# cd /pg_Backup/stage/postgresql-17.4/contrib
[root@pgdb01 contrib]# make
..
..
make -C vacuumlo all
make[1]: Entering directory '/pg_Backup/stage/postgresql-17.4/contrib/vacuumlo'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -I../../src/interfaces/libpq -I. -I. -I../../src/include  -D_GNU_SOURCE   -c -o vacuumlo.o vacuumlo.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2  vacuumlo.o -L../../src/interfaces/libpq -lpq -L../../src/port -L../../src/common   -Wl,--as-needed -Wl,-rpath,'/pgbin/pgsql/17.4/lib',--enable-new-dtags   -lpgcommon -lpgport -lz -lreadline -lm  -o vacuumlo
make[1]: Leaving directory '/pg_Backup/stage/postgresql-17.4/contrib/vacuumlo'
[root@pgdb01 contrib]#

[root@pgdb01 contrib]# make install
..
..
make -C unaccent install
make[1]: Entering directory '/pg_Backup/stage/postgresql-17.4/contrib/unaccent'
/usr/bin/mkdir -p '/pgbin/pgsql/17.4/lib'
/usr/bin/mkdir -p '/pgbin/pgsql/17.4/share/extension'
/usr/bin/mkdir -p '/pgbin/pgsql/17.4/share/extension'
/usr/bin/mkdir -p '/pgbin/pgsql/17.4/share/tsearch_data'
/usr/bin/install -c -m 755  unaccent.so '/pgbin/pgsql/17.4/lib/unaccent.so'
/usr/bin/install -c -m 644 ./unaccent.control '/pgbin/pgsql/17.4/share/extension/'
/usr/bin/install -c -m 644 ./unaccent--1.1.sql ./unaccent--1.0--1.1.sql  '/pgbin/pgsql/17.4/share/extension/'
/usr/bin/install -c -m 644 ./unaccent.rules '/pgbin/pgsql/17.4/share/tsearch_data/'
make[1]: Leaving directory '/pg_Backup/stage/postgresql-17.4/contrib/unaccent'
make -C vacuumlo install
make[1]: Entering directory '/pg_Backup/stage/postgresql-17.4/contrib/vacuumlo'
/usr/bin/mkdir -p '/pgbin/pgsql/17.4/bin'
/usr/bin/install -c  vacuumlo '/pgbin/pgsql/17.4/bin'
make[1]: Leaving directory '/pg_Backup/stage/postgresql-17.4/contrib/vacuumlo'
[root@pgdb01 contrib]#

[root@pgdb01 contrib]# ls /pgbin/pgsql/17.4/share/extension
amcheck--1.0--1.1.sql     citext.control               hstore--1.5--1.6.sql       pageinspect--1.10--1.11.sql    pgrowlocks.control                  pg_visibility--1.0--1.1.sql
amcheck--1.0.sql          cube--1.0--1.1.sql           hstore--1.6--1.7.sql       pageinspect--1.11--1.12.sql    pg_stat_statements--1.0--1.1.sql    pg_visibility--1.1--1.2.sql
amcheck--1.1--1.2.sql     cube--1.1--1.2.sql           hstore--1.7--1.8.sql       pageinspect--1.1--1.2.sql      pg_stat_statements--1.10--1.11.sql  pg_visibility--1.1.sql
amcheck--1.2--1.3.sql     cube--1.2--1.3.sql           hstore.control             pageinspect--1.2--1.3.sql      pg_stat_statements--1.1--1.2.sql    pg_visibility.control
amcheck--1.3--1.4.sql     cube--1.2.sql                insert_username--1.0.sql   pageinspect--1.3--1.4.sql      pg_stat_statements--1.2--1.3.sql    pg_walinspect--1.0--1.1.sql
amcheck.control           cube--1.3--1.4.sql           insert_username.control    pageinspect--1.4--1.5.sql      pg_stat_statements--1.3--1.4.sql    pg_walinspect--1.0.sql
autoinc--1.0.sql          cube--1.4--1.5.sql           intagg--1.0--1.1.sql       pageinspect--1.5--1.6.sql      pg_stat_statements--1.4--1.5.sql    pg_walinspect.control
autoinc.control           cube.control                 intagg--1.1.sql            pageinspect--1.5.sql           pg_stat_statements--1.4.sql         plpgsql--1.0.sql
bloom--1.0.sql            dblink--1.0--1.1.sql         intagg.control             pageinspect--1.6--1.7.sql      pg_stat_statements--1.5--1.6.sql    plpgsql.control
bloom.control             dblink--1.1--1.2.sql         intarray--1.0--1.1.sql     pageinspect--1.7--1.8.sql      pg_stat_statements--1.6--1.7.sql    postgres_fdw--1.0--1.1.sql
btree_gin--1.0--1.1.sql   dblink--1.2.sql              intarray--1.1--1.2.sql     pageinspect--1.8--1.9.sql      pg_stat_statements--1.7--1.8.sql    postgres_fdw--1.0.sql
btree_gin--1.0.sql        dblink.control               intarray--1.2--1.3.sql     pageinspect--1.9--1.10.sql     pg_stat_statements--1.8--1.9.sql    postgres_fdw.control
btree_gin--1.1--1.2.sql   dict_int--1.0.sql            intarray--1.2.sql          pageinspect.control            pg_stat_statements--1.9--1.10.sql   refint--1.0.sql
btree_gin--1.2--1.3.sql   dict_int.control             intarray--1.3--1.4.sql     pg_buffercache--1.0--1.1.sql   pg_stat_statements.control          refint.control
btree_gin.control         dict_xsyn--1.0.sql           intarray--1.4--1.5.sql     pg_buffercache--1.1--1.2.sql   pgstattuple--1.0--1.1.sql           seg--1.0--1.1.sql
btree_gist--1.0--1.1.sql  dict_xsyn.control            intarray.control           pg_buffercache--1.2--1.3.sql   pgstattuple--1.1--1.2.sql           seg--1.1--1.2.sql
btree_gist--1.1--1.2.sql  earthdistance--1.0--1.1.sql  isn--1.0--1.1.sql          pg_buffercache--1.2.sql        pgstattuple--1.2--1.3.sql           seg--1.1.sql
btree_gist--1.2--1.3.sql  earthdistance--1.1--1.2.sql  isn--1.1--1.2.sql          pg_buffercache--1.3--1.4.sql   pgstattuple--1.3--1.4.sql           seg--1.2--1.3.sql
btree_gist--1.2.sql       earthdistance--1.1.sql       isn--1.1.sql               pg_buffercache--1.4--1.5.sql   pgstattuple--1.4--1.5.sql           seg--1.3--1.4.sql
btree_gist--1.3--1.4.sql  earthdistance.control        isn.control                pg_buffercache.control         pgstattuple--1.4.sql                seg.control
btree_gist--1.4--1.5.sql  file_fdw--1.0.sql            lo--1.0--1.1.sql           pg_freespacemap--1.0--1.1.sql  pgstattuple.control                 tablefunc--1.0.sql
btree_gist--1.5--1.6.sql  file_fdw.control             lo--1.1.sql                pg_freespacemap--1.1--1.2.sql  pg_surgery--1.0.sql                 tablefunc.control
btree_gist--1.6--1.7.sql  fuzzystrmatch--1.0--1.1.sql  lo.control                 pg_freespacemap--1.1.sql       pg_surgery.control                  tcn--1.0.sql
btree_gist.control        fuzzystrmatch--1.1--1.2.sql  ltree--1.0--1.1.sql        pg_freespacemap.control        pg_trgm--1.0--1.1.sql               tcn.control
citext--1.0--1.1.sql      fuzzystrmatch--1.1.sql       ltree--1.1--1.2.sql        pg_prewarm--1.0--1.1.sql       pg_trgm--1.1--1.2.sql               tsm_system_rows--1.0.sql
citext--1.1--1.2.sql      fuzzystrmatch.control        ltree--1.1.sql             pg_prewarm--1.1--1.2.sql       pg_trgm--1.2--1.3.sql               tsm_system_rows.control
citext--1.2--1.3.sql      hstore--1.1--1.2.sql         ltree--1.2--1.3.sql        pg_prewarm--1.1.sql            pg_trgm--1.3--1.4.sql               tsm_system_time--1.0.sql
citext--1.3--1.4.sql      hstore--1.2--1.3.sql         ltree.control              pg_prewarm.control             pg_trgm--1.3.sql                    tsm_system_time.control
citext--1.4--1.5.sql      hstore--1.3--1.4.sql         moddatetime--1.0.sql       pgrowlocks--1.0--1.1.sql       pg_trgm--1.4--1.5.sql               unaccent--1.0--1.1.sql
citext--1.4.sql           hstore--1.4--1.5.sql         moddatetime.control        pgrowlocks--1.1--1.2.sql       pg_trgm--1.5--1.6.sql               unaccent--1.1.sql
citext--1.5--1.6.sql      hstore--1.4.sql              pageinspect--1.0--1.1.sql  pgrowlocks--1.2.sql            pg_trgm.control                     unaccent.control
[root@pgdb01 contrib]# 

[root@pgdb01 contrib]# cd
[root@pgdb01 ~]# chown -R postgres:postgres /pgbin /pgData /pgWal /pgArch /pg_Backup
[root@pgdb01 ~]# chmod 700 /pgbin /pgData /pgWal /pgArch /pg_Backup
[root@pgdb01 ~]#

10. Set Environment Variables (As Postgres user)

# Switch to postgres user:

[root@pgdb01 17.4]# su - postgres
[postgres@pgdb01 ~]$

# Add below lines to .bash_profile and reload profile

export PGHOME=/pgbin/pgsql/17.4
export PATH=$PGHOME/bin:$PATH
export PGDATA=/pgData/pgsql/17.4

[postgres@pgdb01 ~]$ . .bash_profile
[postgres@pgdb01 ~]$
[postgres@pgdb01 ~]$ which psql
/pgbin/pgsql/17.4/bin/psql
[postgres@pgdb01 ~]$

11. Validation 1 (As Postgres user)

[postgres@pgdb01 ~]$ /pgbin/pgsql/17.4/bin/pg_config
BINDIR = /pgbin/pgsql/17.4/bin
DOCDIR = /pgbin/pgsql/17.4/share/doc
HTMLDIR = /pgbin/pgsql/17.4/share/doc
INCLUDEDIR = /pgbin/pgsql/17.4/include
PKGINCLUDEDIR = /pgbin/pgsql/17.4/include
INCLUDEDIR-SERVER = /pgbin/pgsql/17.4/include/server
LIBDIR = /pgbin/pgsql/17.4/lib
PKGLIBDIR = /pgbin/pgsql/17.4/lib
LOCALEDIR = /pgbin/pgsql/17.4/share/locale
MANDIR = /pgbin/pgsql/17.4/share/man
SHAREDIR = /pgbin/pgsql/17.4/share
SYSCONFDIR = /pgbin/pgsql/17.4/etc
PGXS = /pgbin/pgsql/17.4/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--prefix=/pgbin/pgsql/17.4' '--with-pgport=5432'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,--as-needed -Wl,-rpath,'/pgbin/pgsql/17.4/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lz -lreadline -lm
VERSION = PostgreSQL 17.4
[postgres@pgdb01 ~]$

12. Initialize Database (As Postgres user)

# Read more about initdb
https://www.br8dba.com/initdb-postgresql-cluster-initialization/

[postgres@pgdb01 ~]$ mkdir -p /pgData/pgsql/17.4 /pgWal/pgsql/17.4
[postgres@pgdb01 ~]$

[postgres@pgdb01 ~]$ /pgbin/pgsql/17.4/bin/initdb --pgdata=/pgData/pgsql/17.4 --waldir=/pgWal/pgsql/17.4 --wal-segsize=128
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_SG.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /pgData/pgsql/17.4 ... ok
fixing permissions on existing directory /pgWal/pgsql/17.4 ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 100
selecting default "shared_buffers" ... 128MB
selecting default time zone ... Asia/Singapore
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /pgbin/pgsql/17.4/bin/pg_ctl -D /pgData/pgsql/17.4 -l logfile start

[postgres@pgdb01 ~]$

13. Start Postgres Instance(As Postgres user)

[postgres@pgdb01 ~]$ /pgbin/pgsql/17.4/bin/pg_ctl -D /pgData/pgsql/17.4 -l logfile start
waiting for server to start.... done
server started
[postgres@pgdb01 ~]$

14. Validation (As Postgres user)

[postgres@pgdb01 ~]$ ps -ef | grep postgres
root       62627    3156  0 21:40 pts/0    00:00:00 su - postgres
postgres   62628   62627  0 21:40 pts/0    00:00:00 -bash
postgres 62707 1 0 21:50 ? 00:00:00 /pgbin/pgsql/17.4/bin/postgres -D /pgData/pgsql/17.4
postgres   62708   62707 0 21:50 ?        00:00:00 postgres: checkpointer
postgres   62709   62707 0 21:50 ?        00:00:00 postgres: background writer
postgres   62711   62707 0 21:50 ?        00:00:00 postgres: walwriter
postgres   62712   62707 0 21:50 ?        00:00:00 postgres: autovacuum launcher
postgres   62713   62707 0 21:50 ?        00:00:00 postgres: logical replication launcher
postgres   62715   62628 99 21:52 pts/0    00:00:00 ps -ef
postgres   62716   62628  0 21:52 pts/0    00:00:00 grep --color=auto postgres
[postgres@pgdb01 ~]$
[postgres@pgdb01 ~]$ psql -c "SELECT VERSION();"
                                                    version
---------------------------------------------------------------------------------------------------------------
 PostgreSQL 17.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-11.0.2), 64-bit
(1 row)

[postgres@pgdb01 ~]$
[postgres@pgdb01 ~]$ psql
psql (17.4)
Type "help" for help.

postgres=# \l
                                                     List of databases
   Name    |  Owner   | Encoding | Locale Provider |   Collate   |    Ctype    | Locale | ICU Rules |   Access privileges
-----------+----------+----------+-----------------+-------------+-------------+--------+-----------+-----------------------
 postgres | postgres | UTF8     | libc            | en_SG.UTF-8 | en_SG.UTF-8 |        |           |
 template0 | postgres | UTF8     | libc            | en_SG.UTF-8 | en_SG.UTF-8 |        |           | =c/postgres          +
           |          |          |                 |             |             |        |           | postgres=CTc/postgres
 template1 | postgres | UTF8     | libc            | en_SG.UTF-8 | en_SG.UTF-8 |        |           | =c/postgres          +
           |          |          |                 |             |             |        |           | postgres=CTc/postgres
(3 rows)

postgres=# \du
                             List of roles
 Role name |                         Attributes
-----------+------------------------------------------------------------
 postgres | Superuser, Create role, Create DB, Replication, Bypass RLS

postgres=#
postgres=# \q
[postgres@pgdb01 ~]$

15. Create systemctl service for PostgreSQL (as root user) - Optional 

# As root user

cat > /etc/systemd/system/postgresql-17.service <<'EOF'
[Unit]
Description=PostgreSQL 17 Database Server
Documentation=https://www.postgresql.org/docs/17/
After=network.target

[Service]
Type=forking

User=postgres
Group=postgres

# PostgreSQL Data Directory
Environment=PGDATA=/pgData/pgsql/17.4

# Start PostgreSQL
ExecStart=/pgbin/pgsql/17.4/bin/pg_ctl start -D ${PGDATA} -l ${PGDATA}/logfile

# Stop PostgreSQL
ExecStop=/pgbin/pgsql/17.4/bin/pg_ctl stop -D ${PGDATA} -m fast

# Reload PostgreSQL
ExecReload=/pgbin/pgsql/17.4/bin/pg_ctl reload -D ${PGDATA}

Restart=always
RestartSec=5

TimeoutSec=300

[Install]
WantedBy=multi-user.target
EOF
# Stop PostgreSQL as Postgres user using pg_ctl if running
# As postgres user
[postgres@pgdb02 ~]$ pg_ctl stop
waiting for server to shut down.... done
server stopped
[postgres@pgdb02 ~]$

# As root user 
# Enable PostgreSQL service at boot
[root@pgdb02 ~]# systemctl enable postgresql-17
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql-17.service → /etc/systemd/system/postgresql-17.service.
[root@pgdb02 ~]#

# As root user
# Start PostgreSQL service
[root@pgdb02 ~]# systemctl start postgresql-17
[root@pgdb02 ~]#

# As root user
# Verify Status
[root@pgdb02 ~]# systemctl status postgresql-17
● postgresql-17.service - PostgreSQL 17 Database Server
     Loaded: loaded (/etc/systemd/system/postgresql-17.service; enabled; preset: disabled)
     Active: active (running) since Sat 2026-06-20 16:08:44 +08; 16s ago
       Docs: https://www.postgresql.org/docs/17/
    Process: 3302 ExecStart=/pgbin/pgsql/17.4/bin/pg_ctl start -D ${PGDATA} -l ${PGDATA}/logfile (code=exited, status=0/SUCCESS)
   Main PID: 3305 (postgres)
      Tasks: 6 (limit: 15700)
     Memory: 21.4M
        CPU: 77ms
     CGroup: /system.slice/postgresql-17.service
             ├─3305 /pgbin/pgsql/17.4/bin/postgres -D /pgData/pgsql/17.4
             ├─3306 "postgres: checkpointer "
             ├─3307 "postgres: background writer "
             ├─3310 "postgres: walwriter "
             ├─3311 "postgres: autovacuum launcher "
             └─3312 "postgres: logical replication launcher "

Jun 20 16:08:43 pgdb02 systemd[1]: Starting PostgreSQL 17 Database Server...
Jun 20 16:08:44 pgdb02 pg_ctl[3302]: waiting for server to start.... done
Jun 20 16:08:44 pgdb02 pg_ctl[3302]: server started
Jun 20 16:08:44 pgdb02 systemd[1]: Started PostgreSQL 17 Database Server.
[root@pgdb02 ~]#
Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.Thank you, Rajasekhar Amudala Email: br8dba@gmail.com Linkedin: https://www.linkedin.com/in/rajasekhar-amudala/

PostgreSQL

PostgreSQL DBA Step by Step Learning

#PostgreSQL DBA Topics
1How to Install PostgreSQL ON Linux?
2How to Install PostgreSQL on Linux 7 using source code?
3How to START/STOP PostgreSQL ON Linux?
4How to Create Database in PostgreSQL?
5PostgreSQL User Management
6PostgreSQL pg_hba.conf Guide
7PostgreSQL Change Data Directory
8Understanding WAL Files in PostgreSQL – For Oracle DBAs
9Change PostgreSQL WAL Directory Path (pg_wal)
10Enable Archive Mode in PostgreSQL 17
11How to Disable ARCHIVELOG Mode
12PostgreSQL Tablespace Management
13PostgreSQL pg_dump and pg_restore Guide
14PostgreSQL Backup and Restore Using pg_dumpall and psql
15pg_basebackup – Backup, Restore, and Recovery
16Backup & Restore PostgreSQL DB Cluster to Another Host (No Archive Mode)
17Backup & Restore PostgreSQL DB Cluster on Same Host
18Restore PostgreSQL to New Host using pg_basebackup + WAL Archives
19PostgreSQL PITR – Point in Time Recovery
20Configure Streaming Replication in PostgreSQL
21Manual Failover in PostgreSQL Streaming Replication
22Convert Asynchronous Replication to Synchronous Replication

 

Thank you,
Rajasekhar Amudala
Email: br8dba@gmail.com
Linkedin: https://www.linkedin.com/in/rajasekhar-amudala/

Disable ARCHIVELOG Mode

How to Disable ARCHIVELOG Mode

Table of Contents


1. Verify Existing Archive Mode
2. Edit the archive settings
3. Restart PostgreSQL
4. Verify Current Mode
5. Verify WAL Archiving Behavior


1. Verify Existing Archive Mode

postgres=# SHOW archive_mode;
 archive_mode
--------------
 on  <------ 
(1 row)

postgres=#

postgres=# SHOW archive_command;
        archive_command
-------------------------------
 cp %p /pgArch/pgsql17/arch/%f  <----- 
(1 row)

postgres=#

2. Edit the archive settings


[postgres@lxicbpgdsgv01 ~]$ cp /pgData/pgsql17/data/postgresql.conf /pgData/pgsql17/data/postgresql.conf.bkp_10sep2025
[postgres@lxicbpgdsgv01 ~]$ vi /pgData/pgsql17/data/postgresql.conf

#archive_mode = on
#archive_command = 'cp %p /pgArch/pgsql17/arch/%f'

3. Restart PostgreSQL

[root@lxicbpgdsgv01 ~]# systemctl stop postgresql-17.service
[root@lxicbpgdsgv01 ~]#
[root@lxicbpgdsgv01 ~]# systemctl start  postgresql-17.service
[root@lxicbpgdsgv01 ~]#
[root@lxicbpgdsgv01 ~]# systemctl status postgresql-17.service
● postgresql-17.service - PostgreSQL 17 database server
     Loaded: loaded (/usr/lib/systemd/system/postgresql-17.service; enabled; preset: disabled)
     Active: active (running) since Thu 2025-10-09 16:34:01 +08; 3s ago
       Docs: https://www.postgresql.org/docs/17/static/
    Process: 3492 ExecStartPre=/usr/pgsql-17/bin/postgresql-17-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
   Main PID: 3497 (postgres)
      Tasks: 7 (limit: 15835)
     Memory: 17.6M
        CPU: 92ms
     CGroup: /system.slice/postgresql-17.service
             ├─3497 /usr/pgsql-17/bin/postgres -D /pgData/pgsql17/data/
             ├─3498 "postgres: logger "
             ├─3499 "postgres: checkpointer "
             ├─3500 "postgres: background writer "
             ├─3502 "postgres: walwriter "
             ├─3503 "postgres: autovacuum launcher "
             └─3504 "postgres: logical replication launcher "

Oct 09 16:34:01 lxicbpgdsgv01.rajasekhar.com systemd[1]: Starting PostgreSQL 17 database server...
Oct 09 16:34:01 lxicbpgdsgv01.rajasekhar.com postgres[3497]: 2025-10-09 16:34:01.929 +08 [3497] LOG:  redirecting log output to logging collector process
Oct 09 16:34:01 lxicbpgdsgv01.rajasekhar.com postgres[3497]: 2025-10-09 16:34:01.929 +08 [3497] HINT:  Future log output will appear in directory "log".
Oct 09 16:34:01 lxicbpgdsgv01.rajasekhar.com systemd[1]: Started PostgreSQL 17 database server.
[root@lxicbpgdsgv01 ~]#

4. Verify Current Mode

[postgres@lxicbpgdsgv01 ~]$ psql
psql (17.6)
Type "help" for help.

postgres=# SHOW archive_mode;
 archive_mode
--------------
 off  <------ it's disabled
(1 row)

postgres=# SHOW archive_command;
 archive_command
-----------------
 (disabled) <-------
(1 row)

postgres=#

5. Verify WAL Archiving Behavior


postgres=# CHECKPOINT;
CHECKPOINT
postgres=#
postgres=# CHECKPOINT;
CHECKPOINT
postgres=# CHECKPOINT;
CHECKPOINT
postgres=#
postgres=# exit
postgres=# SELECT pg_switch_wal();
 pg_switch_wal
---------------
 0/44000000
(1 row)

postgres=# SELECT pg_switch_wal();
 pg_switch_wal
---------------
 0/44000000
(1 row)

postgres=# SELECT pg_switch_wal();
 pg_switch_wal
---------------
 0/44000000
(1 row)

postgres=#
[postgres@lxicbpgdsgv01 ~]$ ls -ltr /pgArch/pgsql17/arch/
total 0  <---- Archivelogs not generating
[postgres@lxicbpgdsgv01 ~]$

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.

Thank you,
Rajasekhar Amudala
Email: br8dba@gmail.com
Linkedin: https://www.linkedin.com/in/rajasekhar-amudala/

PostgreSQL Tablespace

PostgreSQL Tablespace Management

Table of Contents

___________________________________________________________________________________________________

0. Introduction
1. How big can a PostgreSQL tablespace grow?
2. Create a Tablespace
3. Create a Database with default tablespace
4. Create Tables on Data tablspace
5. Crate Index on Index tablespaces
6. Create a Dedicated Tablespace for Temp
7. Assign Temp Tablespace to a Database
8. Check Tablespace OIDs
9. Move Table Between Tablespaces
10. Verify Database Directory (Filesystem)
11. Rename tablespace
12. Drop Tablespace
13. Change ownership for Tablespace
14. Verify Symbolic Links
15. How to find tablespace size
___________________________________________________________________________________________________


0. Introduction

What is a Tablespace?

--> Tablespace is a logical structure in which objects are stored.

--> A tablespace is simply a physical storage location on disk where PostgreSQL stores database objects (tables, indexes, etc.). 

--> By default database objects are stored in the current default tablespace of the database.

List tablespaces:

\db+ or select * from pg_tablespace;

 

Types of Tablespaces: Default Tablespaces and Non-Default Tablespaces
I. Default Tablespaces

These come built-in with PostgreSQL:

pg_global – for shared system data
pg_default – for regular user data (tables, indexes, etc.)
Featurepg_defaultpg_global
PurposeStores regular user dataStores global system data
Used by default?Yes, for tables/indexesNo, only used internally
Can store user tables?YesNo
Location$PGDATA/base/$PGDATA/global/
Droppable?NoNo
II. Non-Default Tablespaces :

--> These are created by users to store data in custom locations.
--> Useful for managing storage better (e.g., putting large tables on faster disks).


1. How big can a PostgreSQL tablespace grow?

There is no fixed maximum size for a tablespace in PostgreSQL itself.
The limit depends on your operating system and filesystem where the tablespace directory is located.

For example:

On modern filesystems like ext4 or XFS, a single file can be several terabytes (TB) or even petabytes (PB).
PostgreSQL breaks large tables into multiple files (each typically up to 1 GB) internally, so extremely large tablespaces are supported.
Your disk/storage capacity is the main practical limit.


2. Create a Tablespace

[root@pg17 ~]# mkdir -p /pgData/pgsql15/edbua_tbs01
[root@pg17 ~]# mkdir -p /pgData/pgsql15/edbua_tbs02
[root@pg17 ~]# mkdir -p /pgData/pgsql15/edbua_ixtbs01
[root@pg17 ~]# mkdir -p /pgData/pgsql15/edbua_temptbs01
[root@pg17 ~]# chown postgres:postgres /pgData/pgsql15/edbua*
[root@pg17 ~]# chmod 700 /pgData/pgsql15/edbua*
[root@pg17 ~]#

[root@pg17 ~]# su - postgres
[postgres@pg17 ~]$ psql
psql (15.13)
Type "help" for help.

postgres=# CREATE TABLESPACE edbua_tbs01 LOCATION '/pgData/pgsql15/edbua_tbs01';
CREATE TABLESPACE
postgres=# CREATE TABLESPACE edbua_tbs02 LOCATION '/pgData/pgsql15/edbua_tbs02';
CREATE TABLESPACE
postgres=# CREATE TABLESPACE edbua_ixtbs01 LOCATION '/pgData/pgsql15/edbua_ixtbs01';
CREATE TABLESPACE
postgres=# 


3. Create a Database with default tablespace

postgres=# CREATE DATABASE edbua TABLESPACE edbua_tbs01;
CREATE DATABASE
postgres=# 
postgres=# SELECT oid, datname, dattablespace, datistemplate, datdba FROM pg_database WHERE datname = 'edbua';
  oid  | datname | dattablespace | datistemplate | datdba
-------+---------+---------------+---------------+--------
 92666 | edbua   |         92662 | f             |     10
(1 row)

postgres=#


4. Create Tables on Data tablspace

postgres=# \c edbua
You are now connected to database "edbua" as user "postgres".
edbua=# CREATE TABLE emp01 (id int, name text) TABLESPACE edbua_tbs01;
CREATE TABLE
edbua=# CREATE TABLE emp02 (id int, name text) TABLESPACE edbua_tbs01;
CREATE TABLE
edbua=# CREATE TABLE emp03 (id int, name text) TABLESPACE edbua_tbs01;
CREATE TABLE
edbua=#


5. Create Index on Index tablespaces

edbua=# CREATE INDEX emp01_ix ON emp01(name) TABLESPACE edbua_ixtbs01;
CREATE INDEX
edbua=# CREATE INDEX emp02_ix ON emp02(name) TABLESPACE edbua_ixtbs01;
CREATE INDEX
edbua=# CREATE INDEX emp03_ix ON emp03(name) TABLESPACE edbua_ixtbs01;
CREATE INDEX
edbua=# SELECT c.oid, c.relname, c.relkind, t.spcname AS tablespace, c.relfilenode
edbua-# FROM pg_class c
edbua-# LEFT JOIN pg_tablespace t ON c.reltablespace = t.oid
edbua-# WHERE c.relname IN ('emp01','emp02','emp03','emp01_ix','emp02_ix','emp03_ix');
  oid  | relname  | relkind |  tablespace   | relfilenode
-------+----------+---------+---------------+-------------
 92685 | emp01    | r       |               |       92685
 92690 | emp02    | r       |               |       92690
 92695 | emp03    | r       |               |       92695
 92700 | emp01_ix | i       | edbua_ixtbs01 |       92700
 92701 | emp02_ix | i       | edbua_ixtbs01 |       92701
 92702 | emp03_ix | i       | edbua_ixtbs01 |       92702
(6 rows)

edbua=#

If a table or index is created in the database’s default tablespace, PostgreSQL does not explicitly record the tablespace in pg_class.reltablespace.

But when it’s created in a non-default tablespace, PostgreSQL records that tablespace OID in pg_class.reltablespace.

If you want to always see the tablespace name (even when it's the default)

edbua=# SELECT
edbua-#     c.oid,
edbua-#     c.relname,
edbua-#     c.relkind,
edbua-#     COALESCE(t1.spcname, t2.spcname) AS tablespace,
edbua-#     c.relfilenode
edbua-# FROM pg_class c
edbua-# LEFT JOIN pg_tablespace t1 ON c.reltablespace = t1.oid
edbua-# LEFT JOIN pg_database d ON d.datname = current_database()
edbua-# LEFT JOIN pg_tablespace t2 ON d.dattablespace = t2.oid
edbua-# WHERE c.relname IN ('emp01','emp02','emp03','emp01_ix','emp02_ix','emp03_ix');
  oid  | relname  | relkind |  tablespace   | relfilenode
-------+----------+---------+---------------+-------------
 92685 | emp01    | r       | edbua_tbs01   |       92685
 92690 | emp02    | r       | edbua_tbs01   |       92690
 92695 | emp03    | r       | edbua_tbs01   |       92695
 92700 | emp01_ix | i       | edbua_ixtbs01 |       92700
 92701 | emp02_ix | i       | edbua_ixtbs01 |       92701
 92702 | emp03_ix | i       | edbua_ixtbs01 |       92702
(6 rows)

edbua=#

pg_tblspc/<tbs_oid>/PG_15_<catalog_version>/<db_oid>/<relfilenode>

edbua=# SELECT relname, pg_relation_filepath(oid) AS filepath
edbua-# FROM pg_class
edbua-# WHERE relname IN ('emp01','emp02','emp03','emp01_ix','emp02_ix','emp03_ix');
 relname  |                  filepath
----------+---------------------------------------------
 emp01    | pg_tblspc/92662/PG_15_202209061/92666/92685
 emp02    | pg_tblspc/92662/PG_15_202209061/92666/92690
 emp03    | pg_tblspc/92662/PG_15_202209061/92666/92695
 emp01_ix | pg_tblspc/92664/PG_15_202209061/92666/92700
 emp02_ix | pg_tblspc/92664/PG_15_202209061/92666/92701
 emp03_ix | pg_tblspc/92664/PG_15_202209061/92666/92702
(6 rows)

edbua=#


6. Create a Dedicated Tablespace for Temp

postgres=# CREATE TABLESPACE edbua_temptbs01 LOCATION '/pgData/pgsql15/edbua_temptbs01';
CREATE TABLESPACE
postgres=#


7. Assign Temp Tablespace to a Database

postgres=# ALTER DATABASE edbua SET temp_tablespaces = edbua_temptbs01;
ALTER DATABASE
postgres=#

postgres=# \c edbua
You are now connected to database "edbua" as user "postgres".
edbua=# 

edbua=# CREATE TEMP TABLE emp_tmp (id int, name text);
CREATE TABLE
edbua=#
edbua=# SELECT c.oid, c.relname, t.spcname, pg_relation_filepath(c.oid)
edbua-# FROM pg_class c
edbua-# LEFT JOIN pg_tablespace t ON c.reltablespace = t.oid
edbua-# WHERE c.relname = 'emp_tmp';
  oid  | relname |     spcname     |              pg_relation_filepath
-------+---------+-----------------+------------------------------------------------
 92705 | emp_tmp | edbua_temptbs01 | pg_tblspc/92665/PG_15_202209061/92666/t4_92705
(1 row)

edbua=#

pg_tblspc/<tbs_oid>/PG_15_<catalog_version>/<db_oid>/<relfilenode>


8. Check Tablespace OIDs

edbua=# SELECT oid, spcname AS tablespace_name, pg_tablespace_location(oid) AS location FROM pg_tablespace ORDER BY oid;
  oid  | tablespace_name |            location
-------+-----------------+---------------------------------
  1663 | pg_default      |
  1664 | pg_global       |
 24581 | dell_ts_data    | /u01/data/dell_ts_data
 24582 | dell_ts_index   | /u01/data/dell_ts_index
 24594 | dell_tbs        | /pgData/pgsql15/data
 24597 | trd_tb01        | /pgData/pgsql15/data/trd_tb01
 24598 | trd_ix01        | /pgData/pgsql15/data/trd_ix01
 32787 | geb_tb          | /pgData/pgsql15/pgtb/geb_tb
 32788 | geb_ix          | /pgData/pgsql15/pgix/geb_ix
 92662 | edbua_tbs01     | /pgData/pgsql15/edbua_tbs01
 92663 | edbua_tbs02     | /pgData/pgsql15/edbua_tbs02
 92664 | edbua_ixtbs01   | /pgData/pgsql15/edbua_ixtbs01
 92665 | edbua_temptbs01 | /pgData/pgsql15/edbua_temptbs01
(13 rows)

edbua=#


9. Move Table Between Tablespaces

edbua=# ALTER TABLE emp01 SET TABLESPACE edbua_tbs02;
ALTER TABLE
edbua=# ALTER TABLE emp02 SET TABLESPACE edbua_tbs02;
ALTER TABLE
edbua=# ALTER TABLE emp03 SET TABLESPACE edbua_tbs02;
ALTER TABLE
edbua=#

pg_tblspc/<tbs_oid>/PG_15_<catalog_version>/<db_oid>/<relfilenode>

edbua=# select pg_relation_filepath('emp01');
            pg_relation_filepath
---------------------------------------------
 pg_tblspc/92663/PG_15_202209061/92666/92710
(1 row)

edbua=# 

edbua=# SELECT relname, pg_relation_filepath(oid) AS filepath
FROM pg_class
WHERE relname IN ('emp01','emp02','emp03','emp01_ix','emp02_ix','emp03_ix');
 relname  |                  filepath
----------+---------------------------------------------
 emp01    | pg_tblspc/92663/PG_15_202209061/92666/92710
 emp02    | pg_tblspc/92663/PG_15_202209061/92666/92713
 emp03    | pg_tblspc/92663/PG_15_202209061/92666/92716
 emp01_ix | pg_tblspc/92664/PG_15_202209061/92666/92700
 emp02_ix | pg_tblspc/92664/PG_15_202209061/92666/92701
 emp03_ix | pg_tblspc/92664/PG_15_202209061/92666/92702
(6 rows)

edbua=#

Important: Indexes do not move automatically when you move a table.
They remain in their original tablespace (edbua_ixtbs01 in this case).
If you want indexes in edbua_tbs02, you must explicitly run:

edbua=# ALTER INDEX emp01_ix SET TABLESPACE edbua_tbs02;
ALTER INDEX
edbua=# ALTER INDEX emp02_ix SET TABLESPACE edbua_tbs02;
ALTER INDEX
edbua=# ALTER INDEX emp03_ix SET TABLESPACE edbua_tbs02;
ALTER INDEX
edbua=#
edbua=# SELECT c.relname, t.spcname AS tablespace, pg_relation_filepath(c.oid)
edbua-# FROM pg_class c
edbua-# LEFT JOIN pg_tablespace t ON c.reltablespace = t.oid
edbua-# WHERE c.relname IN ('emp01','emp02','emp03','emp01_ix','emp02_ix','emp03_ix');
 relname  | tablespace  |            pg_relation_filepath
----------+-------------+---------------------------------------------
 emp01_ix | edbua_tbs02 | pg_tblspc/92663/PG_15_202209061/92666/92719
 emp02_ix | edbua_tbs02 | pg_tblspc/92663/PG_15_202209061/92666/92720
 emp03_ix | edbua_tbs02 | pg_tblspc/92663/PG_15_202209061/92666/92721
 emp01    | edbua_tbs02 | pg_tblspc/92663/PG_15_202209061/92666/92710
 emp02    | edbua_tbs02 | pg_tblspc/92663/PG_15_202209061/92666/92713
 emp03    | edbua_tbs02 | pg_tblspc/92663/PG_15_202209061/92666/92716
(6 rows)

edbua=#

edbua=# SELECT
edbua-#     c.relname,
edbua-#     COALESCE(t1.spcname, t2.spcname) AS tablespace,
edbua-#     pg_catalog.pg_tablespace_location(COALESCE(c.reltablespace, d.dattablespace)) AS tablespace_path,
edbua-#     current_setting('data_directory') AS data_directory,
edbua-#     CASE
edbua-#         WHEN c.reltablespace = 0 THEN
edbua-#             current_setting('data_directory') || '/base/' || d.oid || '/' || c.relfilenode
edbua-#         ELSE
edbua-#             pg_catalog.pg_tablespace_location(c.reltablespace) || '/PG_' ||
edbua-#             split_part(split_part(version(), ' ', 2), '.', 1) || '_' ||
edbua-#             '202209061/' || d.oid || '/' || c.relfilenode
edbua-#     END AS full_path_guess
edbua-# FROM pg_class c
edbua-# LEFT JOIN pg_tablespace t1 ON c.reltablespace = t1.oid
edbua-# LEFT JOIN pg_database d ON d.datname = current_database()
edbua-# LEFT JOIN pg_tablespace t2 ON d.dattablespace = t2.oid
edbua-# WHERE c.relname IN ('emp01','emp02','emp03','emp01_ix','emp02_ix','emp03_ix');
 relname  | tablespace  |       tablespace_path       |    data_directory    |                     full_path_guess
----------+-------------+-----------------------------+----------------------+---------------------------------------------------------
 emp01_ix | edbua_tbs02 | /pgData/pgsql15/edbua_tbs02 | /pgData/pgsql15/data | /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92719
 emp02_ix | edbua_tbs02 | /pgData/pgsql15/edbua_tbs02 | /pgData/pgsql15/data | /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92720
 emp03_ix | edbua_tbs02 | /pgData/pgsql15/edbua_tbs02 | /pgData/pgsql15/data | /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92721
 emp01    | edbua_tbs02 | /pgData/pgsql15/edbua_tbs02 | /pgData/pgsql15/data | /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92710
 emp02    | edbua_tbs02 | /pgData/pgsql15/edbua_tbs02 | /pgData/pgsql15/data | /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92713
 emp03    | edbua_tbs02 | /pgData/pgsql15/edbua_tbs02 | /pgData/pgsql15/data | /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92716
(6 rows)

edbua=#


10. Verify Database Directory (Filesystem)

edbua=# SELECT oid, datname FROM pg_database WHERE datname = current_database();
  oid  | datname
-------+---------
 92666 | edbua
(1 row)

edbua=#

[root@pg17 ~]# ls -ltr /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/*
-rw-------. 1 postgres postgres    0 Sep 23 00:14 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92710
-rw-------. 1 postgres postgres    0 Sep 23 00:14 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92711
-rw-------. 1 postgres postgres 8192 Sep 23 00:14 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92712
-rw-------. 1 postgres postgres    0 Sep 23 00:14 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92713
-rw-------. 1 postgres postgres    0 Sep 23 00:14 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92714
-rw-------. 1 postgres postgres 8192 Sep 23 00:14 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92715
-rw-------. 1 postgres postgres    0 Sep 23 00:14 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92716
-rw-------. 1 postgres postgres    0 Sep 23 00:14 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92717
-rw-------. 1 postgres postgres 8192 Sep 23 00:14 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92718
-rw-------. 1 postgres postgres 8192 Sep 23 00:52 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92719
-rw-------. 1 postgres postgres 8192 Sep 23 00:52 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92720
-rw-------. 1 postgres postgres 8192 Sep 23 00:52 /pgData/pgsql15/edbua_tbs02/PG_15_202209061/92666/92721
[root@pg17 ~]#


Issue: Why are there 12 files when I have only 6 objects?

created only: 3 tables: emp01, emp02, emp03 & 3 indexes: emp01_ix, emp02_ix, emp03_ix

But in the tablespace directory, we're seeing 12 files: 3 tables + 3 indexes + 3 TOAST tables + 3 TOAST indexes

edbua=# SELECT
edbua-#     c.relname,
edbua-#     c.relfilenode,
edbua-#     c.relkind,
edbua-#     n.nspname AS schema,
edbua-#     t.spcname AS tablespace
edbua-# FROM
edbua-#     pg_class c
edbua-# JOIN
edbua-#     pg_namespace n ON n.oid = c.relnamespace
edbua-# LEFT JOIN
edbua-#     pg_tablespace t ON c.reltablespace = t.oid
edbua-# WHERE
edbua-#     c.reltablespace = (SELECT oid FROM pg_tablespace WHERE spcname = 'edbua_tbs02')
edbua-# ORDER BY
edbua-#     c.relfilenode;
       relname        | relfilenode | relkind |  schema  | tablespace
----------------------+-------------+---------+----------+-------------
 emp01                |       92710 | r       | public   | edbua_tbs02
 pg_toast_92685       |       92711 | t       | pg_toast | edbua_tbs02
 pg_toast_92685_index |       92712 | i       | pg_toast | edbua_tbs02
 emp02                |       92713 | r       | public   | edbua_tbs02
 pg_toast_92690       |       92714 | t       | pg_toast | edbua_tbs02
 pg_toast_92690_index |       92715 | i       | pg_toast | edbua_tbs02
 emp03                |       92716 | r       | public   | edbua_tbs02
 pg_toast_92695       |       92717 | t       | pg_toast | edbua_tbs02
 pg_toast_92695_index |       92718 | i       | pg_toast | edbua_tbs02
 emp01_ix             |       92719 | i       | public   | edbua_tbs02
 emp02_ix             |       92720 | i       | public   | edbua_tbs02
 emp03_ix             |       92721 | i       | public   | edbua_tbs02
(12 rows)

edbua=#


11. Rename tablespace

edbua=# ALTER TABLESPACE edbua_tbs02 RENAME TO edbua_tbs03;
ALTER TABLESPACE
edbua=#

edbua=# \db+ edbua*
                                                List of tablespaces
      Name       |  Owner   |            Location             | Access privileges | Options |  Size   | Description
-----------------+----------+---------------------------------+-------------------+---------+---------+-------------
 edbua_ixtbs01   | postgres | /pgData/pgsql15/edbua_ixtbs01   |                   |         | 6 bytes |
 edbua_tbs01     | postgres | /pgData/pgsql15/edbua_tbs01     |                   |         | 7789 kB |
 edbua_tbs03     | postgres | /pgData/pgsql15/edbua_tbs02     |                   |         | 48 kB   |
 edbua_temptbs01 | postgres | /pgData/pgsql15/edbua_temptbs01 |                   |         | 6 bytes |
(4 rows)

edbua=#


12. Drop Tablespace

edbua=# drop tablespace edbua_tbs03;
ERROR:  tablespace "edbua_tbs03" is not empty
edbua=#

edbua=# SELECT
edbua-#   CASE
edbua-#     WHEN c.relkind = 'r' THEN
edbua-#       format('ALTER TABLE %I.%I SET TABLESPACE edbua_tbs01;', n.nspname, c.relname)
edbua-#     WHEN c.relkind = 'i' THEN
edbua-#       format('ALTER INDEX %I.%I SET TABLESPACE edbua_tbs01;', n.nspname, c.relname)
edbua-#     WHEN c.relkind = 'S' THEN
edbua-#       format('ALTER SEQUENCE %I.%I SET TABLESPACE edbua_tbs01;', n.nspname, c.relname)
edbua-#   END AS alter_statement
edbua-# FROM pg_class c
edbua-# JOIN pg_namespace n ON n.oid = c.relnamespace
edbua-# WHERE c.reltablespace = (SELECT oid FROM pg_tablespace WHERE spcname = 'edbua_tbs03')
edbua-#   AND c.relkind IN ('r', 'i', 'S')
edbua-#   AND n.nspname NOT IN ('pg_catalog', 'pg_toast', 'information_schema')
edbua-# ORDER BY n.nspname, c.relname;
                     alter_statement
---------------------------------------------------------
 ALTER TABLE public.emp01 SET TABLESPACE edbua_tbs01;
 ALTER INDEX public.emp01_ix SET TABLESPACE edbua_tbs01;
 ALTER TABLE public.emp02 SET TABLESPACE edbua_tbs01;
 ALTER INDEX public.emp02_ix SET TABLESPACE edbua_tbs01;
 ALTER TABLE public.emp03 SET TABLESPACE edbua_tbs01;
 ALTER INDEX public.emp03_ix SET TABLESPACE edbua_tbs01;
(6 rows)

edbua=#

edbua=# ALTER TABLE public.emp01 SET TABLESPACE edbua_tbs01;
 ALTER INDEX public.emp02_ix SET TABLESPACE edbua_tbs01;
 ALTER TABLE public.emp03 SET TABLESPACE edbua_tbs01;
 ALTER INDEX public.emp03_ix SET TABLESPACE edbua_tbs01;ALTER TABLE
edbua=#  ALTER INDEX public.emp01_ix SET TABLESPACE edbua_tbs01;
ALTER INDEX
edbua=#  ALTER TABLE public.emp02 SET TABLESPACE edbua_tbs01;
ALTER TABLE
edbua=#  ALTER INDEX public.emp02_ix SET TABLESPACE edbua_tbs01;
ALTER INDEX
edbua=#  ALTER TABLE public.emp03 SET TABLESPACE edbua_tbs01;
ALTER TABLE
edbua=#  ALTER INDEX public.emp03_ix SET TABLESPACE edbua_tbs01;
ALTER INDEX
edbua=#

edbua=# drop tablespace edbua_tbs03;
DROP TABLESPACE
edbua=# \db+ edbua*
                                                List of tablespaces
      Name       |  Owner   |            Location             | Access privileges | Options |  Size   | Description
-----------------+----------+---------------------------------+-------------------+---------+---------+-------------
 edbua_ixtbs01   | postgres | /pgData/pgsql15/edbua_ixtbs01   |                   |         | 6 bytes |
 edbua_tbs01     | postgres | /pgData/pgsql15/edbua_tbs01     |                   |         | 7837 kB |
 edbua_temptbs01 | postgres | /pgData/pgsql15/edbua_temptbs01 |                   |         | 6 bytes |
(3 rows)

edbua=#


13. Change ownership for Tablespace

edbua=# ALTER TABLESPACE edbua_tbs01 OWNER TO teja;
ALTER TABLESPACE
edbua=# \db+ edbua*
                                                List of tablespaces
      Name       |  Owner   |            Location             | Access privileges | Options |  Size   | Description
-----------------+----------+---------------------------------+-------------------+---------+---------+-------------
 edbua_ixtbs01   | postgres | /pgData/pgsql15/edbua_ixtbs01   |                   |         | 6 bytes |
 edbua_tbs01     | teja     | /pgData/pgsql15/edbua_tbs01     |                   |         | 7837 kB |
 edbua_temptbs01 | postgres | /pgData/pgsql15/edbua_temptbs01 |                   |         | 6 bytes |
(3 rows)

edbua=# ALTER TABLESPACE edbua_tbs01 OWNER TO postgres;
ALTER TABLESPACE
edbua=# \db+ edbua*
                                                List of tablespaces
      Name       |  Owner   |            Location             | Access privileges | Options |  Size   | Description
-----------------+----------+---------------------------------+-------------------+---------+---------+-------------
 edbua_ixtbs01   | postgres | /pgData/pgsql15/edbua_ixtbs01   |                   |         | 6 bytes |
 edbua_tbs01     | postgres | /pgData/pgsql15/edbua_tbs01     |                   |         | 7837 kB |
 edbua_temptbs01 | postgres | /pgData/pgsql15/edbua_temptbs01 |                   |         | 6 bytes |
(3 rows)

edbua=#


14. Verify Symbolic Links

edbua=# show data_directory;
    data_directory
----------------------
 /pgData/pgsql15/data  <----
(1 row)

edbua=#

[root@pg17 pg_tblspc]# ls -ltr /pgData/pgsql15/data/pg_tblspc/*
lrwxrwxrwx. 1 postgres postgres 22 Aug 18 06:36 /pgData/pgsql15/data/pg_tblspc/24581 -> /u01/data/dell_ts_data
lrwxrwxrwx. 1 postgres postgres 23 Aug 18 06:36 /pgData/pgsql15/data/pg_tblspc/24582 -> /u01/data/dell_ts_index
lrwxrwxrwx. 1 postgres postgres 20 Sep  3 09:52 /pgData/pgsql15/data/pg_tblspc/24594 -> /pgData/pgsql15/data
lrwxrwxrwx. 1 postgres postgres 29 Sep  3 11:55 /pgData/pgsql15/data/pg_tblspc/24597 -> /pgData/pgsql15/data/trd_tb01
lrwxrwxrwx. 1 postgres postgres 29 Sep  3 11:55 /pgData/pgsql15/data/pg_tblspc/24598 -> /pgData/pgsql15/data/trd_ix01
lrwxrwxrwx. 1 postgres postgres 27 Sep  4 05:59 /pgData/pgsql15/data/pg_tblspc/32787 -> /pgData/pgsql15/pgtb/geb_tb
lrwxrwxrwx. 1 postgres postgres 27 Sep  4 06:03 /pgData/pgsql15/data/pg_tblspc/32788 -> /pgData/pgsql15/pgix/geb_ix
lrwxrwxrwx. 1 postgres postgres 27 Sep 20 07:20 /pgData/pgsql15/data/pg_tblspc/92662 -> /pgData/pgsql15/edbua_tbs01
lrwxrwxrwx. 1 postgres postgres 29 Sep 20 07:21 /pgData/pgsql15/data/pg_tblspc/92664 -> /pgData/pgsql15/edbua_ixtbs01
lrwxrwxrwx. 1 postgres postgres 31 Sep 20 07:21 /pgData/pgsql15/data/pg_tblspc/92665 -> /pgData/pgsql15/edbua_temptbs01
[root@pg17 pg_tblspc]#


15. How to find tablespace size

edbua=# SELECT spcname, pg_size_pretty(pg_tablespace_size(spcname)) AS size FROM pg_tablespace;
     spcname     |  size
-----------------+---------
 pg_default      | 1660 MB
 pg_global       | 571 kB
 dell_ts_data    | 7761 kB
 dell_ts_index   | 16 kB
 dell_tbs        | 0 bytes
 trd_tb01        | 1615 MB
 trd_ix01        | 2648 kB
 geb_tb          | 13 GB
 geb_ix          | 8950 MB
 edbua_ixtbs01   | 6 bytes
 edbua_temptbs01 | 6 bytes
 edbua_tbs01     | 7837 kB
(12 rows)

edbua=#
Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
Thank you
Rajasekhar Amudala

PSQL

PostgreSQL DBA Step by Step Learning

#PostgreSQL DBA Topics
1How to Install PostgreSQL ON Linux?
2How to Install PostgreSQL on Linux 7 using source code?
3How to START/STOP PostgreSQL ON Linux?
4How to Create Database in PostgreSQL?
5PostgreSQL User Management
6PostgreSQL pg_hba.conf Guide
7PostgreSQL Change Data Directory
8Understanding WAL Files in PostgreSQL – For Oracle DBAs
9Change PostgreSQL WAL Directory Path (pg_wal)
10Enable Archive Mode in PostgreSQL 17
11How to Disable ARCHIVELOG Mode
12PostgreSQL Tablespace Management
13PostgreSQL pg_dump and pg_restore Guide
14PostgreSQL Backup and Restore Using pg_dumpall and psql
15pg_basebackup – Backup, Restore, and Recovery
16Backup & Restore PostgreSQL DB Cluster to Another Host (No Archive Mode)
17Backup & Restore PostgreSQL DB Cluster on Same Host
18Restore PostgreSQL to New Host using pg_basebackup + WAL Archives
19PostgreSQL PITR – Point in Time Recovery
20Configure Streaming Replication in PostgreSQL
21Manual Failover in PostgreSQL Streaming Replication
22Convert Asynchronous Replication to Synchronous Replication

 

Thank you,
Rajasekhar Amudala
Email: br8dba@gmail.com
Linkedin: https://www.linkedin.com/in/rajasekhar-amudala/