"aihongwei" <ufo008ahw@163.com> writes:
> In x86_64 platform,
> I input command "ulimit -s 2048" to limit the stack size.Then I startup the
> server,and when i do some recursion operation, the pgsql will lost in some
> time.
> It seems that The stack_max_depth does work.
If you read the description of that setting, you will notice that it
recommends leaving a safety margin of at least one megabyte between the
kernel ulimit setting and the max_stack_depth value. You have left a
safety margin of zero. A crash is unsurprising.
More recent versions of Postgres are able to check whether
max_stack_depth has a safe value relative to ulimit -s, but 8.0 just
believes whatever you tell it.
BTW, are you *really* using 8.0.0? If so please update. The current
bugfix release in that series is 8.0.22.
regards, tom lane