Rename PageData to XLogPageData

Started by Peter Eisentrautover 1 year ago5 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

I was fiddling a bit with making some Page-related APIs const-proof,
which might involve changing something like "Page p" to "const PageData
*p", but I was surprised that a type PageData exists but it's an
unrelated type local to generic_xlog.c.

This patch renames that type to a more specific name XLogPageData. This
makes room for possibly adding another PageData type with the earlier
meaning, but that's not done here. But I think even without that, this
patch is a useful little cleanup that makes the code more consistent and
clear.

Attachments:

0001-Rename-PageData-to-XLogPageData.patchtext/plain; charset=UTF-8; name=0001-Rename-PageData-to-XLogPageData.patchDownload+13-14
#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Peter Eisentraut (#1)
Re: Rename PageData to XLogPageData

On 02/10/2024 14:30, Peter Eisentraut wrote:

I was fiddling a bit with making some Page-related APIs const-proof,
which might involve changing something like "Page p" to "const PageData
*p", but I was surprised that a type PageData exists but it's an
unrelated type local to generic_xlog.c.

Good find

This patch renames that type to a more specific name XLogPageData.  This
makes room for possibly adding another PageData type with the earlier
meaning, but that's not done here.  But I think even without that, this
patch is a useful little cleanup that makes the code more consistent and
clear.

+1 for renaming, but -1 on XLogPageData. That sounds like a WAL page,
see XLogPageHeaderData for example. I'd suggest GenericXLogPageData or
just GenericPerPageData or something.

--
Heikki Linnakangas
Neon (https://neon.tech)

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Heikki Linnakangas (#2)
Re: Rename PageData to XLogPageData

On 02.10.24 19:02, Heikki Linnakangas wrote:

This patch renames that type to a more specific name XLogPageData.
This makes room for possibly adding another PageData type with the
earlier meaning, but that's not done here.  But I think even without
that, this patch is a useful little cleanup that makes the code more
consistent and clear.

+1 for renaming, but -1 on XLogPageData. That sounds like a WAL page,
see XLogPageHeaderData for example. I'd suggest GenericXLogPageData or
just GenericPerPageData or something.

Sounds good. Here is an updated version.

Attachments:

v2-0001-Rename-PageData-to-GenericXLogPageData.patchtext/plain; charset=UTF-8; name=v2-0001-Rename-PageData-to-GenericXLogPageData.patchDownload+13-14
#4Michael Paquier
michael@paquier.xyz
In reply to: Peter Eisentraut (#3)
Re: Rename PageData to XLogPageData

On Thu, Oct 03, 2024 at 01:31:19PM +0200, Peter Eisentraut wrote:

Sounds good. Here is an updated version.

Good idea. What you have sent here looks good to me.
--
Michael

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Michael Paquier (#4)
Re: Rename PageData to XLogPageData

On 04.10.24 05:55, Michael Paquier wrote:

On Thu, Oct 03, 2024 at 01:31:19PM +0200, Peter Eisentraut wrote:

Sounds good. Here is an updated version.

Good idea. What you have sent here looks good to me.

committed