From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Robustify pg_column_is_updatable() against overly large attnums
Date: Wed, 18 Nov 2026 20:09:29 +0000
Message-ID: <E1xTlyC-00000000I0e-43Rc@gemulon.postgresql.org> (raw)
Robustify pg_column_is_updatable() against overly large attnums
Passing an attnum sufficiently close to PG_INT16_MAX could wrap
AttrNumber when offsetting for FirstLowInvalidHeapAttributeNumber,
leading to an attempt to build a Bitmapset with a negative member value
resulting in an ERROR, rather than returning the result as it would for
other nonexistent columns.
Upgrade the type used to 32-bit to avoid this issue.
Bug: #19904
Reported-by: Zheng Hacker <hackerzheng666@gmail.com>
Discussion: https://postgr.es/m/19904-57a44a8aa7638ae4@postgresql.org
Backpatch-through: 15
Branch
------
REL_17_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/94280519a071f33198169066a4d7372c11523a84
Modified Files
--------------
src/backend/utils/adt/misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: drowley@postgresql.org
Subject: Re: pgsql: Robustify pg_column_is_updatable() against overly large attnums
In-Reply-To: <E1xTlyC-00000000I0e-43Rc@gemulon.postgresql.org>
References: <E1xTlyC-00000000I0e-43Rc@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox