From: Tom Lane Date: Thu, 14 Apr 2005 21:44:46 +0000 (+0000) Subject: Don't try to constant-fold functions returning RECORD, since the optimizer X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=54501ec7605c4a521b584a9a72444af6d8304806;p=users%2Fbernd%2Fpostgres.git Don't try to constant-fold functions returning RECORD, since the optimizer isn't presently set up to pass them an expected tuple descriptor. Bug has been there since 7.3 but was just recently reported by Thomas Hallgren. --- diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index cc28bb0f94..afe619ccaa 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -1620,6 +1620,13 @@ simplify_op_or_func(Expr *expr, List *args) result_typeid = func->funcresulttype; } + /* + * Can't simplify if it returns RECORD, since we can't pass an expected + * tupledesc. + */ + if (result_typeid == RECORDOID) + return NULL; + /* * we could use func_volatile() here, but we need several fields out * of the func tuple, so might as well just look it up once.