Re: BUG #18568: BUG: Result wrong when do group by on partition table!

From: Tender Wang <tndrwang(at)gmail(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: 1105066510(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18568: BUG: Result wrong when do group by on partition table!
Date: 2024-10-22 08:30:04
Message-ID: CAHewXN=4JGyH+unrdAxSWOwU+dN1vPB434iCye+P8WS4_LPwHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Amit,

Amit Langote <amitlangote09(at)gmail(dot)com> 于2024年10月22日周二 15:33写道:

>
>
> Not really. As the documentation says, collation can be specified per
> column or per operation:
>
> https://www.postgresql.org/docs/current/collation.html
>
> In this case, the operation is partitioning. When you specify the
> COLLATE clause for a partition key, it means that the partitioning
> logic, such as partition tuple routing, will use that collation
> instead of the column-specified or the column type's collation.
>

Since you said partition key had its own collation, and but we used column
type's collation in
set_baserel_partition_key_exprs() as below:

partexpr = (Expr *) makeVar(varno, attno,
partkey->parttypid[cnt],
partkey->parttypmod[cnt],
partkey->parttypcoll[cnt], 0);

I think why not we directly use the partition key collation(e.g.
partcollation).

--
Thanks,
Tender Wang

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Langote 2024-10-22 09:25:41 Re: BUG #18568: BUG: Result wrong when do group by on partition table!
Previous Message Tender Wang 2024-10-22 07:46:03 Re: BUG #18568: BUG: Result wrong when do group by on partition table!