aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pgstatfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-04-20 11:32:02 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2021-04-20 11:32:02 -0400
commit375398244168add84a884347625d14581a421e71 (patch)
tree2d4e63dd53b05c82c2847a04918a9c82f4088b54 /src/backend/utils/adt/pgstatfuncs.c
parent95c3a1956ec9eac686c1b69b033dd79211b72343 (diff)
downloadpostgresql-375398244168add84a884347625d14581a421e71.tar.gz
postgresql-375398244168add84a884347625d14581a421e71.zip
Fix planner failure in some cases of sorting by an aggregate.
An oversight introduced by the incremental-sort patches caused "could not find pathkey item to sort" errors in some situations where a sort key involves an aggregate or window function. The basic problem here is that find_em_expr_usable_for_sorting_rel isn't properly modeling what prepare_sort_from_pathkeys will do later. Rather than hoping we can keep those functions in sync, let's refactor so that they actually share the code for identifying a suitable sort expression. With this refactoring, tlist.c's tlist_member_ignore_relabel is unused. I removed it in HEAD but left it in place in v13, in case any extensions are using it. Per report from Luc Vlaming. Back-patch to v13 where the problem arose. James Coleman and Tom Lane Discussion: https://postgr.es/m/91f3ec99-85a4-fa55-ea74-33f85a5c651f@swarm64.com
Diffstat (limited to 'src/backend/utils/adt/pgstatfuncs.c')
0 files changed, 0 insertions, 0 deletions