aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/functions.c')
-rw-r--r--src/backend/executor/functions.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c
index 9b45a8a9a0e..c53aaaca612 100644
--- a/src/backend/executor/functions.c
+++ b/src/backend/executor/functions.c
@@ -1567,13 +1567,16 @@ check_sql_fn_statements(List *queryTreeList)
* false even when the declared function return type is a rowtype.
*
* For a polymorphic function the passed rettype must be the actual resolved
- * output type of the function; we should never see a polymorphic pseudotype
- * such as ANYELEMENT as rettype. (This means we can't check the type during
- * function definition of a polymorphic function.) If the function returns
- * composite, the passed rettupdesc should describe the expected output.
- * If rettupdesc is NULL, we can't verify that the output matches; that
- * should only happen in fmgr_sql_validator(), or when the function returns
- * RECORD and the caller doesn't actually care which composite type it is.
+ * output type of the function. (This means we can't check the type during
+ * function definition of a polymorphic function.) If we do see a polymorphic
+ * rettype we'll throw an error, saying it is not a supported rettype.
+ *
+ * If the function returns composite, the passed rettupdesc should describe
+ * the expected output. If rettupdesc is NULL, we can't verify that the
+ * output matches; that should only happen in fmgr_sql_validator(), or when
+ * the function returns RECORD and the caller doesn't actually care which
+ * composite type it is.
+ *
* (Typically, rettype and rettupdesc are computed by get_call_result_type
* or a sibling function.)
*
@@ -1602,9 +1605,6 @@ check_sql_fn_retval(List *queryTreeList,
bool upper_tlist_nontrivial = false;
ListCell *lc;
- /* Caller must have resolved any polymorphism */
- AssertArg(!IsPolymorphicType(rettype));
-
if (resultTargetList)
*resultTargetList = NIL; /* initialize in case of VOID result */