Re: Convert *GetDatum() and DatumGet*() macros to inline functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Julien Rouhaud <rjuju123(at)gmail(dot)com>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Convert *GetDatum() and DatumGet*() macros to inline functions
Date: 2022-09-27 20:13:36
Message-ID: 3823178.1664309616@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> writes:
> On 26.09.22 19:34, Tom Lane wrote:
>> I think we can do this while still having reasonable type-safety
>> by adding AssertVariableIsOfTypeMacro() checks to the macros.

> (I had looked into AssertVariableIsOfTypeMacro() for an earlier variant
> of this patch, before I had the idea with the inline functions. It's in
> general a bit too strict, such as with short vs int, and signed vs
> unsigned, but it should work ok for this limited set of uses.)

Yeah. I had sort of expected to need a UInt64GetDatumFast variant
that would accept uint64, but there doesn't appear to be anyplace
that wants that today. We should be willing to add it if anyone
complains, though.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-09-27 20:35:17 Re: longfin and tamandua aren't too happy but I'm not sure why
Previous Message Justin Pryzby 2022-09-27 20:07:12 Re: longfin and tamandua aren't too happy but I'm not sure why