Re: PG12 change to DO UPDATE SET column references - Mailing list pgsql-hackers

From James Coleman
Subject Re: PG12 change to DO UPDATE SET column references
Date
Msg-id CAAaqYe_C1Z2cUhX2QdGjbhMOcEpkHj7qw2zQH1e9zX+b+LMYWA@mail.gmail.com
Whole thread Raw
In response to Re: PG12 change to DO UPDATE SET column references  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: PG12 change to DO UPDATE SET column references
List pgsql-hackers
On Fri, Jan 19, 2024 at 1:53 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
>
> On Fri, Jan 19, 2024 at 10:01 AM James Coleman <jtc331@gmail.com> wrote:
>>
>> Making this more confusing is the fact that if I want to do something
>> like "SET bar = foo.bar + 1" the table qualification cannot be present
>> on the setting column but is required on the reading column.
>>
>> There isn't anything in the docs that I see about this, and I don't
>> see anything scanning the release notes for PG12 either (though I
>> could have missed a keyword to search for).
>>
>
> https://www.postgresql.org/docs/12/sql-insert.html
>
> "When referencing a column with ON CONFLICT DO UPDATE, do not include the table's name in the specification of a
targetcolumn. For example, INSERT INTO table_name ... ON CONFLICT DO UPDATE SET table_name.col = 1 is invalid (this
followsthe general behavior for UPDATE)." 
>
> The same text exists for v11.

Well, egg on my face for definitely missing that in the docs.

Unfortunately that doesn't explain why it works on PG11 and not on PG12.

Regards,
James Coleman



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Synchronizing slots from primary to standby
Next
From: "David G. Johnston"
Date:
Subject: Re: PG12 change to DO UPDATE SET column references