Re: 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
Дата
Msg-id 1409812.1634481258@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-bugs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> 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.

We leave the system columns out of the join because otherwise they'd
surely conflict between the two sides of the join.  However, you could
still reference either one with "tmp1.ctid" or "tmp2.ctid".

There might be an opportunity here to improve the error message's hint:

regression=# SELECT CTID
regression-# FROM tmp1
regression-# INNER JOIN tmp2 ON tmp1.id = tmp2.id;
ERROR:  column "ctid" does not exist
LINE 1: SELECT CTID
               ^
HINT:  There is a column named "ctid" in table "tmp1", but it cannot be referenced from this part of the query.

"cannot be referenced" is probably a shade misleading, given the
availability of the qualified-name alternative.

            regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: 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