Re: UPSERT on partition

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: UPSERT on partition
Дата
Msg-id 20150624144518.GR4797@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: UPSERT on partition  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On 2015-06-24 10:38:38 -0400, Robert Haas wrote:
> On Wed, Jun 24, 2015 at 10:29 AM, Andres Freund <andres@anarazel.de> wrote:
> > On 2015-06-24 23:05:45 +0900, Fujii Masao wrote:
> >> INSERT ON CONFLICT DO UPDATE doesn't seem to work on the current partitioning
> >> mechanism. For example, in the following SQL commands, the last UPSERT command
> >> would fail with an error. The error message is
> >
> > I think that's pretty much inevitable without baking in touple routing
> > into the core system and supporting unique-constraints that span
> > partitions. In other words, I don't think this is upsert's fault.
> 
> Is the root of the problem that the trigger is called for an INSERT ..
> ON CONFLICT statement but it turns that into a plain INSERT?

If you'd not do that, you'd avoid errors when violating a unique key
inside a partition, so it'd help a bit.

But it'd not do anything sane when the conflict is actually *not*
aligned with the partitioning schema, because we'll obviously only
search for conflicts within the one table.

Greetings,

Andres Freund



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Removing SSL renegotiation (Was: Should we back-patch SSL renegotiation fixes?)
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Should we back-patch SSL renegotiation fixes?