Thread

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Change some Datum to void * for opaque pass-through pointer

  1. Change some Datum to void * for opaque pass-through pointer

    Peter Eisentraut <peter@eisentraut.org> — 2025-12-23T13:15:09Z

    I developed this patch as part of the Datum-as-struct semi-proposal [0]. 
      I think it can be useful independent of that.
    
    Here, Datum was used to pass around an opaque pointer between a group of 
    functions.  But one might as well use void * for that; the use of Datum 
    doesn't achieve anything here and is just distracting.
    
    
    [0]: 
    https://www.postgresql.org/message-id/flat/8246d7ff-f4b7-4363-913e-827dadfeb145%40eisentraut.org
  2. Re: Change some Datum to void * for opaque pass-through pointer

    Tom Lane <tgl@sss.pgh.pa.us> — 2025-12-23T15:07:32Z

    Peter Eisentraut <peter@eisentraut.org> writes:
    > Here, Datum was used to pass around an opaque pointer between a group of 
    > functions.  But one might as well use void * for that; the use of Datum 
    > doesn't achieve anything here and is just distracting.
    
    We have some APIs where Datum is used to be agnostic about whether
    a pointer or an integer is being passed through.  on_shmem_exit()
    callers make use of both cases, for example.
    
    These tsearch functions don't need that, and they aren't adjacent
    to places using such an API, so I'm fine with this patch as written.
    But I don't mean that as carte blanche to make such changes
    everywhere.
    
    			regards, tom lane
    
    
    
    
  3. Re: Change some Datum to void * for opaque pass-through pointer

    Peter Eisentraut <peter@eisentraut.org> — 2025-12-28T13:40:03Z

    On 23.12.25 16:07, Tom Lane wrote:
    > Peter Eisentraut <peter@eisentraut.org> writes:
    >> Here, Datum was used to pass around an opaque pointer between a group of
    >> functions.  But one might as well use void * for that; the use of Datum
    >> doesn't achieve anything here and is just distracting.
    > 
    > We have some APIs where Datum is used to be agnostic about whether
    > a pointer or an integer is being passed through.  on_shmem_exit()
    > callers make use of both cases, for example.
    
    Agreed, those are different situations.
    
    > These tsearch functions don't need that, and they aren't adjacent
    > to places using such an API, so I'm fine with this patch as written.
    
    Ok, committed.