Re: View with duplicate GROUP BY entries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: View with duplicate GROUP BY entries
Date: 2017-11-21 17:05:44
Message-ID: 7598.1511283944@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sophie Herold 2017-11-21 17:23:43 Re: to_typemod(type_name) information function
Previous Message Tom Lane 2017-11-21 16:49:11 Re: Does XMLSERIALIZE output xmlattributes in a stable order?