composite types, because TupleTableSlots aren't Datums and can't be
stored in Const nodes. We can remove this restriction if we ever
adopt a cleaner runtime representation for whole-tuple results, but
at the moment it's broken. Per example from Thomas Hallgren.
bool has_null_input = false;
List *arg;
FuncExpr *newexpr;
+ char result_typtype;
/*
* Can't simplify if it returns a set.
has_nonconst_input)
return NULL;
+ /*
+ * Can't simplify functions returning composite types (mainly because
+ * datumCopy() doesn't cope; FIXME someday when we have a saner
+ * representation for whole-tuple results).
+ */
+ result_typtype = get_typtype(funcform->prorettype);
+ if (result_typtype == 'c')
+ return NULL;
+
/*
* OK, looks like we can simplify this operator/function.
*