aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 6e6844badea..5f83e4fc98d 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -22,6 +22,7 @@
#include "postgres.h"
+#include "miscadmin.h"
#include "nodes/plannodes.h"
#include "nodes/relation.h"
#include "utils/datum.h"
@@ -3570,6 +3571,9 @@ copyObject(void *from)
if (from == NULL)
return NULL;
+ /* Guard against stack overflow due to overly complex expressions */
+ check_stack_depth();
+
switch (nodeTag(from))
{
/*