Re: "INSERT ON CONFLICT UPDATE" - Use of indexes ?

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: "INSERT ON CONFLICT UPDATE" - Use of indexes ?
Дата
Msg-id 06a075d8-68d2-601b-d312-db1d7f6db4f5@gmx.net
обсуждение исходный текст
Ответ на "INSERT ON CONFLICT UPDATE" - Use of indexes ?  (Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>)
Список pgsql-general
Laura Smith schrieb am 08.06.2020 um 14:42:
> Hi,
>
> What'st the current state of play with indexes and ON CONFLICT ?  The docs seem to vaguely suggest it is possible,
butthis SO question (https://stackoverflow.com/questions/38945027/) seems to suggest it is not. 
>
> I've got a unique named index on a table (i.e. "create unique index xyz...") but I cannot seem to be able to refer to
itin a function ? 
> ON CONFLICT (index_name) .... : does not work
> ON CONFLICT ON CONSTRAINT index_name....: does not work

If c1 and c2 make up a unique index, then

    ON CONFLICT (c1, c2)

works





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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: "INSERT ON CONFLICT UPDATE" - Use of indexes ?
Следующее
От: Ron
Дата:
Сообщение: Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...]