v2-0001-Use-UInt16GetDatum-for-stategy-number-access.patch
application/octet-stream
Filename: v2-0001-Use-UInt16GetDatum-for-stategy-number-access.patch
Type: application/octet-stream
Part: 1
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 v2-0001
Subject: Use UInt16GetDatum for stategy number access.
| File | + | − |
|---|---|---|
| contrib/pg_buffercache/pg_buffercache_pages.c | 1 | 1 |
| src/backend/access/brin/brin_inclusion.c | 1 | 1 |
| src/backend/access/brin/brin_minmax.c | 1 | 1 |
| src/backend/access/brin/brin_minmax_multi.c | 1 | 1 |
| src/backend/access/gist/gistget.c | 2 | 2 |
From f6104a9e39cb14c725ae46168044822e51ddbbc3 Mon Sep 17 00:00:00 2001 From: reshke <reshke@double.cloud> Date: Sun, 11 Jan 2026 11:57:04 +0000 Subject: [PATCH v2] Use UInt16GetDatum for stategy number access. --- contrib/pg_buffercache/pg_buffercache_pages.c | 2 +- src/backend/access/brin/brin_inclusion.c | 2 +- src/backend/access/brin/brin_minmax.c | 2 +- src/backend/access/brin/brin_minmax_multi.c | 2 +- src/backend/access/gist/gistget.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/pg_buffercache/pg_buffercache_pages.c b/contrib/pg_buffercache/pg_buffercache_pages.c index 0c58e4b265c..b682dca658b 100644 --- a/contrib/pg_buffercache/pg_buffercache_pages.c +++ b/contrib/pg_buffercache/pg_buffercache_pages.c @@ -276,7 +276,7 @@ pg_buffercache_pages(PG_FUNCTION_ARGS) nulls[5] = false; values[6] = BoolGetDatum(fctx->record[i].isdirty); nulls[6] = false; - values[7] = Int16GetDatum(fctx->record[i].usagecount); + values[7] = UInt16GetDatum(fctx->record[i].usagecount); nulls[7] = false; /* unused for v1.0 callers, but the array is always long enough */ values[8] = Int32GetDatum(fctx->record[i].pinning_backends); diff --git a/src/backend/access/brin/brin_inclusion.c b/src/backend/access/brin/brin_inclusion.c index 08890a3d009..5a2058d9aad 100644 --- a/src/backend/access/brin/brin_inclusion.c +++ b/src/backend/access/brin/brin_inclusion.c @@ -641,7 +641,7 @@ inclusion_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, Oid subtype, tuple = SearchSysCache4(AMOPSTRATEGY, ObjectIdGetDatum(opfamily), ObjectIdGetDatum(attr->atttypid), ObjectIdGetDatum(subtype), - Int16GetDatum(strategynum)); + UInt16GetDatum(strategynum)); if (!HeapTupleIsValid(tuple)) elog(ERROR, "missing operator %d(%u,%u) in opfamily %u", diff --git a/src/backend/access/brin/brin_minmax.c b/src/backend/access/brin/brin_minmax.c index 9d4e47b4dc0..73201029371 100644 --- a/src/backend/access/brin/brin_minmax.c +++ b/src/backend/access/brin/brin_minmax.c @@ -294,7 +294,7 @@ minmax_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, Oid subtype, tuple = SearchSysCache4(AMOPSTRATEGY, ObjectIdGetDatum(opfamily), ObjectIdGetDatum(attr->atttypid), ObjectIdGetDatum(subtype), - Int16GetDatum(strategynum)); + UInt16GetDatum(strategynum)); if (!HeapTupleIsValid(tuple)) elog(ERROR, "missing operator %d(%u,%u) in opfamily %u", diff --git a/src/backend/access/brin/brin_minmax_multi.c b/src/backend/access/brin/brin_minmax_multi.c index 6b86b1fd889..688ca9f2dbb 100644 --- a/src/backend/access/brin/brin_minmax_multi.c +++ b/src/backend/access/brin/brin_minmax_multi.c @@ -2932,7 +2932,7 @@ minmax_multi_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, Oid subtype, tuple = SearchSysCache4(AMOPSTRATEGY, ObjectIdGetDatum(opfamily), ObjectIdGetDatum(attr->atttypid), ObjectIdGetDatum(subtype), - Int16GetDatum(strategynum)); + UInt16GetDatum(strategynum)); if (!HeapTupleIsValid(tuple)) elog(ERROR, "missing operator %d(%u,%u) in opfamily %u", strategynum, attr->atttypid, subtype, opfamily); diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index 6d05a5fdc34..d6de8e954e8 100644 --- a/src/backend/access/gist/gistget.c +++ b/src/backend/access/gist/gistget.c @@ -222,7 +222,7 @@ gistindex_keytest(IndexScanDesc scan, key->sk_collation, PointerGetDatum(&de), key->sk_argument, - Int16GetDatum(key->sk_strategy), + UInt16GetDatum(key->sk_strategy), ObjectIdGetDatum(key->sk_subtype), PointerGetDatum(&recheck)); @@ -286,7 +286,7 @@ gistindex_keytest(IndexScanDesc scan, key->sk_collation, PointerGetDatum(&de), key->sk_argument, - Int16GetDatum(key->sk_strategy), + UInt16GetDatum(key->sk_strategy), ObjectIdGetDatum(key->sk_subtype), PointerGetDatum(&recheck)); *recheck_distances_p |= recheck; -- 2.43.0