Common table expression - parsing questions

Поиск
Список
Период
Сортировка
От the6campbells
Тема Common table expression - parsing questions
Дата
Msg-id 22431f1b0909281954t21cffc94o291002fe6b545494@mail.gmail.com
обсуждение исходный текст
Ответы Re: Common table expression - parsing questions  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-sql
Couple of questions:
 
1. Why does Postgres not throw a parsing error during sqlPrepare for this statement vs at sqlExecute
 
with t_cte ( c1, ctr ) as (
select 1,0 from tversion union
select 2,0 from tversion union all
select c1, ctr + 1 from t_cte where c1=1 and ctr < 5 union all
select c1, ctr + 1 from t_cte where c1=2 and ctr < 5)
select c1, ctr from t_cte
 
2. Do you intend to remove the requirement to include the recursive keyword - as other vendors allow

3. Is it a documented restriction that you can only have one reference to the CTE .. see above example which fails while this modified version works. The former
works in other vendors.
 
with recursive t_cte ( c1, ctr ) as (
select 1,0 from tversion union
select 2,0 from tversion union all
select c1, ctr + 1 from t_cte where c1=1 and ctr < 5 )
select c1, ctr from t_cte

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

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Need magic for a moving statistic
Следующее
От: Andreas
Дата:
Сообщение: Need even more magic. Now for tricky counts.