macaque
macaque copied to clipboard
non-integer constant in GROUP BY
A macaque query like:
group {} by {test = null} …
is accepted but rejected by postgresql with the following error message:
ERROR: 42601: non-integer constant in GROUP BY
SQL group-by queries have a well-defined general semantics, but actually use strange heuristics to decide what can and cannot be grouped over. I'm not quite sure how to handle this. One possibility would be to use a syntactical test to forbid any kind of expressions other than field accesses in the by part, but this removes useful use-case with, indeed, integer computations. Maybe the Postgresql criterion could be emulated in a more fine-grained way, but that won't be portable at all.