Re: get rid of Pointer type, mostly
Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, David Geier <geidav.pg@gmail.com>,
Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers
<pgsql-hackers@postgresql.org>
Date: 2025-11-24T20:08:46Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Remove no longer needed casts from Pointer
- e158fd4d68f4 19 (unreleased) landed
-
Remove no longer needed casts to Pointer
- c6be3daa054a 19 (unreleased) landed
-
Change Pointer to void *
- 1b2bb5077e9e 19 (unreleased) landed
-
Don't rely on pointer arithmetic with Pointer type
- 756a43689324 19 (unreleased) landed
-
Use more appropriate DatumGet* function
- 8c6bbd674ed8 19 (unreleased) landed
-
Remove useless casts to Pointer
- 623801b3bdb4 19 (unreleased) landed
Attachments
- 0001-Convert-remaning-uses-of-Pointer-to-void.patch (text/x-diff)
Tom Lane <tgl@sss.pgh.pa.us> writes: > Robert Haas <robertmhaas@gmail.com> writes: >> On Mon, Nov 24, 2025 at 1:46 PM David Geier <geidav.pg@gmail.com> wrote: >>> The GIN code makes use of pointer but src/backend/access/gin only has 29 >>> occurrences. If you like I can help out fixing up the GIN code and share >>> a page here. Let me know. > >> I'd go for it! I mean, who knows whether your patch will be accepted? >> But another pair of eyes couldn't hurt. It seems like we all agree >> that a full removal of Pointer would be better than a partial removal; >> it's just a question of whether we can get there without too much >> other awkwardness. > > If there are actually places in GIN where using void* would be less > readable than using Pointer, that would certainly be interesting > information. Perhaps the patch would need to spend some effort > on adding comments, not just mechanically replacing the typedef? I got curious and did the replacement, and IMO there's no need for any further commentary than what's already there. I did however take the opportunity to get rid of some pointless casts (except the return value of PG_GETARG_POINTER(), which seems to be de rigueur to redundantly cast), and to convert a nearby char * that's only used for memcpy() to void *. - ilmari