fiercetuba(at)protonmail(dot)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