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 1uuBHd-0046mC-7B for pgsql-general@arkaria.postgresql.org; Thu, 04 Sep 2025 14:49:54 +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 1uuBHa-00Gdtm-4o for pgsql-general@arkaria.postgresql.org; Thu, 04 Sep 2025 14:49: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 1uuBHZ-00Gdte-A0 for pgsql-general@lists.postgresql.org; Thu, 04 Sep 2025 14:49:50 +0000 Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uuBHW-000WRw-2i for pgsql-general@lists.postgresql.org; Thu, 04 Sep 2025 14:49:47 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 154347A0368; Thu, 4 Sep 2025 10:49:45 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 04 Sep 2025 10:49:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1756997384; x=1757083784; bh=r5DRHnKcObDrUWA83+/QPvZcdpJCtpj9UKgSaVbpiFQ=; b= 2O2pZYOMm/mm3HrGEZ70/GhuelNNzB/Ze6rwqv48NjOovQbQ7ULJayWGZlry/mcC gYMHqE4AyFGCHw8JPSKDla5cd4UA5jlqEykYpdO6/HjZ0EImcGUd9899YWtaQhuY YDpBViJ6E3fQI9Jhi+FVuTVOa6YUzLc9y8TrQe1W+gDrXt3QU6L/2GflbYRDdjuf D/6rRnzcX5tcYuNuCGgHirfA4b36fEg7nUUOok3gZHeOakB3noR9Lfnjgjgy0fC7 1n0PmB9VYVBnolDRqvZaCvi9363p+aT48n++Qeqji+vyPaDdfo2QNr1Shhvl2zu0 OvurPi2p2GDdJNRS+YmseQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1756997384; x= 1757083784; bh=r5DRHnKcObDrUWA83+/QPvZcdpJCtpj9UKgSaVbpiFQ=; b=U uL+LoWpvfy3A7kibW5lGhfo6MqFW8xaqhXE04OfGq6aClfLubLxSivnJupuD1Zv2 IWG91G8lEW6MpvOl9H/V0kpthxomV7WfTMvpUL3vol8licnEYrtRh2WTxCvz2tJL C+3F/28mOtHfMVsnYmNMqTZNz5FPmaB78BZOrhutwj7KB3iaFaDdUAHfrXaWgAA3 pG+2AV/j994F0NNUKF2U2XLOTmlmo/16rqOXibMO83cp5Wdy6cBQOaqMrjvZjn0r rtn6f/9zkuaFMnY1P15RODaGy2/9JKIrztpDMIQzmrHqMa92Uml5d34G09L8z6Fx 0sVJ6Cq+c+y7PrwPlnmLA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdeivdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttd dvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghv vghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpefgudefkefhveefle evieeuveehvdduudekuddvvdelhfeuueeijedtuedvvedvueenucffohhmrghinhepphho shhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdp nhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghlvh hhvghrrhgvsehkuhhrihhlvghmuhdruggvpdhrtghpthhtohepjhhimhhishesghhmgidr nhgvthdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehlihhsthhsrdhpohhsth hgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Sep 2025 10:49:43 -0400 (EDT) Message-ID: Date: Thu, 4 Sep 2025 07:49:43 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: In-order pg_dump (or in-order COPY TO) To: =?UTF-8?Q?=C3=81lvaro_Herrera?= , Dimitrios Apostolou Cc: pgsql-general@lists.postgresql.org References: <202509041202.ml2xi5yp46yt@alvherre.pgsql> Content-Language: en-US From: Adrian Klaver In-Reply-To: <202509041202.ml2xi5yp46yt@alvherre.pgsql> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/4/25 05:02, Álvaro Herrera wrote: > On 2025-Aug-26, Dimitrios Apostolou wrote: > >> I am storing dumps of a database (pg_dump custom format) in a de-duplicating >> backup server. Each dump is many terabytes in size, so deduplication is very >> important. And de-duplication itself is based on rolling checksums which is >> pretty flexible, it can compensate for blocks moving by some offset. > > Hello, > > It's generally considered nowadays that pg_dump is not the best option > to create backups of very large databases. You may be better served by > using a binary backup tool -- something like Barman. With current > 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 As I understand it the TOC issue was with pg_restore and it having to generate the offsets as they where not included in the backup file as it was streamed, not written to a file. The deduplication became an issue when changing Postgres versions per: https://www.postgresql.org/message-id/4ss66r31-558o-qq24-332q-no351p7n5osr%40tzk.arg " > The problem occurs when you do the pg_dump after this restore, correct? Correct. The first pg_dump from the restored pg17 is not deduplicated at all. Most of the tables have not changed (logically at least; apparently they have changed physically). " > provides support for hook scripts, which perhaps can be used to transfer > the backup files to Borg. (I haven't actually tried to do this, but the > Barman developers talk about using them to transfer the backups to tape, > so I imagine getting them to play with Borg it's a Simple Matter of > Programming.) > -- Adrian Klaver adrian.klaver@aklaver.com