Re: get rid of Pointer type, mostly

Chao Li <li.evan.chao@gmail.com>

From: Chao Li <li.evan.chao@gmail.com>
To: David Geier <geidav.pg@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-12-08T10:53:15Z
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 Dec 8, 2025, at 18:25, David Geier <geidav.pg@gmail.com> wrote:
> 
> Hi Peter,
>> 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.
> 
> It seems to me that we reached agreement. Are you planning to still
> apply these patches?
> 

Basically I am not against this patch, as 756a43689324b473ee07549a6eb7a53a203df5ad has done similar changes.

What I want to understand is that why do we delete Pointer and add GinExtraPointer?

```
-/*
- * Pointer
- *		Variable holding address of any memory resident object.
- *		(obsolescent; use void * or char *)
- */
-typedef void *Pointer;
```

And
```
+typedef void *GinExtraPointer;
```

They both are underlying “void *”. Are we expecting to improve code readability? More specific maybe?

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/