Fix CLUSTER on expression indexes

Enterprise / PostgreSQL - Andres Freund [] - 15 October 2019 17:40 UTC

Since the introduction of different slot types, in 1a0586de3657, we create a virtual slot in tuplesort_begin_cluster(). While that looks right, it unfortunately doesn't actually work, as ExecStoreHeapTuple() is used to store tuples in the slot. Unfortunately no regression tests for CLUSTER on expression indexes existed so far.

Fix the slot type, and add bare bones tests for CLUSTER on expression indexes.

cef82eda14 Fix CLUSTER on expression indexes.
src/backend/utils/sort/tuplesort.c | 2 +-
src/test/regress/expected/cluster.out | 107 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/cluster.sql | 37 ++++++++++++
3 files changed, 145 insertions(+), 1 deletion(-)


  • Share