v1-0005-Add-catcache-support-for-OID8OID.patch
text/plain
Filename: v1-0005-Add-catcache-support-for-OID8OID.patch
Type: text/plain
Part: 4
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v1-0005
Subject: Add catcache support for OID8OID
| File | + | − |
|---|---|---|
| src/backend/utils/cache/catcache.c | 17 | 0 |
From 881df941bdebe7287e7132e53408a689f9e895d2 Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@paquier.xyz>
Date: Wed, 13 Aug 2025 20:00:30 +0900
Subject: [PATCH v1 05/11] Add catcache support for OID8OID
This is required to be able to do catalog cache lookups of oid8 fields
for toast values of the same type.
---
src/backend/utils/cache/catcache.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index a8e7bf649d23..9afd8dee5c1a 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -248,6 +248,18 @@ int4hashfast(Datum datum)
return murmurhash32((int32) DatumGetInt32(datum));
}
+static bool
+oid8eqfast(Datum a, Datum b)
+{
+ return DatumGetObjectId8(a) == DatumGetObjectId8(b);
+}
+
+static uint32
+oid8hashfast(Datum datum)
+{
+ return murmurhash64(DatumGetObjectId8(datum));
+}
+
static bool
texteqfast(Datum a, Datum b)
{
@@ -311,6 +323,11 @@ GetCCHashEqFuncs(Oid keytype, CCHashFN *hashfunc, RegProcedure *eqfunc, CCFastEq
*fasteqfunc = int4eqfast;
*eqfunc = F_INT4EQ;
break;
+ case OID8OID:
+ *hashfunc = oid8hashfast;
+ *fasteqfunc = oid8eqfast;
+ *eqfunc = F_OID8EQ;
+ break;
case TEXTOID:
*hashfunc = texthashfast;
*fasteqfunc = texteqfast;
--
2.54.0