Re: PartitionKeyData->partattrs, refactor some 0 to InvalidAttrNumber

2025-11-16 Thread jian he
On Sat, Nov 15, 2025 at 12:59 AM Bertrand Drouvot wrote: > > Hi, > > On Fri, Nov 14, 2025 at 11:47:35PM +0800, jian he wrote: > > hi. > > > > if PartitionKeyData->partattrs is 0, then it means that partition key is > > expression, else it's column reference. > > > > we can change from > > if (key-

Re: PartitionKeyData->partattrs, refactor some 0 to InvalidAttrNumber

2025-11-14 Thread Bertrand Drouvot
Hi, On Fri, Nov 14, 2025 at 11:47:35PM +0800, jian he wrote: > hi. > > if PartitionKeyData->partattrs is 0, then it means that partition key is > expression, else it's column reference. > > we can change from > if (key->partattrs[i] == 0) > to yes, I think that makes sense to not compare an Att

PartitionKeyData->partattrs, refactor some 0 to InvalidAttrNumber

2025-11-14 Thread jian he
hi. if PartitionKeyData->partattrs is 0, then it means that partition key is expression, else it's column reference. we can change from if (key->partattrs[i] == 0) to if (key->partattrs[i] == InvalidAttrNumber) the reason I can think of is to improve grepability. numeric value 0 is too common to