PG Bug reporting form <noreply@postgresql.org> writes:
> An outer scale(numeric) predicate is pushed below WindowAgg even though
> numeric values 1.0 and 1.00 are equal under PARTITION BY semantics while
> scale() distinguishes them.
Isn't this a duplicate of your own bug #19697, as well as bug #19619?
What's missing from all of these reports is a reason why scale()
would be sane to apply to an aggregated column. Such a query seems
inherently misguided to me, precisely because it is interrogating a
value that isn't guaranteed consistent across an aggregation group.
Is there a real-world use case here, and if so what is it?
regards, tom lane
[1] https://www.postgresql.org/message-id/19697-6e7ccba388bbe858@postgresql.org
[2] https://www.postgresql.org/message-id/19619-fc646db1c6b2dc90@postgresql.org