Skip to content

Conversation

@jcflack
Copy link
Contributor

@jcflack jcflack commented May 26, 2025

When VarlenaWrapper wants to save a TOASTed value that may possibly be wanted later, it can use the least memory if it just retains the TOAST pointer and registers a current snapshot in which it is visible. In PG 9.6, a GetOldestSnapshot function appeared and made that possible. As of PG 18, with postgres/postgres@4d82750, that function has vanished, but there is a new one, get_toast_snapshot, that appears to fit the bill. It's only declared in access/toast_internals.h, though, which isn't otherwise needed.

Addresses #524.

When VarlenaWrapper wants to save a TOASTed value that may possibly
be wanted later, it can use the least memory if it just retains the
TOAST pointer and registers a current snapshot in which it is visible.
In PG 9.6, a GetOldestSnapshot function appeared and made that possible.
As of PG 18, with postgres/postgres@4d82750, that function has vanished,
but there is a new one, get_toast_snapshot, that appears to fit the bill.
It's only declared in access/toast_internals.h, though, which isn't
otherwise needed.

Addresses #524.
@jcflack jcflack changed the title GetOldestSnapshot -> get_toast_snapshot Changes needed for PG 18 May 27, 2025
@jcflack jcflack merged commit ddc9348 into REL1_6_STABLE May 27, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants