Re: PG12 change to DO UPDATE SET column references

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PG12 change to DO UPDATE SET column references
Дата
Msg-id 3212457.1705791466@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PG12 change to DO UPDATE SET column references  (James Coleman <jtc331@gmail.com>)
Ответы Re: PG12 change to DO UPDATE SET column references  (James Coleman <jtc331@gmail.com>)
Список pgsql-hackers
James Coleman <jtc331@gmail.com> writes:
> On Sat, Jan 20, 2024 at 12:59 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> A HINT if the bogus column name (1) matches the relation name and
>> (2) is field-qualified seems plausible to me.  Then it's pretty
>> likely to be a user misunderstanding about whether to write the
>> relation name.

> Attached is a patch to do just that. We could also add tests for
> regular UPDATEs if you think that's useful.

Pushed with minor alterations:

1. I think our usual style for conditional hints is to use a ternary
expression within the ereport, rather than duplicating code.  In this
case that way allows not touching any of the existing lines, making
review easier.

2. I thought we should test the UPDATE case as well as the ON CONFLICT
case, but I didn't think we needed quite as many tests as you had
here.  I split up the responsibility so that one test covers the
alias case and the other the no-alias case.

            regards, tom lane



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Make documentation builds reproducible
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Make documentation builds reproducible