Re: get rid of Pointer type, mostly
David Geier <geidav.pg@gmail.com>
From: David Geier <geidav.pg@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter@eisentraut.org>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-11-24T20:20:14Z
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-Remove-uses-of-Pointer-in-GIN-related-code.patch (text/x-patch) patch 0001
On 24.11.2025 20:52, Robert Haas wrote: > On Mon, Nov 24, 2025 at 2:38 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: >> Well, either Peter just ran out of energy or there is actually some >> notational value in Pointer. If it's the latter, I'd like to know. > > I agree that would be nice to know. > > Peter's original email seemed to indicate that he was deterred by this > sort of thing: > > Pointer **extra_data = (Pointer **) PG_GETARG_POINTER(4); > > If Pointer is merely char *, then this is equivalent to: > > char ***extra_data = (char ***) PG_GETARG_POINTER(4); > > I believe this is the same extra_data that is documented thus: I figured the same while doing the change. > So in other words, it's a pointer to an array of generic pointers. In > a vacuum, I'd suggest that having three levels of indirection that are > all semantically different but all denoted by an asterisk in C is > confusing enough to be a bad idea regardless of the specifics. But > since we've already crossed that bridge, we'll just need to make the > best of it. Maybe we could use a more specific typedef here, like > GinExtraPointer. That would be a lot more greppable than just writing > Pointer, and every GinExtraPointer would be the same flavor of generic > pointer, whereas any given Pointer is not necessarily related in any > semantic way to any other. I went with your proposal of GinExtraPointer. See attached patch. It's based on the series of patches from Peter's initial mail. I've included the removal of the Pointer typedef in the same patch. -- David Geier