Re: plpgsql by default

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: plpgsql by default
Дата
Msg-id 10657.1144789277@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: plpgsql by default  (David Fetter <david@fetter.org>)
Ответы Re: plpgsql by default  (David Fetter <david@fetter.org>)
Список pgsql-hackers
David Fetter <david@fetter.org> writes:
> On Tue, Apr 11, 2006 at 04:35:05PM -0400, Tom Lane wrote:
>> More realistically, though, the theoretical point that you can do
>> arbitrary calculations by turning loops into recursive SQL functions
>> is mostly just theoretical, and the reason is that you won't be able
>> to loop very many times before running out of stack space.  (On my
>> machine it looks like you can recurse a trivial SQL function only
>> about 600 times before hitting the default stack limit.)  If you
>> have an exploit that involves moderate amounts of calculation within
>> the server --- say, brute force password cracking --- the
>> availability of a PL will render that exploit actually practical,
>> whereas with only SQL functions to work with it won't be.

> The function I sent memoizes to a table, which avoids the stack space
> problem you mentioned.

In general that's not possible, and even for the specific case, it still
looks to me like fib(n) will use O(n) recursion levels if the table is
initially empty.
        regards, tom lane


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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Support Parallel Query Execution in Executor
Следующее
От: David Fetter
Дата:
Сообщение: Re: plpgsql by default