Re: Fwd: Bug#390730: postgresql-8.1: segfaults on huge litteral IN clauses

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fwd: Bug#390730: postgresql-8.1: segfaults on huge litteral IN clauses
Дата
Msg-id 19080.1160238217@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Fwd: Bug#390730: postgresql-8.1: segfaults on huge litteral IN clauses  (Martin Pitt <mpitt@debian.org>)
Ответы Re: Fwd: Bug#390730: postgresql-8.1: segfaults on huge
Список pgsql-bugs
Martin Pitt <mpitt@debian.org> writes:
> I recently got the Debian bug report below, a server crash with huge
> IN clauses.

What this sounds like to me is someone increasing max_stack_depth
without understanding what he's doing.  You must make sure that
max_stack_depth is less than the "ulimit -s" setting the postmaster
is running under ... and not just a little bit less, you want a megabyte
or so of daylight in there.  Per the documentation:

max_stack_depth (integer)

      Specifies the maximum safe depth of the server's execution
      stack. The ideal setting for this parameter is the actual stack
      size limit enforced by the kernel (as set by ulimit -s or local
      equivalent), less a safety margin of a megabyte or so. The safety
      margin is needed because the stack depth is not checked in every
      routine in the server, but only in key potentially-recursive
      routines such as expression evaluation. Setting the parameter
      higher than the actual kernel limit will mean that a runaway
      recursive function can crash an individual backend process. The
      default setting is 2048 KB (two megabytes), which is
      conservatively small and unlikely to risk crashes. However, it may
      be too small to allow execution of complex functions.

So if the OP wants to use huge IN clauses, he has to both increase
max_stack_depth and adjust the ulimit that the postmaster runs under.

            regards, tom lane

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

Предыдущее
От: Martin Pitt
Дата:
Сообщение: Fwd: Bug#390730: postgresql-8.1: segfaults on huge litteral IN clauses
Следующее
От: "Jean Tourrilhes"
Дата:
Сообщение: BUG #2681: duplicate key violates unique constraint