fix 'cache lookup failed for function 0' errors during initdb
authorTomas Vondra <[email protected]>
Sun, 15 Jan 2017 02:52:13 +0000 (03:52 +0100)
committerTomas Vondra <[email protected]>
Sun, 15 Jan 2017 02:52:13 +0000 (03:52 +0100)
commit04f96689945462a4212047f03eb3281fb56bcf2f
treec53f5ba929bf0fab05f6d0e08d55dc500cca4b5e
parentb6c7a69c2af7c5d46f0af700b7215099a6d28f2b
fix 'cache lookup failed for function 0' errors during initdb

Commit 0e882bd2e02 broke planning for aggregates not supporting partial
aggregation (e.g. array_agg, which lacks the serialize, deserialize and
combine functions). The code attempted to initialize the costing info
anyway, which failed when attempting to fetch info about those functions
from syscache.

Introduce a new flag 'try_distributed_aggregation' akin to the existing
one for simple parallel case. This is a good idea anyway, because it'll
allow us to disable distributed paths if we happen to find out the whole
aggregate can be pushed down.
src/backend/optimizer/plan/planner.c