From 8899a2aba92c4a17f422172e7c9dd0e383eefa39 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 24 Mar 2004 22:40:29 +0000 Subject: 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. --- src/include/miscadmin.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/include/miscadmin.h') diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index f34ebb09865..4aba00bb713 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -1,18 +1,19 @@ /*------------------------------------------------------------------------- * * miscadmin.h - * this file contains general postgres administration and initialization + * This file contains general postgres administration and initialization * stuff that used to be spread out between the following files: * globals.h global variables * pdir.h directory path crud * pinit.h postgres initialization * pmod.h processing modes - * + * Over time, this has also become the preferred place for widely known + * resource-limitation stuff, such as work_mem and check_stack_depth(). * * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.154 2004/03/23 01:23:48 tgl Exp $ + * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.155 2004/03/24 22:40:29 tgl Exp $ * * NOTES * some of the information in this file should be moved to @@ -70,7 +71,7 @@ extern volatile bool ImmediateInterruptOK; extern volatile uint32 InterruptHoldoffCount; extern volatile uint32 CritSectionCount; -/* in postgres.c */ +/* in tcop/postgres.c */ extern void ProcessInterrupts(void); #ifndef WIN32 @@ -224,6 +225,10 @@ extern char *UnixSocketDir; extern char *ListenAddresses; +/* in tcop/postgres.c */ +extern void check_stack_depth(void); + + /***************************************************************************** * pdir.h -- * * POSTGRES directory path definitions. * -- cgit v1.2.3