Skip to content

Commit ddc9348

Browse files
committed
Merge trackpg/REL1_6_STABLE/pg18 into REL1_6_STABLE
Merges PR #529.
2 parents fc93da7 + 05d8b4e commit ddc9348

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pljava-so/src/main/c/VarlenaWrapper.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2023 Tada AB and other contributors, as listed below.
2+
* Copyright (c) 2018-2025 Tada AB and other contributors, as listed below.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the The BSD 3-Clause License
@@ -33,7 +33,11 @@
3333
#include "pljava/JNICalls.h"
3434

3535
#if PG_VERSION_NUM < 90600
36-
#define GetOldestSnapshot() NULL
36+
#define get_toast_snapshot() NULL
37+
#elif PG_VERSION_NUM < 180000
38+
#define get_toast_snapshot() GetOldestSnapshot()
39+
#else
40+
#include <access/toast_internals.h>
3741
#endif
3842

3943
#define _VL_TYPE struct varlena *
@@ -145,7 +149,7 @@ jobject pljava_VarlenaWrapper_Input(
145149
goto justDetoastEagerly;
146150
if ( VARATT_IS_EXTERNAL_ONDISK(vl) )
147151
{
148-
pin = GetOldestSnapshot();
152+
pin = get_toast_snapshot();
149153
if ( NULL == pin )
150154
{
151155
/*

0 commit comments

Comments
 (0)