diff options
author | Vadim B. Mikheev <vadim4o@yahoo.com> | 1999-01-29 09:23:17 +0000 |
---|---|---|
committer | Vadim B. Mikheev <vadim4o@yahoo.com> | 1999-01-29 09:23:17 +0000 |
commit | e3a1ab764ef2ce1f331133b456879ae4c186558a (patch) | |
tree | 4c7b1cb9d72c05c9c008106ca431abdd06c4b956 /src/backend/commands | |
parent | 3e2f87f3f35e721935643044c6366ae969e544ac (diff) | |
download | postgresql-e3a1ab764ef2ce1f331133b456879ae4c186558a.tar.gz postgresql-e3a1ab764ef2ce1f331133b456879ae4c186558a.zip |
READ COMMITTED isolevel is implemented and is default now.
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/trigger.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 41bd59ca0d4..a5e27227cf2 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -28,6 +28,7 @@ #include "utils/inval.h" #include "utils/builtins.h" #include "utils/syscache.h" +#include "executor/executor.h" #ifndef NO_SECURITY #include "miscadmin.h" @@ -790,6 +791,8 @@ ExecARUpdateTriggers(EState *estate, ItemPointer tupleid, HeapTuple newtuple) return; } +extern TupleTableSlot *EvalPlanQual(EState *estate, Index rti, ItemPointer tid); + static HeapTuple GetTupleForTrigger(EState *estate, ItemPointer tid, bool before) { @@ -806,6 +809,7 @@ GetTupleForTrigger(EState *estate, ItemPointer tid, bool before) * mark tuple for update */ tuple.t_self = *tid; +ltrmark:; test = heap_mark4update(relation, &tuple, &buffer); switch (test) { @@ -820,8 +824,23 @@ GetTupleForTrigger(EState *estate, ItemPointer tid, bool before) ReleaseBuffer(buffer); if (XactIsoLevel == XACT_SERIALIZABLE) elog(ERROR, "Can't serialize access due to concurrent update"); - else - elog(ERROR, "Isolation level %u is not supported", XactIsoLevel); + else if (!(ItemPointerEquals(&(tuple.t_self), tid))) + { + TupleTableSlot *slot = EvalPlanQual(estate, + estate->es_result_relation_info->ri_RangeTableIndex, + &(tuple.t_self)); + + if (!(TupIsNull(slot))) + { + *tid = tuple.t_self; + goto ltrmark; + } + } + /* + * if tuple was deleted or PlanQual failed + * for updated tuple - we have not process + * this tuple! + */ return(NULL); default: |