forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite9f2703
committed
Fix postgres_fdw to cope with duplicate GROUP BY entries.
Commit7012b13, which added the ability to push down aggregates andgrouping to the remote server, wasn't careful to ensure that the remoteserver would have the same idea we do about which columns are the groupingcolumns, in cases where there are textually identical GROUP BY expressions.Such cases typically led to "targetlist item has multiple sortgroupreflabels" errors.To fix this reliably, switch over to using "GROUP BY column-number" syntaxrather than "GROUP BY expression" in transmitted queries, and adjustforeign_grouping_ok() to be more careful about duplicating the sortgroupreflabeling of the local pathtarget.Per bug #14890 from Sean Johnston. Back-patch to v10 where the buggy codewas introduced.Jeevan Chalke, reviewed by Ashutosh BapatDiscussion:https://postgr.es/m/20171107134948.1508.94783@wrigleys.postgresql.org1 parent680d540 commite9f2703
File tree
4 files changed
+150
-119
lines changed- contrib/postgres_fdw
- expected
- sql
4 files changed
+150
-119
lines changedLines changed: 12 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
178 | 178 |
| |
179 | 179 |
| |
180 | 180 |
| |
181 |
| - | |
| 181 | + | |
182 | 182 |
| |
183 | 183 |
| |
184 | 184 |
| |
| |||
2853 | 2853 |
| |
2854 | 2854 |
| |
2855 | 2855 |
| |
2856 |
| - | |
| 2856 | + | |
2857 | 2857 |
| |
2858 | 2858 |
| |
2859 | 2859 |
| |
| |||
2960 | 2960 |
| |
2961 | 2961 |
| |
2962 | 2962 |
| |
2963 |
| - | |
| 2963 | + | |
2964 | 2964 |
| |
2965 | 2965 |
| |
2966 | 2966 |
| |
| |||
3047 | 3047 |
| |
3048 | 3048 |
| |
3049 | 3049 |
| |
3050 |
| - | |
| 3050 | + | |
| 3051 | + | |
3051 | 3052 |
| |
3052 | 3053 |
| |
3053 | 3054 |
| |
| |||
3056 | 3057 |
| |
3057 | 3058 |
| |
3058 | 3059 |
| |
3059 |
| - | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
3060 | 3067 |
| |
3061 | 3068 |
| |
3062 | 3069 |
| |
|
0 commit comments
Comments
(0)