Re: surprising trigger/foreign key interaction
От | Alvaro Herrera |
---|---|
Тема | Re: surprising trigger/foreign key interaction |
Дата | |
Msg-id | 20090812222605.GP5721@alvh.no-ip.org обсуждение исходный текст |
Ответ на | Re: surprising trigger/foreign key interaction (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: surprising trigger/foreign key interaction
|
Список | pgsql-hackers |
Tom Lane wrote: > Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes: > > the "surprise" here was that the delete is getting silently surpressed > > even though the original Qual still holds and afaik should result in the > > row deleted. > > The delete from foo acts first (since you put it in a BEFORE trigger). > After the trigger comes back, the outer delete finds itself trying > to delete a row that was already updated by a later-starting command in > the same transaction. Hmm, I misread the code when talking to Stefan on IM. I followed the path that heap_update returns HeapTupleUpdated, which proceeds to do EvalPlanQual and attempt to update the updated version of the row. However I'm guessing that what actually happens is that heap_update is returning HeapTupleSelfUpdated instead, which the code states as /* nothing to do */. I imagine this is so because of some old fiddling to get semantics just right for obscure corner cases, but it feels wrong nevertheless. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support
В списке pgsql-hackers по дате отправления: