On Tue, 17 Nov 2026 at 00:45, PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
> create table tt(a int, b text);
> select pg_column_is_updatable('tt'::regclass, 32767::smallint, true);
> ERROR: negative bitmapset member not allowed
So don't do that?
We could fix by just promoting the AttrNumber to int with:
--- a/src/backend/utils/adt/misc.c
+++ b/src/backend/utils/adt/misc.c
@@ -639,7 +639,7 @@ pg_column_is_updatable(PG_FUNCTION_ARGS)
{
Oid reloid = PG_GETARG_OID(0);
AttrNumber attnum = PG_GETARG_INT16(1);
- AttrNumber col = attnum - FirstLowInvalidHeapAttributeNumber;
+ int col = attnum -
FirstLowInvalidHeapAttributeNumber;
bool include_triggers = PG_GETARG_BOOL(2);
That avoids overflowing the int16 when subtracting the -7
David