Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com> writes:
> While reviewing patch for similar problem in postgres_fdw [1], I
> noticed that we don't use positional notation while creating the view.
> This might introduced anomalies when GROUP BY entries are
> non-immutable.
Yeah, we probably ought to make more of an effort to regenerate the
original query wording. I do not think that forcing positional notation
is a suitable answer in this case, because it would result in converting
SQL-standard queries to nonstandard ones. We might have to extend the
parsetree representation so that we can tell whether positional notation
was used to begin with.
regards, tom lane