Re: BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition

From: Andy S <gatekeeper(dot)mail(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition
Date: 2020-11-18 23:49:20
Message-ID: CAFAcjJNU+2Eyx_s381ADrMjcBpZKTPATYaj=cdntiGEmoByVZw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Oh! What a gem I mined in sources:

branch: REL_11_STABLE
src/backend/executor/nodeModifyTable.c:
* BEFORE ROW INSERT Triggers.
*
* Note: We fire BEFORE ROW TRIGGERS for every attempted insertion
in an
* INSERT ... ON CONFLICT statement. We cannot check for constraint
* violations before firing these triggers, because they can change
the
* values to insert. Also, they can run arbitrary user-defined
code with
* side-effects that we can't cancel by just not inserting the
tuple.
*/

Still not the place where ON CONFLICT could be validated on per-row basis?

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-11-18 23:55:44 BUG #16726: Invalid input syntax is not a useful error message
Previous Message Andres Freund 2020-11-18 23:05:29 Re: BUG #16722: PG hanging on COPY when table has close to 2^32 toasts in the table.