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 1tuLLC-007apK-Cy for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 01:01:58 +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 1tuLL9-004v9x-SU for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 01:01:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tuLL9-004v9O-Hr for pgsql-hackers@lists.postgresql.org; Tue, 18 Mar 2025 01:01:55 +0000 Received: from mail-yb1-xb35.google.com ([2607:f8b0:4864:20::b35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tuLL5-003T3o-2q for pgsql-hackers@lists.postgresql.org; Tue, 18 Mar 2025 01:01:55 +0000 Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-e609cff9927so3584855276.3 for ; Mon, 17 Mar 2025 18:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742259711; x=1742864511; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=JHiaYahtwFzwr1tlVLR94RWONJ1IAfEbBGJd88UwoCk=; b=GECWFezrjzC88nUfhBBJrIXFVEkKXJHKkiv3hq8v/dtOMlDgM9nyW3yv/xbuVJEaYm Wmb6jUN+Vh7/nigmiegddE+h7n+59GjsnS+5qYctaFTfLL7QCO/1j7mK6TQUAoAfiZB1 jUWvYEktCUhtijouGDP9UahNHmlBWkRRNkeQRhuSJ2axoodJsk/lvVL+OiDY32OsGWee IFXhbEghny75/z7Yi3C/a3BPeSxEJxP4MUCtpfe+i2tRrd4a0x1XKWHTLQz7RLOEMkh8 a9EsvBfHbRPl6Nft07GETSW8RoLR+BIHbDHn5wAAZbGuBovdrPJHDQKJUyRSbA8Iw0Id khXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742259711; x=1742864511; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JHiaYahtwFzwr1tlVLR94RWONJ1IAfEbBGJd88UwoCk=; b=IEoS1g+5G6RCGR7VOA5LB/8PkfMbE2vqaVPI9Uvre3fSm2m1Gsia+E7Ou8kLEHaGVP 8GTIOmMtHo7o9fSU35S4HjwIAI8NVBTUI9UZVREPZYvqMN64SAjsQGEAhMIIDAkBEwMq hhuw70kv/nWwOPTZ9rQeoEn8nByiv/SJ84rKshXSKTq5JfOtJoPAvN3uYmZyQEtf3xiQ e62xpofrIL/YhkcV3dCTTR7o+vAsCYI2aaro0EibY0vHc4z9E3OyZ9UDKjBc7Dk2+cyQ k/g7v3hSWtVZyAPCE6s1kDaHKw2W6p7AaMP5T0I9nx6Q+yt0ZcPsICaafwUPLf4aLYix fp6w== X-Forwarded-Encrypted: i=1; AJvYcCWOTP1vQkfRvUtgNBaF//hDtUs8vk1roCUrJnpHbne5gzsrYhgIf8Fwgx4FMSZOHUItD6XB3gXq3itQpUDJ@lists.postgresql.org X-Gm-Message-State: AOJu0YzRGQWyOgC+Hlkw9KnxfrvYWIWtmVUH7P6nGdp/dD8NXV6hCQ4p ++r3Zlqek/rTs3nV3A8GWu6a9j3rtG5QrorW2C+yKb4AEKEqJqtP X-Gm-Gg: ASbGncsHFCGgAsJSybpwqdWw/HXsxHAeTIV0Rq6XKJv6r3G2czzpn2TEdPgVcf2/vRz SnBh0IMcsCyS6SE1rs21U2kTLQGQy6Imaqhgn9O6981YdnxBCnfU3KtdTCDGMYuZtZRxnI+lrBF aujmCMtY3IIAQx0IyjJRHVHT1wb5+/5stJoSXsHPOGMKXYjYkV6uE1fSWGBszxVtMMaXniMdAGR Vxadmf6kxAjJ2hgafN02A7ad7MUaXLFrxjftlSAEHowxaILaCAaxFL1+8Mn+jFsm5HxWTQMw4E9 2f0d4NUYfuMuXqnSVFoLaAQxjqLOMnZfGXNEClAZDRsK3tlqq8tAjcgM3NkuMSpv44f2waeuQq0 BUHVmuCkqKObe/0+2jMGKUAPaLVGzq4qNOvYj+mZ0pQnyWvPLMZE= X-Google-Smtp-Source: AGHT+IGtjrCSwJVCcFOXD3lkGZqdnBwkUVSdo5Bom8l886qRRevYR8jh6NcBGmUxd7a09AcxT9mK3Q== X-Received: by 2002:a05:6902:2583:b0:e63:ca13:efb6 with SMTP id 3f1490d57ef6-e63f64f7c45mr21130890276.19.1742259711178; Mon, 17 Mar 2025 18:01:51 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e6414a21a08sm1250872276.17.2025.03.17.18.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Mar 2025 18:01:50 -0700 (PDT) Date: Mon, 17 Mar 2025 20:01:48 -0500 From: Nathan Bossart To: Corey Huinker Cc: Jeff Davis , Robert Treat , Robert Haas , Andres Freund , Tom Lane , Michael Paquier , jian he , Bruce Momjian , Matthias van de Meent , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Peter Smith , PostgreSQL Hackers , alvherre@alvh.no-ip.org Subject: Re: Statistics Import and Export Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 17, 2025 at 07:24:46PM -0400, Corey Huinker wrote: > On Mon, Mar 17, 2025 at 10:24 AM Nathan Bossart > wrote: >> I'm assuming that writing a completely different TOC on the second pass >> would corrupt the dump file. Perhaps we could teach it to skip stats >> entries on the second pass or something, but I'm not too wild about adding >> to the list of invasive changes we're making last-minute for v18. > > I'm confused, are they needed in both places? AFAICT yes. The second pass rewrites the TOC to udpate the data offset information. If we wrote a different TOC the second time around, then the dump file would be broken, right? /* * If possible, re-write the TOC in order to update the data offset * information. This is not essential, as pg_restore can cope in most * cases without it; but it can make pg_restore significantly faster * in some situations (especially parallel restore). */ if (ctx->hasSeek && fseeko(AH->FH, tpos, SEEK_SET) == 0) WriteToc(AH); -- nathan