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 1qv05Z-002Wox-Rq for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Oct 2023 18:55:45 +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 1qv05X-00E17n-UW for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Oct 2023 18:55:44 +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 1qv056-00DyRj-3O for pgsql-bugs@lists.postgresql.org; Mon, 23 Oct 2023 18:55:16 +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.94.2) (envelope-from ) id 1qv04z-001wu7-TB for pgsql-bugs@lists.postgresql.org; Mon, 23 Oct 2023 18:55:15 +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 39NIt8ZJ411085; Mon, 23 Oct 2023 14:55:08 -0400 From: Tom Lane To: Peter Geoghegan cc: Hans Buschmann , Amit Langote , "David G. Johnston" , "pgsql-bugs@lists.postgresql.org" Subject: Re: AW: AW: BUG #18147: ERROR: invalid perminfoindex 0 in RTE with relid xxxxx In-reply-to: References: <18147-6fc796538913ee88@postgresql.org> <2796464.1696525626@sss.pgh.pa.us> <9fdfed847859435e8641e613198be9e3@nidsa.net> <3319880.1696778678@sss.pgh.pa.us> <3c9fe737f6aa4ae9b0dc19bffd97e106@nidsa.net> <408285.1698085850@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Mon, 23 Oct 2023 11:49:20 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <411083.1698087308.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 23 Oct 2023 14:55:08 -0400 Message-ID: <411084.1698087308@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Geoghegan writes: > On Mon, Oct 23, 2023 at 11:30 AM Tom Lane wrote: >> If this is because it's "only a hint" and doesn't have to be reliable, >> okay, but the documentation around indexUnchanged utterly fails to >> make that clear. I fear some poor index AM writer is going to get >> screwed big time when they assume this flag is good for more than >> heuristic decisions about when to do noncritical maintenance. > That's fair, though note that index_unchanged_by_update does at least > own the fact that it ignores the effects of BEFORE triggers in code > comments. It also doesn't care about predicates in partial indexes, > for reasons that are fairly specific to the way that the hint is > actually used on the nbtree side. Yeah, there are comments within index_unchanged_by_update about those things. What I'm unhappy about is that indexam.sgml's discussion of the indexUnchanged flag makes it sound far more trustworthy than it actually is. Somebody who just read that doco and didn't scour the underlying code would be badly misled. regards, tom lane