On Fri, 22 Aug 2025 at 06:41, Richard Guo <guofengli...@gmail.com> wrote:
>
> If you run 'git grep', you'll find a lot more instances where the
> result of BufferGetPage() is explicitly cast to Page.
>
> git grep -rn "(Page) BufferGetPage" | wc -l
> 69
>
> Although these casts are unnecessary for sure, I'm not sure if it's
> worth making the code changes to fix them.

I can see your point. But I can see that there is a great amount of
commits in HEAD (every now and then), which are just pure refactoring
and standardizing things.
I am uncertain about the delineation between when we make changes and
when we refrain from doing so.

I do not insist on this modification. I just spotted two completely
same codes in [0] & [1], which only differ in BufferGetPage cast. And
I merely tried to do something with it.

v2 attached with all 69 casts removed, but I see there is a little
chance of this committed.

[0] 
https://github.com/postgres/postgres/blob/13b935c/src/backend/access/heap/heapam_xlog.c#L1007-L1050
[1] 
https://github.com/postgres/postgres/blob/13b935c/src/backend/access/heap/heapam_xlog.c#L1083-L1121

-- 
Best regards,
Kirill Reshke

Attachment: v2-0001-Remove-unneeded-cast-in-BufferGetPage.patch
Description: Binary data

Reply via email to