CheckNNConstraintFetch: Fill all of ConstrCheck in a single pass
Álvaro Herrera <alvherre@kurilemu.de>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/cache/relcache.c | modified | +6 −6 |
Discussion
- Avoid overwiriting cache entry (src/backend/utils/cache/relcache.c) 4 messages · 2025-08-26 → 2025-10-29