PartitionKeyData->partattrs, refactor some 0 to InvalidAttrNumber - Mailing list pgsql-hackers

From jian he
Subject PartitionKeyData->partattrs, refactor some 0 to InvalidAttrNumber
Date
Msg-id CACJufxGmsphWX150CxMU6KSed-x2fmTH3UpCwHpedGmjV1Biug@mail.gmail.com
Whole thread Raw
Responses Re: PartitionKeyData->partattrs, refactor some 0 to InvalidAttrNumber
List pgsql-hackers
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 reliably locate relevant code.

what do you think?

--
jian
https://www.enterprisedb.com/

Attachment

pgsql-hackers by date:

Previous
From: Maxim Orlov
Date:
Subject: Re: POC: make mxidoff 64 bits
Next
From: Tomas Vondra
Date:
Subject: Re: Performance issues with parallelism and LIMIT