Teach eval_const_expressions() to simplify an ArrayCoerceExpr to a constant
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 26 Aug 2008 02:16:39 +0000 (02:16 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 26 Aug 2008 02:16:39 +0000 (02:16 +0000)
commit5fe6dc44963ad55ed7800919fa3db73049c45d30
tree1fd1decaee71e5f926032fbcf9530f75bdb4e025
parent4eb1b84776c38d64d29c70e8d8bf44aaadd40ee1
Teach eval_const_expressions() to simplify an ArrayCoerceExpr to a constant
when its input is constant and the element coercion function is immutable
(or nonexistent, ie, binary-coercible case).  This is an oversight in the
8.3 implementation of ArrayCoerceExpr, and its result is that certain cases
involving IN or NOT IN with constants don't get optimized as they should be.
Per experimentation with an example from Ow Mun Heng.
src/backend/optimizer/util/clauses.c