Subject: [PATCH] Simplify ExecWithoutOverlapsNotEmpty by removing unused parameter

From: "zengman" <[email-masked]>
Date: Tue, 24 Feb 2026 23:09:07 +0800

Hi all,

I noticed that ExecWithoutOverlapsNotEmpty() accepts an atttypid parameter that isn't actually used. The function only needs typtype to distinguish between range and multirange types.
Currently lookup_type_cache() is called just to extract typtype, but I think using get_typtype() directly seems more appropriate.

```
 static void ExecWithoutOverlapsNotEmpty(Relation rel, NameData attname, Datum attval,
-                                                                               char typtype, Oid atttypid);
+                                                                               char typtype);
 
 /* ----------------------------------------------------------------
  *             ExecOpenIndices
@@ -753,11 +754,10 @@ check_exclusion_or_unique_constraint(Relation heap, Relation index,
                {
                        TupleDesc       tupdesc = RelationGetDescr(heap);
                        Form_pg_attribute att = TupleDescAttr(tupdesc, attno - 1);
-                       TypeCacheEntry *typcache = lookup_type_cache(att->atttypid, 0);
 
                        ExecWithoutOverlapsNotEmpty(heap, att->attname,
                                                                                values[indnkeyatts - 1],
-                                                                               typcache->typtype, att->atttypid);
+                                                                               get_typtype(att->atttypid));
                }
        }
 
@@ -1149,7 +1149,7 @@ index_expression_changed_walker(Node *node, Bitmapset *allUpdatedCols)
  * range or multirange in the given attribute.
  */
 static void
-ExecWithoutOverlapsNotEmpty(Relation rel, NameData attname, Datum attval, char typtype, Oid atttypid)
+ExecWithoutOverlapsNotEmpty(Relation rel, NameData attname, Datum attval, char typtype)
 {
        bool            isempty;
        RangeType  *r;
```

--
regards,
Man Zeng

---

From: Zsolt Parragi <[email-masked]>
Date: Tue, 24 Feb 2026 17:13:09 +0000

Hello!

Looks good to me!

My only comment is that it could use a proper commit message
explaining the changes.