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 1ut8ka-001PPg-1Y for pgsql-general@arkaria.postgresql.org; Mon, 01 Sep 2025 17:55:28 +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 1ut8jY-000j23-J1 for pgsql-general@arkaria.postgresql.org; Mon, 01 Sep 2025 17:54:25 +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 1ut8jY-000j1u-8Y for pgsql-general@lists.postgresql.org; Mon, 01 Sep 2025 17:54:24 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ut8jW-00029a-2Z for pgsql-general@lists.postgresql.org; Mon, 01 Sep 2025 17:54:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 581HsGoQ366774; Mon, 1 Sep 2025 13:54:16 -0400 From: Tom Lane To: Adrian Klaver cc: Dimitrios Apostolou , pgsql-general@lists.postgresql.org Subject: Re: In-order pg_dump (or in-order COPY TO) In-reply-to: References: <3541781s-75o7-26pp-46pp-qs54o4406192@tzk.arg> <4ss66r31-558o-qq24-332q-no351p7n5osr@tzk.arg> <0dc17a73-2372-4613-a50e-610ae7d02b93@aklaver.com> <84F8AAF7-8FC6-463C-827F-5D09E24EA911@gmx.net> Comments: In-reply-to Adrian Klaver message dated "Mon, 01 Sep 2025 10:24:15 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <366772.1756749256.1@sss.pgh.pa.us> Date: Mon, 01 Sep 2025 13:54:16 -0400 Message-ID: <366773.1756749256@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: > I did some digging in the code and see that the TOC is more then that, > it stores a range of data. Still have not part where the offsets are > ignored for writes to stdout, but will keep on digging. The TOC is initially written out with zeroes for the offsets. Then the per-table data parts are written out, tracking where each one begins. At the end, if the output file is seekable, pg_dump seeks back to the start and re-writes the whole TOC section, now with data offsets populated. But output to a pipe won't be seekable. regards, tom lane