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 1mxHEC-00073e-Gm for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Dec 2021 23:29:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxHE9-00015h-EA for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Dec 2021 23:28:57 +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 1mxHE9-00015Y-1k for pgsql-bugs@lists.postgresql.org; Tue, 14 Dec 2021 23:28:57 +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 1mxHE6-0003Nr-0T for pgsql-bugs@lists.postgresql.org; Tue, 14 Dec 2021 23:28:55 +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 1BENSqu8562710; Tue, 14 Dec 2021 18:28:52 -0500 From: Tom Lane To: Peter Geoghegan cc: Klaudie Willis , PostgreSQL mailing lists Subject: Re: When Update balloons memory In-reply-to: References: <3484560.1638889073@sss.pgh.pa.us> <189763.1639437451@sss.pgh.pa.us> <261065.1639497535@sss.pgh.pa.us> <377324.1639510427@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Tue, 14 Dec 2021 15:17:16 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <562708.1639524532.1@sss.pgh.pa.us> Date: Tue, 14 Dec 2021 18:28:52 -0500 Message-ID: <562709.1639524532@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Geoghegan writes: > On Tue, Dec 14, 2021 at 11:33 AM Tom Lane wrote: >> And, not to be too picky, but does this cope with the case where >> an indexed column is changed by a BEFORE trigger, not by the >> query proper? > No. It's much better to err in the direction of giving the hint, > rather than not giving the hint. In order for us to make the category > of error that seems like it might actually be a problem (not giving > the hint when we should), the BEFORE trigger would have to "undo" an > explicit change to an updated column. Uh ... it seems that you are writing as though "giving the hint" means saying that the column value changed. That seems quite confusingly backwards to me, as that is/ought to be the expected assumption. Maybe you should invert the flag state while you are at it. regards, tom lane