From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: CheckNNConstraintFetch: Fill all of ConstrCheck in a single pass
Date: Wed, 29 Oct 2025 10:49:26 +0000
Message-ID: <E1vE3k6-0044CA-0p@gemulon.postgresql.org> (raw)
CheckNNConstraintFetch: Fill all of ConstrCheck in a single pass
Previously, we'd fill all fields except ccbin, and only later obtain and
detoast ccbin, with hypothetical failures being possible. If ccbin is
null (rare catalog corruption I have never witnessed) or its a corrupted
toast entry, we leak a tiny bit of memory in CacheMemoryContext from
having strdup'd the constraint name. Repair these by only attempting to
fill the struct once ccbin has been detoasted.
Author: Ranier Vilela <ranier.vf@gmail.com>
Discussion: https://postgr.es/m/CAEudQAr=i3_Z4GvmediX900+sSySTeMkvuytYShhQqEwoGyvhA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/94f95d91b025cb6752b4118bb0b30851e3d64df9
Modified Files
--------------
src/backend/utils/cache/relcache.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: CheckNNConstraintFetch: Fill all of ConstrCheck in a single pass
In-Reply-To: <E1vE3k6-0044CA-0p@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