pgsql: Cache by-reference missing values in a long lived context - Mailing list pgsql-committers

From Andrew Dunstan
Subject pgsql: Cache by-reference missing values in a long lived context
Date
Msg-id E1qYWt0-000Lym-6w@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Cache by-reference missing values in a long lived context

Attribute missing values might be needed past the lifetime of the tuple
descriptors from which they are extracted. To avoid possibly using
pointers for by-reference values which might thus be left dangling, we
cache a datumCopy'd version of the datum in the TopMemoryContext. Since
we first search for the value this only needs to be done once per
session for any such value.

Original complaint from Tom Lane, idea for mitigation by Andrew Dunstan,
tweaked by Tom Lane.

Backpatch to version 11 where missing values were introduced.

Discussion: https://postgr.es/m/1306569.1687978174@sss.pgh.pa.us

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/75f323aa1c1ec88f9781cb6d9307e42b820b26f0

Modified Files
--------------
src/backend/access/common/heaptuple.c | 90 ++++++++++++++++++++++++++++++++++-
src/tools/pgindent/typedefs.list      |  1 +
2 files changed, 90 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: pgsql: doc: PG 16 relnotes: separate out psql \drg item
Next
From: Andrew Dunstan
Date:
Subject: pgsql: Cache by-reference missing values in a long lived context