BUG #16653: Regression in CTE evaluation

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #16653: Regression in CTE evaluation
Дата
Msg-id 16653-3154c42c219f8693@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #16653: Regression in CTE evaluation  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16653
Logged by:          Yuri Cherio
Email address:      cherio@gmail.com
PostgreSQL version: 13.0
Operating system:   Ubuntu Linux 20.04
Description:

The following SQL worked in versions 9 through 12. It is throwing an error
in version 13.

CREATE TABLE test AS SELECT now() AS tstmp, 'value' AS val;

WITH exp_days AS (
    SELECT ''::TEXT AS days WHERE '' ~ E'^[-]?\\d+$'
)
SELECT test.*
FROM test
    CROSS JOIN exp_days
WHERE tstmp > date(current_date - CAST(exp_days.days || ' days' AS
interval));

I'd leave alone why this SQL looks ridiculous - it is a very, very
simplified case of more complex dynamic query. Statement "exp_days" returns
no rows and in previous versions the optimizer would not even try evaluating
WHERE in the final query. It doesn't seem to be the case starting version
13.


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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #16652: SELECT pg_reload_conf(); returning true despite loading config has failed
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #16653: Regression in CTE evaluation