[PostgreSQL-Hackers] Variadic aggregates vs. project policy

Pavel Stehule writes:I was one who sent a bug report - this error is not too dangerous, but itis hidden, and difficult to find, if you don't know what can be happen.Same as bug with plpgsql and SQL identifier collisions. If you understand,then you can protect self well and simply. If not, then it is a magicerror. So still I am thing so best solution is a) a warning when detect ORDER BY in variadic aggregates

Such a warning would never be tolerated by users, because it would appeareven when the query is perfectly correct.

b) disallow ORDER BY in variadic aggregates in classic syntax, and enableit only in WITHIN GROUP syntax where is safe ,

And we're *not* inventing randomly different syntax for variadicaggregates. That ship sailed when we did it this way for regularfunctions.