回复: BUG #18568: BUG: Result wrong when do group by on partition table! - Mailing list pgsql-bugs

From 狂奔的蜗牛
Subject 回复: BUG #18568: BUG: Result wrong when do group by on partition table!
Date
Msg-id tencent_43E0973428CF0C6F3EC22CFC06807C533809@qq.com
Whole thread Raw
In response to Re: BUG #18568: BUG: Result wrong when do group by on partition table!  (Tender Wang <tndrwang@gmail.com>)
Responses Re: BUG #18568: BUG: Result wrong when do group by on partition table!
List pgsql-bugs
I agree with advice of code style, and I have trim trailing whitespace in V6 patch.

About test case added in file partition_aggregate.sql, for we create case_insentitive collation based on ICU, which regress sql file we should write is better ?
If write into collate.icu.utf8.sql, it seems not suitable.

 


------------------ 原始邮件 ------------------
发件人: "Tender Wang" <tndrwang@gmail.com>;
发送时间: 2024年8月8日(星期四) 下午4:20
收件人: "jian he"<jian.universality@gmail.com>;
抄送: "狂奔的蜗牛"<1105066510@qq.com>;"pgsql-bugs"<pgsql-bugs@lists.postgresql.org>;"aleksander"<aleksander@timescale.com>;
主题: Re: BUG #18568: BUG: Result wrong when do group by on partition table!



jian he <jian.universality@gmail.com> 于2024年8月8日周四 15:51写道:
On Wed, Aug 7, 2024 at 11:04 PM jian he <jian.universality@gmail.com> wrote:
>
> On Wed, Aug 7, 2024 at 9:08 PM 狂奔的蜗牛 <1105066510@qq.com> wrote:
> >
> > I readd RelabelType to branch in v5 patch, and add case to cover the code.
> >


I did some minor adjustments in group_by_has_partkey, also refactored
the comment.

The logic in patch I think no problem. But I don't like the code style.

if (IsA(groupexpr, RelabelType))
     groupexpr = ((RelabelType *) groupexpr)->arg;
if (expr(groupexpr, partexr) && partcoll == groupcoll)
{
...
}

This looks more compact.

By the way, I think we'd better to include test cases together in your patch, then others can continue
to work based on your patch not need to go back to add the test cases.


--
Tender Wang
Attachment

pgsql-bugs by date:

Previous
From: Aleš Zelený
Date:
Subject: Re: BUG #18573: Analyze command consumes several GB of memory - more than analyzed table size
Next
From: Heikki Linnakangas
Date:
Subject: Re: BUG #18575: Sometimes pg_rewind mistakenly assumes that nothing needs to be done.