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 1urI1a-003fbC-0R for pgsql-general@arkaria.postgresql.org; Wed, 27 Aug 2025 15:25:23 +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 1urI1Y-00G8XF-LH for pgsql-general@arkaria.postgresql.org; Wed, 27 Aug 2025 15:25:21 +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 1urI1X-00G8Vs-ML for pgsql-general@lists.postgresql.org; Wed, 27 Aug 2025 15:25:20 +0000 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1urI1V-0022Md-0f for pgsql-general@lists.postgresql.org; Wed, 27 Aug 2025 15:25:19 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id B2F9B1400108; Wed, 27 Aug 2025 11:25:16 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Wed, 27 Aug 2025 11:25:16 -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=1756308316; x=1756394716; bh=iLk2Siqbe6QTvlm4E/qtjXqsorV5JfuXEM+m/p5Xj6I=; b= m3dBmZBP8jsWr9kPPrWEDahdbyq9lsCAuPteLdgMmriT6gMZQ3LEtu120JKh3FkZ uFe9+Rhcyb6LUCL1MfBB3ShY/54ApX/MwW+G2juc1f8T3RHmMXKvZLaqe+JiF1b4 ARJIH/Av2wET9AI+CJ3/XSxKI4liVOoIqOtlALH4++ZxzJHruxdJt+X15SdFaFTx MfGr+MgncySdo6HHsuof29k7a6msLARdjsTrL1/bo1IDoVXW3NPrumcGkEvVHE5h H3OvlAjGLdI+rTzjbpCMRSCvDJmhYiSQp/mZ6K3l6wpX2x8xoTvc8sKXiRcp9l5o O4MwzRrHbe5C1nfGrybANQ== 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=1756308316; x= 1756394716; bh=iLk2Siqbe6QTvlm4E/qtjXqsorV5JfuXEM+m/p5Xj6I=; b=a 7Nfd7BcleTAMh0iZU2OZu3C5nwknR3ILv4kxhhTO/rn1R2MQwR880eLzZPO+eva0 H5SMlk4Rb0xn7kMNee5EDdYj/uv/wysNGaAZD01CrJfqnO6i5phiInY7wEqUQXPy SIiFnbzwbVJ8peo5VaYavSMS55rP8R8Qyi6TdPBUUPG4rFjNQlzWu5QQBkpMncPi mJziklMiXJ+Zpp5FxGtj9Sm1FM9h+pKR0e1xTBHHYIgLfwkR7R3ab3Kk8G47AzH4 Mnly1Xn1oKSU26ZHu02gECL/hqkqNvk7Nu16EKeuyshQ9Zk4QOT0kifyI3wXThJb GuS4JBmNLhl++qQRgWIjg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddujeekheduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmnecujf gurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhephfeftddtkedtleehueevvdehjefgffeivefghefgffeh feehleelteffgfelffetnecuffhomhgrihhnpeifohhrughprhgvshhsrdgtohhmnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghn rdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthhtohepvddpmhhoug gvpehsmhhtphhouhhtpdhrtghpthhtohepjhhimhhishesghhmgidrnhgvthdprhgtphht thhopehpghhsqhhlqdhgvghnvghrrghlsehlihhsthhsrdhpohhsthhgrhgvshhqlhdroh hrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 27 Aug 2025 11:25:16 -0400 (EDT) Message-ID: Date: Wed, 27 Aug 2025 08:25:15 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: In-order pg_dump (or in-order COPY TO) To: Dimitrios Apostolou Cc: pgsql-general@lists.postgresql.org References: <3541781s-75o7-26pp-46pp-qs54o4406192@tzk.arg> Content-Language: en-US From: Adrian Klaver In-Reply-To: <3541781s-75o7-26pp-46pp-qs54o4406192@tzk.arg> 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 8/27/25 05:09, Dimitrios Apostolou wrote: > On Wednesday 2025-08-27 00:54, Adrian Klaver wrote: > >> What are the pg_dump/pg_restore commands? >> >> What are the Postgres versions involved? >> >> Are they community versions of Postgres or something else? >> >> What is the depduplication program? >> >> > > Comments in line below. > Dump is from PostgreSQL 16, it's pg_dump writing to stdout: > > pg_dump -v --format=custom --compress=none --no-toast-compression -- > serializable-deferrable db_name  |  borg create ... > > > As you can see the backup (and deduplicating) program is borgbackup. Ok, I use BorgBackup and it is fairly forgiving of normal changes. FYI, if you ever want to use compression check out gzip --rsyncable, I have found it plays well with Borg. For more information see: https://beeznest.wordpress.com/2005/02/03/rsyncable-gzip/ > > > Restore is in PostgreSQL 17: > > I first create the empty tables by running the DDL commands in version > control to setup the database. And then I do pg_restore --data-only: > > pg_restore -vvvv -j 8 -U db_owner -d db_name --schema=public -- > section=data  dump_file If you are using only the --data section why not --data-only in the pg_dump? Or is the pg_dump output used for other purposes? > > > Worth noting is that the above pg_restore goes through the WAL, i.e. all > writes are done by walwriter, not the backend directly. Please explain the above further. The problem occurs when you do the pg_dump after this restore, correct? Is it the same pg_dump command as you show above? > > Postgres is standard open source running on own server. It has a couple > of custom patches that shouldn't matter in this codepath. For completeness and just in case they may affect the output what do the patches do? > > >>>  Thanks in advance, >>>  Dimitris -- Adrian Klaver adrian.klaver@aklaver.com