On Mon, 21 Jun 2021 at 20:15, PG Bug reporting form <noreply@postgresql.org> wrote: > run the following sql command through client and the PostgreSQL database > process will crash: > > CREATE TABLE v0 ( v1 FLOAT NOT NULL PRIMARY KEY ) ; > WITH v1 AS ( DELETE FROM v0 WHERE v1 <= - - - 9 RETURNING * ) INSERT INTO v0 > VALUES ( - - - - - - 95 ) ; > SELECT v1 FROM ( SELECT * FROM v0 UNION ALL SELECT * FROM v0 GROUP BY > DISTINCT ROLLUP ( v1 , v1 ) , ROLLUP ( v1 , USER ) , GROUPING SETS ( ROW ( ) > , ( v1 ) ) , ROLLUP ( v1 < - - 61 AND v1 IN ( -2147483648 , - 94 ) , v1 ) ) > v1 ORDER BY ( v1 + - - -1 ) , ( v1 + - - v1 IN ( SELECT v1 FALSE FROM ( > SELECT FROM v0 GROUP BY v1 ) PRECISION ) ) ;
Thanks for the report. It looks like a thinko in 1d581ce71. Code was added there which insists the initial list element is a List, but it's an IntList. I think the code should just use linitial instead of linitial_node.
I'm quite surprised that we don't have a test that picks this up.
A distinct group by clause would help to reveal this issue as:
explain select * from t GROUP BY distinct a, rollup(b);