Subject: Pgbackrest info output interpretation

From: KK CHN <[email-masked]>
Date: Fri, 14 Nov 2025 14:02:38 +0530

Hi,

I am having confusion trying to understand the database size, backupsize
and repo backup size..

In my DB server I have du output as follows.

/data/edb/as16
[root@db1 as16]# du -h -d 1
5.3G    ./data
25G     ./tablespace
30G     .
[root@db1 as16]#

On my Repo Server pgbackest info says ....

full backup: 20251114-121504F
            timestamp start/stop: 2025-11-14 12:15:04+05:30 / 2025-11-14
12:20:58+05:30
            wal start/stop: 000000010000000500000024 /
000000010000000500000024
            database size: 3GB, database backup size: 3GB
            repo1: backup size: 431.0MB

Could someone shed some light on    431 MB and database size:3GB, database
backup size : 3GB  compared to the DB cluster on disk usage output ?

How to correlate the pgbackrest ( info) database size, database backup size
and repo1 backup size     and actual du output on DB cluster.

Note: I am using zst compression on pgbackrest

Regards,
Krishane

---

From: Greg Sabino Mullane <[email-masked]>
Date: Fri, 14 Nov 2025 08:48:57 -0500

The "database size" is going to be your data directory, MINUS your pg_wal
directory, MINUS unlogged/temp relations, and MINUS things that are not
needed for recovery (i.e. all the small pg_ directories such as
pg_subtrans). The "database backup size" is how much of that 3GB is part of
*this* backup - for a full backup, the number will be the same, for diff or
incr, it will be a lot less. The "repo backup size" on the last line is the
compressed size of the previous "database backup size"

> and repo1 backup size     and actual du output on DB cluster.

You cannot, really, without deep knowledge of things like which files on
disk map back to unlogged tables. However, du on the datadir minus all pg_
dirs should get you in the ballpark. As a quick example:

cd $DATADIR
du --summarize * | awk '!/pg_/{x=x+$1}END{print x}' | numfmt --to=iec

Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support