| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Kirill Reshke <reshkekirill(at)gmail(dot)com> |
| Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Define DatumGetInt8 function. |
| Date: | 2025-12-29 15:52:58 |
| Message-ID: | 2869012.1767023578@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Kirill Reshke <reshkekirill(at)gmail(dot)com> writes:
> During this rebase resolution, I noticed that there is an Int8GetDatum
> function, but there is no DatumGetInt8, which I want to use. All other
> inline functions seem to be provided in pairs by postgres.h. So it
> looks convenient to define DatumGetInt8 in postgres.h?
I would actually turn this around and ask why we have Int8GetDatum?
We have no SQL types for which that is well-adapted. I see no
uses of Int8GetDatum in our tree, and only three uses of
UInt8GetDatum, and all three of those look like type puns to me.
(heap_page_items is returning a smallint, and btcharskipsupport
should be using CharGetDatum.)
So from where I sit these look like an attractive nuisance that
we should remove rather than encourage use of. If you have
some extension data type for which these make sense, that's
fine, but it doesn't mean they should be in core Postgres.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Kirill Reshke | 2025-12-29 15:59:15 | Re: [PATCH] Fix escaping for '\' and '"' in pageinspect for gist |
| Previous Message | Roman Khapov | 2025-12-29 15:47:58 | [PATCH] Fix escaping for '\' and '"' in pageinspect for gist |