Re: [PATCHES] WITH RECURSIVE patch V0.1

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: [PATCHES] WITH RECURSIVE patch V0.1
Дата
Msg-id 87lk23of49.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: [PATCHES] WITH RECURSIVE patch V0.1  (Yoshiyuki Asaba <y-asaba@sraoss.co.jp>)
Ответы Re: [PATCHES] WITH RECURSIVE patch V0.1  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: [PATCHES] WITH RECURSIVE patch V0.1  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
"Yoshiyuki Asaba" <y-asaba@sraoss.co.jp> writes:

> Hi,
>
> From: David Fetter <david@fetter.org>
> Subject: Re: [HACKERS] [PATCHES] WITH RECURSIVE patch V0.1
> Date: Mon, 19 May 2008 04:36:30 -0700
>
>> > > I think it's the other way around. The server should not emit
>> > > infinite number of records.
>> >
>> > How about adding new GUC parameter "max_recursive_call"?
>>
>> Couldn't we just have it pay attention to the existing
>> max_stack_depth?
>
> Recursive query does not consume stack. The server enters an infinite
> loop without consuming stack. Stack-depth error does not happen.

We could have a separate guc variable which limits the maximum number of
levels of recursive iterations. That might be a useful feature for DBAs that
want to limit their users from issuing an infinite query.

Note that users can always construct their query to limit the number of
recursive iterations. So this would only be useful for DBAs that don't trust
their users and want to impose a limit. It doesn't add any actual expressive
power that SQL doesn't have already.

The recursive query syntax in the spec actually does include the ability to
assign an output column to show what level of recursive iteration you're on.
So alternately we could have a GUC variable which just allows the DBA to
prohibit any recursive query without such a column and a fiter imposing a
maximum value on it. That's probably the most appropriate option.


--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's Slony Replication support!

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

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: proposal: table functions and plpgsql
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: [PATCHES] WITH RECURSIVE patch V0.1