Re: [HACKERS] default of max_stack_depth

2010-08-06 Thread Tom Lane
Fujii Masao writes: > On Fri, Aug 6, 2010 at 11:02 PM, Tom Lane wrote: >> The initial value needs to be small until we have been able to probe >> rlimit and figure out what is safe. > Thanks! How about adding the comment about that as follows? I added this: /* * We use the hopefully-

Re: [HACKERS] default of max_stack_depth

2010-08-06 Thread Fujii Masao
On Fri, Aug 6, 2010 at 11:02 PM, Tom Lane wrote: > Fujii Masao writes: >> The document says that the max_stack_depth is 2MB by default. >> OTOH, in the source code, the variable max_stack_depth is >> initialized with 100 (kB), and guc.c also uses 100 as the >> default. Why? > > The initial value

Re: [HACKERS] default of max_stack_depth

2010-08-06 Thread Tom Lane
Fujii Masao writes: > The document says that the max_stack_depth is 2MB by default. > OTOH, in the source code, the variable max_stack_depth is > initialized with 100 (kB), and guc.c also uses 100 as the > default. Why? The initial value needs to be small until we have been able to probe rlimit a

[HACKERS] default of max_stack_depth

2010-08-06 Thread Fujii Masao
Hi, The document says that the max_stack_depth is 2MB by default. OTOH, in the source code, the variable max_stack_depth is initialized with 100 (kB), and guc.c also uses 100 as the default. Why? This seems confusing to me though I know that InitializeGUCOptions() sets max_stack_depth to 2MB. Re

Re: [HACKERS] Default of max_stack_depth and getrlimit

2008-07-21 Thread Cédric Villemain
Le Monday 21 July 2008, Heikki Linnakangas a écrit : > Cédric Villemain wrote: > > Le Monday 21 July 2008, Heikki Linnakangas a écrit : > >> I think we should differentiate between "infinite" and "unknown" in the > >> return value of get_stack_depth_limit(), and use max_stack_depth of 2MB > >> in c

Re: [HACKERS] Default of max_stack_depth and getrlimit

2008-07-21 Thread Heikki Linnakangas
Cédric Villemain wrote: Le Monday 21 July 2008, Heikki Linnakangas a écrit : I think we should differentiate between "infinite" and "unknown" in the return value of get_stack_depth_limit(), and use max_stack_depth of 2MB in case of infinite, and fall back to the 100kB only in the unknown case.

Re: [HACKERS] Default of max_stack_depth and getrlimit

2008-07-21 Thread Cédric Villemain
Le Monday 21 July 2008, Heikki Linnakangas a écrit : > In 8.2, we started to use getrlimit(RLIMIT_STACK, ...) to set > max_stack_depth automatically, to a max of 2MB: > > http://archives.postgresql.org/pgsql-hackers/2006-10/msg00389.php > > However, it's not behaving as I expected when the stack li

Re: [HACKERS] Default of max_stack_depth and getrlimit

2008-07-21 Thread Heikki Linnakangas
Tom Lane wrote: "Heikki Linnakangas" <[EMAIL PROTECTED]> writes: In 8.2, we started to use getrlimit(RLIMIT_STACK, ...) to set max_stack_depth automatically, to a max of 2MB: http://archives.postgresql.org/pgsql-hackers/2006-10/msg00389.php However, it's not behaving as I expected when the

Re: [HACKERS] Default of max_stack_depth and getrlimit

2008-07-21 Thread Tom Lane
"Heikki Linnakangas" <[EMAIL PROTECTED]> writes: > In 8.2, we started to use getrlimit(RLIMIT_STACK, ...) to set > max_stack_depth automatically, to a max of 2MB: > http://archives.postgresql.org/pgsql-hackers/2006-10/msg00389.php > However, it's not behaving as I expected when the stack limit i

[HACKERS] Default of max_stack_depth and getrlimit

2008-07-21 Thread Heikki Linnakangas
In 8.2, we started to use getrlimit(RLIMIT_STACK, ...) to set max_stack_depth automatically, to a max of 2MB: http://archives.postgresql.org/pgsql-hackers/2006-10/msg00389.php However, it's not behaving as I expected when the stack limit is set to "unlimited". I would expect max_stack_depth to