Re: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause
Дата
Msg-id CAKFQuwbnETbhnBYtMA8HNJwf0ipwAETd58=K0JzPs22Of2ZhcA@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Saturday, October 16, 2021, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      17233
Logged by:          Alexander Korolev
Email address:      lxndrkrlv@gmail.com
PostgreSQL version: 14.0
Operating system:   Windows
Description:       

This SELECT command fails as expected:
SELECT CTID FROM tmp1 INNER JOIN tmp2 ON tmp1.id = tmp2.id FOR UPDATE;
-- ERROR: column "ctid" does not exist.

But if I use same SELECT in WHERE clause of DELETE command
DELETE FROM tmp1 WHERE CTID in (
    SELECT CTID FROM tmp1 INNER JOIN tmp2 ON tmp1.id = tmp2.id FOR
UPDATE);
this command is executed without errors.

This is not a bug:


The virtual join table doesn’t have a ctid, only physical tables do, and the ctid of physical tables apparently aren’t propogated when they are joined.

David J.

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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause