On Sunday 28 September 2014 09:33:06 Simon Riggs wrote: > On 28 September 2014 02:22, Shai Berger <s...@platonix.com> wrote: > > Upon reading the docs, I was a little surprised to see that in terms of > > triggers etc, the operation is always considered an INSERT. I would > > expect it to be considered an insert for BEFORE INSERT or INSTEAD OF > > INSERT triggers, but if conflict resolution turns it into an UPDATE, I'd > > expect to see it handled as an UPDATE from that point on (definitely > > INSTEAD OF UPDATE and AFTER UPDATE triggers, maybe even BEFORE UPDATE). > > That is the semantics we have now (this is a general remark, not > > particulary Django-oriented; Django does not use triggers on PG as far > > as I know, and only uses them elsewhere to implement serial keys). > > So it should act like this? > > BEFORE INSERT triggers fire > if CONFLICT then > { > BEFORE UPDATE triggers fire > perform UPDATE > AFTER UPDATE triggers fire > } > else > { > perform INSERT > AFTER INSERT triggers fire > } >
Yes, that's pretty much what I was expecting. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/201409281819.43635.shai%40platonix.com. For more options, visit https://groups.google.com/d/optout.