Re: get rid of Pointer type, mostly

Jelte Fennema-Nio <postgres@jeltef.nl>

From: Jelte Fennema-Nio <postgres@jeltef.nl>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-11-24T17:30:04Z
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 →
  1. Remove no longer needed casts from Pointer

  2. Remove no longer needed casts to Pointer

  3. Change Pointer to void *

  4. Don't rely on pointer arithmetic with Pointer type

  5. Use more appropriate DatumGet* function

  6. Remove useless casts to Pointer

On Mon, Nov 24, 2025, 09:34 Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Especially so if the removal is incomplete.  What have
> you really accomplished then?
>

In this case, what we would accomplish is that no new developer to the
project has to understand what some unclear typedef means, *unless* they
touch GIN related code. Just from its name it's definitely not clear to me
that Pointer means char * instead of void *. And this typedef is ven
shorter than the thing it represents.

Side annoyance: I think this is a falacy that hackers discussions end up in
a lot. Someone suggesting that the partial improvements have (almost) no
benefit and all cases need to be fixed in one go to before it should be
committed. Then the patch author thinks that's too much work and then
nothing ends up being improved at all.