macaque icon indicating copy to clipboard operation
macaque copied to clipboard

non-integer constant in GROUP BY

Open kit-ty-kate opened this issue 12 years ago • 1 comments

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

kit-ty-kate avatar Dec 23 '13 00:12 kit-ty-kate

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.

gasche avatar Dec 23 '13 15:12 gasche