From e84cf9461fe3898c0326e7c369c65fc4ef1761c6 Mon Sep 17 00:00:00 2001
From: Andrew Dunstan <andrew@dunslane.net>
Date: Wed, 30 Nov 2022 10:44:27 -0500
Subject: [PATCH 1/5] Add IOCallContext node

---
 src/include/nodes/primnodes.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h
index 74f228d959..3e2ecd11b3 100644
--- a/src/include/nodes/primnodes.h
+++ b/src/include/nodes/primnodes.h
@@ -1692,4 +1692,21 @@ typedef struct OnConflictExpr
 	List	   *exclRelTlist;	/* tlist of the EXCLUDED pseudo relation */
 } OnConflictExpr;
 
+/*----------
+ * IOCallContext - passed to an input function as FunctionCallInfo.context
+ *
+ * if the field no_error_throw is set then a conforming IO function will
+ * set the field error_found on error rather than calling ereport(ERROR ...)
+ *
+ */
+typedef struct IOCallContext
+{
+	pg_node_attr(nodetag_only) /* don't need copy etc. support functions */
+
+	NodeTag		type;
+	bool        no_error_throw; /* set by caller to suppress errors */
+	bool        error_found;    /* cleared by caller, set by IO function */
+	char       *error_message;
+} IOCallContext;
+
 #endif							/* PRIMNODES_H */
-- 
2.34.1

