pgsql: Don't call CheckAttributeType() with InvalidOid on dropped cols

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't call CheckAttributeType() with InvalidOid on dropped cols
Date: 2026-04-23 18:48:42
Message-ID: E1wFz6P-002NKR-1f@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't call CheckAttributeType() with InvalidOid on dropped cols

If CheckAttributeType() is called with InvalidOid, it performs a bunch
of pointless, futile syscache lookups with InvalidOid, but ultimately
tolerates it and has no effect. We were calling it with InvalidOid on
dropped columns, but it seems accidental that it works, so let's stop
doing it.

Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/93ce56cd-02a6-4db1-8224-c8999372facc@iki.fi
Backpatch-through: 14

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/01db3f0398fd2e75569473fc910de5d76d1088b7

Modified Files
--------------
src/backend/catalog/heap.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-04-23 19:53:05 pgsql: Add missing source files to several nls.mk
Previous Message Álvaro Herrera 2026-04-23 10:59:38 pgsql: Move REPACK (CONCURRENTLY) test out of stock regression tests