Notice on BEFORE triggers and INSERT .. ON CONFLICT

From: sergey(at)melekhin(dot)me
To: pgsql-docs(at)postgresql(dot)org
Subject: Notice on BEFORE triggers and INSERT .. ON CONFLICT
Date: 2016-09-23 04:47:15
Message-ID: 20160923044715.1507.29275@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.5/static/plpgsql-trigger.html
Description:

Before insert on update or insert trigger will fire twice when insert .. on
conflict do update does the update part. First with TG_OP='INSERT' and then
with TG_OP='UPDATE'.
It is not very obvious behaviour, and I think it deserves a notice in
documentation.

Here is an example:
https://gist.github.com/C-Pro/ff0000aaeee469e8f57f232de422bba0

Browse pgsql-docs by date

  From Date Subject
Next Message atiris 2016-09-23 08:15:30 Missing type in example
Previous Message Bruce Momjian 2016-09-23 01:33:57 Re: Incorrect case in functions-textsearch