Teach eval_const_expressions() to simplify an ArrayCoerceExpr to a constant
commitfaf6861d003d12379a1280e9865fc960f4f03ae0
authortgl <tgl>
Tue, 26 Aug 2008 02:16:31 +0000 (26 02:16 +0000)
committertgl <tgl>
Tue, 26 Aug 2008 02:16:31 +0000 (26 02:16 +0000)
tree61a265f3a6b44de68d6fa010f9db7eac282fa95f
parent442212de2bc731e4ca1a0e3059babae7310f7e28
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