Re: View with duplicate GROUP BY entries

2017-11-21 Thread Robert Haas
On Tue, Nov 21, 2017 at 1:11 PM, Tom Lane wrote: > Robert Haas writes: >> On Tue, Nov 21, 2017 at 12:05 PM, Tom Lane wrote: >>> 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 answe

Re: View with duplicate GROUP BY entries

2017-11-21 Thread Tom Lane
Robert Haas writes: > On Tue, Nov 21, 2017 at 12:05 PM, Tom Lane wrote: >> 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 >>

Re: View with duplicate GROUP BY entries

2017-11-21 Thread Robert Haas
On Tue, Nov 21, 2017 at 12:05 PM, Tom Lane wrote: > Ashutosh Bapat 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. >

Re: View with duplicate GROUP BY entries

2017-11-21 Thread Tom Lane
Ashutosh Bapat 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 rege

View with duplicate GROUP BY entries

2017-11-20 Thread Ashutosh Bapat
Hi All, 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. E.g. postgres=# create view aggv as select c2 c21, c2 c22 from t1 group by 1, 2;