Re: INSERT ... ON CONFLICT doesn't work - Mailing list pgsql-general

From Tom Lane
Subject Re: INSERT ... ON CONFLICT doesn't work
Date
Msg-id 1991643.1638389709@sss.pgh.pa.us
Whole thread Raw
In response to Re: INSERT ... ON CONFLICT doesn't work  ("Jenda Krynicky" <Jenda@Krynicky.cz>)
List pgsql-general
"Jenda Krynicky" <Jenda@Krynicky.cz> writes:
> From:               Tom Lane <tgl@sss.pgh.pa.us>
>> It's also possible to qualify the name in the ON CONFLICT clause,
>> although I think you have to parenthesize it to do so:
>> ... ON CONFLICT (("Lockers"."Uuid"))

> ERROR:  invalid reference to FROM-clause entry for table "Lockers"
> LINE 3:         ON CONFLICT (("Lockers"."Uuid"))
>                               ^
> HINT:  There is an entry for table "Lockers", but it cannot be
> referenced from this part of the query.

Hmm, sorry, I'd tested that in HEAD, but it seems not to work in v13.
Looking closer, I think it was a not-mentioned-in-the-commit-log
side-effect of [1].  Anyway, seems like you need to fall back on
variable_conflict in v13.

            regards, tom lane

[1] https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=6c0373ab7



pgsql-general by date:

Previous
From: "Jenda Krynicky"
Date:
Subject: Re: INSERT ... ON CONFLICT doesn't work
Next
From: "David G. Johnston"
Date:
Subject: Re: INSERT ... ON CONFLICT doesn't work