Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMEo0-0003WM-Bs for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Mar 2021 18:52:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lMEnz-0003oS-9R for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Mar 2021 18:52:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMEnz-0003oL-2c for pgsql-hackers@lists.postgresql.org; Tue, 16 Mar 2021 18:52:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMEnw-0004Fm-Sv for pgsql-hackers@postgresql.org; Tue, 16 Mar 2021 18:52:34 +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 12GIqM7D3388161; Tue, 16 Mar 2021 14:52:22 -0400 From: Tom Lane To: Mark Dilger cc: Robert Haas , Noah Misch , Peter Geoghegan , Thomas Munro , "Andrey M. Borodin" , Stephen Frost , Michael Paquier , Amul Sul , Dilip Kumar , Andres Freund , PostgreSQL-development Subject: Re: pg_amcheck contrib application In-reply-to: References: <9E76E46A-48B2-4869-BD0C-422204C1F767@enterprisedb.com> <20210313184612.GA3195145@rfd.leadboat.com> <930621E5-5D10-456D-8CE4-CF629A6C4669@enterprisedb.com> <20210313191841.GB3195145@rfd.leadboat.com> <3012106.1615827854@sss.pgh.pa.us> <3053552.1615834640@sss.pgh.pa.us> <20210316060913.GA3323238@rfd.leadboat.com> <7BCE9084-9381-471F-90F2-FAD99B7FE3DB@enterprisedb.com> <3254547.1615910855@sss.pgh.pa.us> <7CFAF7EF-4EA7-4CB6-B2C7-EC7F4512AE50@enterprisedb.com> <16B79A18-48F3-404D-8DC5-53528E85A7AC@enterprisedb.com> <3360174.1615916917@sss.pgh.pa.us> Comments: In-reply-to Mark Dilger message dated "Tue, 16 Mar 2021 11:24:33 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3388159.1615920742.1@sss.pgh.pa.us> Date: Tue, 16 Mar 2021 14:52:22 -0400 Message-ID: <3388160.1615920742@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mark Dilger writes: > CopyStatistics seems to just copy Form_pg_statistic without regard for > who owns the toast. Is this safe? No less so than a ton of other places that insert values that might've come from on-disk storage. heap_toast_insert_or_update() is responsible for dealing with the problem. These days it looks like it's actually toast_tuple_init() that takes care of dereferencing previously-toasted values during an INSERT. regards, tom lane