Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> The same occurs in 11 and master. I think this is because the
> polymorphic type is resolved for the function ahead of time (at
> table creation time); partexprs shows
> ({FUNCEXPR :funcid 35757 :funcresulttype 23 :funcretset false :funcvariadic false :funcformat 0 :funccollid 0
:inputcollid0 :args ({VAR :varno 1 :varattno 1 :vartype 23 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 1
:varoattno1 :location 46}) :location 44})
> where the ":funcresulttype 23" bit indicates that the function is
> returning type integer, which I find a bit odd. I think if we were to
> leave it as funcresulttype anynonarray, pruning would work.
... at the cost of breaking many other things.
regards, tom lane