pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Maintain RelIdToTypeIdCacheHash in TypeCacheOpcCallback()
Date: Wed, 23 Apr 2025 17:27:39 +0000
Message-ID: <E1u7dsp-001RGh-1o@gemulon.postgresql.org> (raw)

Maintain RelIdToTypeIdCacheHash in TypeCacheOpcCallback()

b85a9d046efd introduced a new RelIdToTypeIdCacheHash, whose entries should
exist for typecache entries with TCFLAGS_HAVE_PG_TYPE_DATA flag set or any
of TCFLAGS_OPERATOR_FLAGS set or tupDesc set.  However, TypeCacheOpcCallback(),
which resets TCFLAGS_OPERATOR_FLAGS, was forgotten to update
RelIdToTypeIdCacheHash.

This commit adds a delete_rel_type_cache_if_needed() call to the
TypeCacheOpcCallback() function to maintain RelIdToTypeIdCacheHash after
resetting TCFLAGS_OPERATOR_FLAGS.

Also, this commit fixes the name of the delete_rel_type_cache_if_needed()
function in its mentions in the comments.

Reported-by: Noah Misch
Discussion: https://postgr.es/m/20250411203241.e9.nmisch%40google.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bb78e4267817b5c1f5a8ff5b0b93fe756e514bb0

Modified Files
--------------
src/backend/utils/cache/typcache.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)



Message-ID: <E1u7dsp-001RGh-1o@gemulon.postgresql.org>
Permalink:  ../E1u7dsp-001RGh-1o@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1u7dsp-001RGh-1o@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Maintain RelIdToTypeIdCacheHash in TypeCacheOpcCallback()
  In-Reply-To: <E1u7dsp-001RGh-1o@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox