Re: BUG #15826: BUG: Where-Clause referring to iso-8859-1 column in CTEis ignored in Update-statement

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #15826: BUG: Where-Clause referring to iso-8859-1 column in CTEis ignored in Update-statement
Дата
Msg-id CAKFQuwZoWShttJ-zz357Kn+cdtkVBDhj+Ta+gqnR7gvvbnqavA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #15826: BUG: Where-Clause referring to iso-8859-1 column in CTEis ignored in Update-statement  (Pantelis Theodosiou <ypercube@gmail.com>)
Список pgsql-bugs
On Fri, May 31, 2019 at 4:06 AM Pantelis Theodosiou <ypercube@gmail.com> wrote:
On Fri, May 31, 2019 at 11:55 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      15826
Logged by:          Thomas Hantel
Email address:      tom.hantel@googlemail.com
PostgreSQL version: 11.3
Operating system:   Fedora Linux
Description:       

We are currently seeing the following unexpected effect:

In one of our services there is a statement that first sets up a CTE to
filter the data and then an UPDATE-statement that refers to that data. If
the WHERE-clause in the update refers to a column that is not selected in
the CTE, the whole clause is ignored so that all of the rows in the table
get updated.
[..]
We would expect an error to be thrown in all cases where undefined columns
are referenced.

This is not a bug. It may seem weird but it is expected behaviour under scope resolution.
The cte does not have an id column but dummy has, so it is used.

See also the FAQ entry for this question:


David J.
 

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

Предыдущее
От: Pantelis Theodosiou
Дата:
Сообщение: Re: BUG #15826: BUG: Where-Clause referring to iso-8859-1 column in CTEis ignored in Update-statement
Следующее
От: Juan José Santamaría Flecha
Дата:
Сообщение: Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails onWindows with Visual Studio 2017