Re: get rid of Pointer type, mostly

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-11-24T16:19:42Z
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 at 11:09 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > The second is getting rid of uses of Pointer for variables where you
> > might as well use void * directly.  These are actually not that many.
>
> ... but not of that.  In particular, I think it's just fine if
> DatumGetPointer and PointerGetDatum take and return Pointer.

What's your objection?

(I don't have a considered opinion on this particular point, but in
general I've found that using Pointer seems to make life worse rather
than better.)

-- 
Robert Haas
EDB: http://www.enterprisedb.com