Re: Making type Datum be 8 bytes everywhere
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org,
Robert Haas <robertmhaas@gmail.com>
Date: 2025-07-31T14:27:37Z
Lists: pgsql-hackers
Peter Eisentraut <peter@eisentraut.org> writes: > On 30.07.25 18:06, Tom Lane wrote: >> I'm giving the traditional names to the Pointer variants because it >> turns out that way more places would have to change if we do it the >> other way: in a rough count, about 50 versus about 1700. (This is >> counting only the core backend.) Beyond that, though, bikeshedding >> on the naming is welcome. > In my patch, I just added the missing DatumGetPointer() calls, which > seemed easy enough. I had an earlier patch version that also did that, but it seemed kind of verbose to me: adding "_D" is much shorter than adding "DatumGetPointer()", and fewer parens seems good for readability. One interesting thing I noted is that in some modules we already were applying DatumGetPointer where needed (mostly, at least). The patch I just posted in your other thread also simplifies those cases to use the "_D" notation, which makes it longer than strictly necessary. But I think consistency of notation is good. > There is precedent for having two different functions, though, like > att_addlength_pointer() and att_addlength_datum(). Yeah ... those two macros could stand to be cleaned up too, per the notes in their comments. But I don't think we need to fix that today. regards, tom lane
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Avoid faulty alignment of Datums in build_sorted_items().
- 09036dc71c68 19 (unreleased) landed
-
Grab the low-hanging fruit from forcing USE_FLOAT8_BYVAL to true.
- ee54046601de 19 (unreleased) landed
-
Grab the low-hanging fruit from forcing sizeof(Datum) to 8.
- 6aebedc38497 19 (unreleased) landed
-
Make type Datum be 8 bytes wide everywhere.
- 2a600a93c7be 19 (unreleased) landed
-
Mop-up for Datum conversion cleanups.
- 665c3dbba497 19 (unreleased) landed