pgsql: Fix mishandling of sortgroupref labels while splitting SRF targe

2018-06-21 Thread Tom Lane
Fix mishandling of sortgroupref labels while splitting SRF targetlists. split_pathtarget_at_srfs() neglected to worry about sortgroupref labels in the intermediate PathTargets it constructs. I think we'd supposed that their labeling didn't matter, but it does at least for the case that GroupAggre

pgsql: Fix mishandling of sortgroupref labels while splitting SRF targe

2018-06-21 Thread Tom Lane
Fix mishandling of sortgroupref labels while splitting SRF targetlists. split_pathtarget_at_srfs() neglected to worry about sortgroupref labels in the intermediate PathTargets it constructs. I think we'd supposed that their labeling didn't matter, but it does at least for the case that GroupAggre