Make get_stack_depth_rlimit() handle RLIM_INFINITY more sanely.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: dd1c781903811416db4e03383a4cb0bfc8cfac40
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-11-06T20:50:18Z
Releases: 9.1.0
Make get_stack_depth_rlimit() handle RLIM_INFINITY more sanely.

Rather than considering this result as meaning "unknown", report LONG_MAX.
This won't change what superusers can set max_stack_depth to, but it will
cause InitializeGUCOptions() to set the built-in default to 2MB not 100kB.
The latter seems like a fairly unreasonable interpretation of "infinity".
Per my investigation of odd buildfarm results as well as an old complaint
from Heikki.

Since this should persuade all the buildfarm animals to use a reasonable
stack depth setting during "make check", revert previous patch that dumbed
down a recursive regression test to only 5 levels.

Files