Re: BUG #14132: ON CONFLICT not inferring unique index with bigints

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14132: ON CONFLICT not inferring unique index with bigints
Дата
Msg-id 15186.1462977205@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #14132: ON CONFLICT not inferring unique index with bigints  (fiercetuba@protonmail.com)
Ответы Re: BUG #14132: ON CONFLICT not inferring unique index with bigints
Список pgsql-bugs
fiercetuba@protonmail.com writes:
> This fails, but change bigint to int and it works fine.

Looks like somebody forgot to run the ON CONFLICT list through
expression preprocessing.  Unfortunately it's too late to get
this fixed in tomorrow's releases :-(

As a workaround for this particular example, you could write either

INSERT INTO testtable(b, c)
VALUES (1, 2)
ON CONFLICT ((COALESCE(b, '0'::int8)), (COALESCE(c, '0'::int8))) DO NOTHING;

INSERT INTO testtable(b, c)
VALUES (1, 2)
ON CONFLICT ((COALESCE(b, '0')), (COALESCE(c, '0'))) DO NOTHING;

but in general there might not be any such easy solution.

            regards, tom lane

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