mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Rename some toasting functions based on whether they are heap-specific.
The old names for the attribute-detoasting functions names included
the word "heap," which seems outdated now that the heap is only one of
potentially many table access methods.
On the other hand, toast_insert_or_update and toast_delete are
heap-specific, so rename them by adding "heap_" as a prefix.
Not all of the work of making the TOAST system fully accessible to AMs
other than the heap is done yet, but there seems to be little harm in
getting this renaming out of the way now. Commit
8b94dab066
already divided up the
functions among various files partially according to whether it was
intended that they should be heap-specific or AM-agnostic, so this is
just clarifying the division contemplated by that commit.
Patch by me, reviewed and tested by Prabhat Sabu, Thomas Munro,
Andres Freund, and Álvaro Herrera.
Discussion: http://postgr.es/m/CA+TgmoZv-=2iWM4jcw5ZhJeL18HF96+W1yJeYrnGMYdkFFnEpQ@mail.gmail.com
This commit is contained in:
@ -2085,7 +2085,7 @@ heap_prepare_insert(Relation relation, HeapTuple tup, TransactionId xid,
|
||||
return tup;
|
||||
}
|
||||
else if (HeapTupleHasExternal(tup) || tup->t_len > TOAST_TUPLE_THRESHOLD)
|
||||
return toast_insert_or_update(relation, tup, NULL, options);
|
||||
return heap_toast_insert_or_update(relation, tup, NULL, options);
|
||||
else
|
||||
return tup;
|
||||
}
|
||||
@ -2809,7 +2809,7 @@ l1:
|
||||
Assert(!HeapTupleHasExternal(&tp));
|
||||
}
|
||||
else if (HeapTupleHasExternal(&tp))
|
||||
toast_delete(relation, &tp, false);
|
||||
heap_toast_delete(relation, &tp, false);
|
||||
|
||||
/*
|
||||
* Mark tuple for invalidation from system caches at next command
|
||||
@ -3504,7 +3504,7 @@ l2:
|
||||
if (need_toast)
|
||||
{
|
||||
/* Note we always use WAL and FSM during updates */
|
||||
heaptup = toast_insert_or_update(relation, newtup, &oldtup, 0);
|
||||
heaptup = heap_toast_insert_or_update(relation, newtup, &oldtup, 0);
|
||||
newtupsize = MAXALIGN(heaptup->t_len);
|
||||
}
|
||||
else
|
||||
@ -5673,7 +5673,7 @@ heap_abort_speculative(Relation relation, ItemPointer tid)
|
||||
if (HeapTupleHasExternal(&tp))
|
||||
{
|
||||
Assert(!IsToastRelation(relation));
|
||||
toast_delete(relation, &tp, true);
|
||||
heap_toast_delete(relation, &tp, true);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user