Re: Better error message for a small problem with WITH RECURSIVE
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Better error message for a small problem with WITH RECURSIVE |
| Дата | |
| Msg-id | 27619.1223470240@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Better error message for a small problem with WITH RECURSIVE (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>) |
| Список | pgsql-hackers |
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Yes, please. At least DB2 allows recursive queries without the
> "RECURSIVE" keyword, just "WITH" is enough. Without a hint, anyone
> migrating from such a system will spend hours looking at the query,
> seeing nothing wrong.
Huh, interesting ... so they're violating the letter of the spec
as to WITH name scope.
Anyway, here's what we do as of last night:
regression=# with q(x) as (select 1 union all select x+1 from q where x<10)
select * from q;
ERROR: relation "q" does not exist
LINE 1: with q(x) as (select 1 union all select x+1 from q where x<1...
^
DETAIL: There is a WITH item named "q", but it cannot be referenced from this part of the query.
HINT: Use WITH RECURSIVE, or re-order the WITH items to remove forward references.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера