Re: INSERT ... ON CONFLICT doesn't work

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jenda Krynicky" <Jenda(at)Krynicky(dot)cz>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: INSERT ... ON CONFLICT doesn't work
Date: 2021-12-01 20:15:09
Message-ID: 1991643.1638389709@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Jenda Krynicky" <Jenda(at)Krynicky(dot)cz> writes:
> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2021-12-01 20:19:28 Re: INSERT ... ON CONFLICT doesn't work
Previous Message Jenda Krynicky 2021-12-01 20:04:27 Re: INSERT ... ON CONFLICT doesn't work