1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Replace max_expr_depth parameter with a max_stack_depth parameter that

is measured in kilobytes and checked against actual physical execution
stack depth, as per my proposal of 30-Dec.  This gives us a fairly
bulletproof defense against crashing due to runaway recursive functions.
This commit is contained in:
Tom Lane
2004-03-24 22:40:29 +00:00
parent a09b9a36d3
commit 8899a2aba9
13 changed files with 157 additions and 79 deletions

View File

@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.192 2004/03/23 01:23:48 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.193 2004/03/24 22:40:29 tgl Exp $
*
*--------------------------------------------------------------------
*/
@ -1023,6 +1023,15 @@ static struct config_int ConfigureNamesInt[] =
16384, 1024, INT_MAX / 1024, NULL, NULL
},
{
{"max_stack_depth", PGC_SUSET, RESOURCES_MEM,
gettext_noop("Sets the maximum stack depth, in kilobytes."),
NULL
},
&max_stack_depth,
2048, 100, INT_MAX / 1024, assign_max_stack_depth, NULL
},
{
{"vacuum_cost_page_hit", PGC_USERSET, RESOURCES,
gettext_noop("Vacuum cost for a page found in the buffer cache."),
@ -1097,14 +1106,6 @@ static struct config_int ConfigureNamesInt[] =
0, 0, INT_MAX, NULL, NULL
},
#endif
{
{"max_expr_depth", PGC_USERSET, CLIENT_CONN_OTHER,
gettext_noop("Sets the maximum expression nesting depth."),
NULL
},
&max_expr_depth,
DEFAULT_MAX_EXPR_DEPTH, 10, INT_MAX, NULL, NULL
},
{
{"statement_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT,
@ -1246,7 +1247,7 @@ static struct config_int ConfigureNamesInt[] =
},
{
{"debug_shared_buffers", PGC_POSTMASTER, RESOURCES_MEM,
{"debug_shared_buffers", PGC_POSTMASTER, STATS_MONITORING,
gettext_noop("Interval to report shared buffer status in seconds"),
NULL
},