David Rowley <dgrowleyml@gmail.com> writes:
> 2. In master only, remove the special case added in #1 and allow any
> non-integer constants to be treated as expressions.
> I think #2 is a good move for the following reasons:
FTR, I still think this is a bad idea. It will add more confusion
than it removes, and I don't buy that it will confer any advantages,
because nobody asked for it previously.
However, assuming that I'm going to be out-voted: your docs changes
still need work. That phrasing makes it sound like an output column
name could be "expressed as an integer literal". Maybe we should
restructure the whole sentence, perhaps along the lines of
... class="parameter">expression</replaceable> used inside a
<replaceable class="parameter">grouping_element</replaceable>
can be an input column name or an arbitrary expression formed
from input column values. For backwards compatibility with
SQL-92, the <replaceable>expression</replaceable> can also be
an output column name or an integer literal representing the
ordinal number of an output column. In case of ambiguity, a
<literal>GROUP BY</literal> item that is just a name will be
interpreted as an input column name rather than an output column
name.
Neither formulation addresses the case of non-integer literals
head on. I'm not quite sure if it's worth adding another sentence
to do so.
regards, tom lane