Hi,
On 2019-10-11 16:03:20 -0500, Justin Pryzby wrote:
> I'm not sure why we have that index, and my script probably should have known
> to choose a better one to cluster on, but still..
>
> ts=# CLUSTER huawei_m2000_config_enodebcell_enodeb USING huawei_m2000_config_enodebcell_enodeb_coalesce_idx ;
> DEBUG: 00000: building index "pg_toast_1840151315_index" on table "pg_toast_1840151315" serially
> LOCATION: index_build, index.c:2791
> DEBUG: 00000: clustering "public.huawei_m2000_config_enodebcell_enodeb" using sequential scan and sort
> LOCATION: copy_table_data, cluster.c:907
> ERROR: XX000: trying to store a heap tuple into wrong type of slot
> LOCATION: ExecStoreHeapTuple, execTuples.c:1328
Well, that's annoying. There apparently is not a single test covering
cluster on expression indexes, that' really ought to not be the
case. Equally annoying that I just broke this without noticing at all
:(.
The cause of the error is that, while that sounds like it should be the
case, a virtual slot isn't sufficient for tuplesort_begin_cluster(). So
the fix is pretty trivial. Will fix.
I started a separate thread about test coverage of tuplesort at
https://www.postgresql.org/message-id/20191013144153.ooxrfglvnaocsrx2%40alap3.anarazel.de
Greetings,
Andres Freund