Fix volatile function evaluation in eager aggregation Pushing aggregates containing volatile functions below a join can violate volatility semantics by changing the number of times the function is executed.
Here we check the Aggref nodes in the targetlist and havingQual for volatile functions and disable eager aggregation when such functions are present. Author: Richard Guo <[email protected]> Reviewed-by: Matheus Alcantara <[email protected]> Discussion: https://postgr.es/m/cambws48a53py1y4zoj7yhxpww9fo1hfnbdntkfa855zpxfv...@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/3a08a2a8b4fd36a9fa0da0253d1ca053c19047d5 Modified Files -------------- src/backend/optimizer/plan/initsplan.c | 11 ++++++++ src/test/regress/expected/eager_aggregate.out | 38 +++++++++++++++++++++++++++ src/test/regress/sql/eager_aggregate.sql | 14 ++++++++++ 3 files changed, 63 insertions(+)
