Incorrect sort result caused by ROLLUP and WHERE operation

From: 谭忠涛 <zhongtao(dot)tan(at)seaboxdata(dot)com>
To: pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Cc: 谭忠涛 <zhongtao(dot)tan(at)seaboxdata(dot)com>
Subject: Incorrect sort result caused by ROLLUP and WHERE operation
Date: 2025-01-02 07:28:25
Message-ID: tencent_4568C7826D8BDEF01BC56D3D@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Case:
create table t1(a int, b int);
insert into t1 values(1,1),(1,2);
select a,b,sum(10) as s from t1 where a = 1 group by rollup(a,b) order by a, s desc;

Regards

谭忠涛&nbsp; &nbsp;数据研究院数据库事业部
北京东方金信科技股份有限公司
地址:海淀区知春路7号致真大厦 D 座 14 层
路线:地铁10号线-西土城站-A口
手机:13920129934
公众号:东方金信
网址:www.seaboxdata.com
关于东方金信
&nbsp; &nbsp; 北京东方金信科技股份有限公司成立于2013年2月。公司拥有ISO9001、 ISO27001和CMMI5级认证;中国大数据企业50强;首批通过工信部数据中心联盟大数据基础能力和性能双认证;首个国家信息中心“数据资产研究中心”授牌单位;全国信标委智慧城市及大数据标准工作组成员,2017年入选Gartner全球大数据行业和人工智能报告;2019年与腾讯云成为战略合作伙伴并获腾讯数亿元投资;2020年获中金、海淀区国资委入股。

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Rank, Christian (LfL) 2025-01-02 09:33:36 AW: Commit 5a2fed911a broke parallel query
Previous Message PG Bug reporting form 2025-01-02 06:43:57 BUG #18763: pg_get_viewdef returns an old def with new relation name