Maintain RelIdToTypeIdCacheHash in TypeCacheOpcCallback()
Alexander Korotkov <akorotkov@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/cache/typcache.c | modified | +14 −2 |
Discussion
- type cache cleanup improvements 66 messages · 2024-02-29 → 2025-04-29