Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uuDJQ-004rUg-B2 for pgsql-general@arkaria.postgresql.org; Thu, 04 Sep 2025 16:59:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uuDJO-000mTg-FW for pgsql-general@arkaria.postgresql.org; Thu, 04 Sep 2025 16:59:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uuDJO-000mTU-53 for pgsql-general@lists.postgresql.org; Thu, 04 Sep 2025 16:59:50 +0000 Received: from cloud.gatewaynet.com ([185.90.37.94]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uuDJL-000XUH-16 for pgsql-general@lists.postgresql.org; Thu, 04 Sep 2025 16:59:49 +0000 Message-ID: Date: Thu, 4 Sep 2025 19:59:43 +0300 MIME-Version: 1.0 Subject: Re: In-order pg_dump (or in-order COPY TO) To: pgsql-general@lists.postgresql.org References: <202509041202.ml2xi5yp46yt@alvherre.pgsql> Content-Language: en-US From: Achilleas Mantzios In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/4/25 19:08, Dimitrios Apostolou wrote: > Hi =C3=81lvaro and Greg, > > On Thursday 2025-09-04 14:02, =C3=81lvaro Herrera wrote: > >> It's generally considered nowadays that pg_dump is not the best option >> to create backups of very large databases.=C2=A0 You may be better ser= ved by >> using a binary backup tool -- something like Barman.=C2=A0 With curren= t >> Postgres releases you can create incremental backups, which would >> probably be more effective at deduplicating than playing with pg_dump'= s >> TOC, because it's based on what actually happens to the data. Barman >> provides support for hook scripts, which perhaps can be used to transf= er >> the backup files to Borg.=C2=A0 (I haven't actually tried to do this, = but the >> Barman developers talk about using them to transfer the backups to tap= e, >> so I imagine getting them to play with Borg it's a Simple Matter of >> Programming.) > > On Wed, 27 Aug 2025, Greg Sabino Mullane wrote: > >> I suggest looking into pgBackRest, and it's block incremental=20 >> feature, which sounds similar to what you are doing. But it also does=20 >> it with parallel processes, and can do things like grab backup files=20 >> from your replicas, plus a lot of other features. > > > if I'm not mistaken, both Barman and pgBackRest are based on physical=20 > dumps of the database (pg_basebackup). At the start of this project I=20 > had evaluated pg_basebackup, but decided logical backup fitted my=20 > needs better. > > + pg_basebackup was slower, measuring speeds of around 10MB/s, because > =C2=A0 of issues with 8KB page size and compressed btrfs (see [1]; situ= ation > =C2=A0 has been improved both on the postgres side and the kernel side; > =C2=A0 I'm not sure how pg_basebackup fares today). > > + pg_basebackup was much bigger, because of including indices etc.=C2=A0= As a > =C2=A0 result of size and speed, pg_basebackup was also taking a longer= time. > > + physical dumps would change a lot during maintenance (vacuum full, > =C2=A0 cluster etc) while the data would remain the same. This would > =C2=A0 reduce the effect of deduplication and increase size requirement= s even > =C2=A0 further. At that point in time I did not expect logical dumps to > =C2=A0 change too, when the data hasn't changed. > > + I use logical dumps as a tool, not only as a backup, to copy the > =C2=A0 database to other servers with different postgresql versions. > > + I also use it to verify the VCS-committed SQL schema: doing pg_restor= e > =C2=A0 --data-only on an already created database will fail if the SQL = schema > =C2=A0 had been modified on the original server without committing the > =C2=A0 changes. > > + Finally I don't really need all the advanced features that physical > =C2=A0 replication offers, like HA, PITR, load balancing.=C2=A0 It's a > =C2=A0 non-mission-critical service that can take a little time off in = case > =C2=A0 of disaster recovery. > > [1]=20 > https://www.postgresql.org/message-id/flat/218fa2e0-bc58-e469-35dd-c5cb= 35906064%40gmx.net=20 > if that helps , this is a writeup I had some some years ago comparing=20 pgbackrest , barman and probackup : https://severalnines.com/blog/current-state-open-source-backup-management= -postgresql/ > > Regards, > Dimitris