mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
Revert: Allow locking updated tuples in tuple_update() and tuple_delete()
This commit reverts87985cc925and818861eb57per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de
This commit is contained in:
@@ -287,23 +287,16 @@ simple_table_tuple_insert(Relation rel, TupleTableSlot *slot)
|
||||
* via ereport().
|
||||
*/
|
||||
void
|
||||
simple_table_tuple_delete(Relation rel, ItemPointer tid, Snapshot snapshot,
|
||||
TupleTableSlot *oldSlot)
|
||||
simple_table_tuple_delete(Relation rel, ItemPointer tid, Snapshot snapshot)
|
||||
{
|
||||
TM_Result result;
|
||||
TM_FailureData tmfd;
|
||||
int options = TABLE_MODIFY_WAIT; /* wait for commit */
|
||||
|
||||
/* Fetch old tuple if the relevant slot is provided */
|
||||
if (oldSlot)
|
||||
options |= TABLE_MODIFY_FETCH_OLD_TUPLE;
|
||||
|
||||
result = table_tuple_delete(rel, tid,
|
||||
GetCurrentCommandId(true),
|
||||
snapshot, InvalidSnapshot,
|
||||
options,
|
||||
&tmfd, false /* changingPart */ ,
|
||||
oldSlot);
|
||||
true /* wait for commit */ ,
|
||||
&tmfd, false /* changingPart */ );
|
||||
|
||||
switch (result)
|
||||
{
|
||||
@@ -342,24 +335,17 @@ void
|
||||
simple_table_tuple_update(Relation rel, ItemPointer otid,
|
||||
TupleTableSlot *slot,
|
||||
Snapshot snapshot,
|
||||
TU_UpdateIndexes *update_indexes,
|
||||
TupleTableSlot *oldSlot)
|
||||
TU_UpdateIndexes *update_indexes)
|
||||
{
|
||||
TM_Result result;
|
||||
TM_FailureData tmfd;
|
||||
LockTupleMode lockmode;
|
||||
int options = TABLE_MODIFY_WAIT; /* wait for commit */
|
||||
|
||||
/* Fetch old tuple if the relevant slot is provided */
|
||||
if (oldSlot)
|
||||
options |= TABLE_MODIFY_FETCH_OLD_TUPLE;
|
||||
|
||||
result = table_tuple_update(rel, otid, slot,
|
||||
GetCurrentCommandId(true),
|
||||
snapshot, InvalidSnapshot,
|
||||
options,
|
||||
&tmfd, &lockmode, update_indexes,
|
||||
oldSlot);
|
||||
true /* wait for commit */ ,
|
||||
&tmfd, &lockmode, update_indexes);
|
||||
|
||||
switch (result)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user