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

From Andy S
Subject Re: BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition
Date
Msg-id CAFAcjJP2wmSU35b=XuOYd3x_HF123kmycrVwRkT4Chn37APKDA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition  (Andres Freund <andres@anarazel.de>)
Responses Re: BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition
List pgsql-bugs
On Sat, Nov 14, 2020 at 3:28 AM Andres Freund <andres@anarazel.de> wrote:
At best it is a potentially desirable feature. One that isn't trivial to
implement. We'd have to scan the entire partition tree to ensure there's
a matching constraint on all partitions. 
- BEFORE ROW triggers...
So, the engine does exactly what you say for each row to determine if the leaf partition has any BEFORE ROW triggers defined. Why not to use the chance to determine a certain applicable constraint set?

 
That is not generally the case. You can have parametrized values that
are inserted, and you can have multi-row inserts. In both cases you
cannot make this decision at plan time.

OK. Then I've mistaken, sorry for that. Still `uniq constraint violation` triggers even when it's not defined for the very table named in query.
 

pgsql-bugs by date:

Previous
From: Sergei Kornilov
Date:
Subject: Re: Data format mismatch between minor versions
Next
From: Magnus Hagander
Date:
Subject: Re: Data format mismatch between minor versions