summaryrefslogtreecommitdiff
path: root/src/backend/access/heap/tuptoaster.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/heap/tuptoaster.c')
-rw-r--r--src/backend/access/heap/tuptoaster.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c
index 83834e0c2f5..5fa9018c7dc 100644
--- a/src/backend/access/heap/tuptoaster.c
+++ b/src/backend/access/heap/tuptoaster.c
@@ -1650,7 +1650,9 @@ toast_delete_datum(Relation rel, Datum value)
/* ----------
* toastrel_valueid_exists -
*
- * Test whether a toast value with the given ID exists in the toast relation
+ * Test whether a toast value with the given ID exists in the toast relation.
+ * For safety, we consider a value to exist if there are either live or dead
+ * toast rows with that ID; see notes for GetNewOid().
* ----------
*/
static bool
@@ -1682,7 +1684,7 @@ toastrel_valueid_exists(Relation toastrel, Oid valueid)
*/
toastscan = systable_beginscan(toastrel,
RelationGetRelid(toastidxs[validIndex]),
- true, SnapshotToast, 1, &toastkey);
+ true, SnapshotAny, 1, &toastkey);
if (systable_getnext(toastscan) != NULL)
result = true;