Re: Datum as struct

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-08-07T01:55:11Z
Lists: pgsql-hackers
I wrote:
> I think that on a 32-bit machine this would actually result in a
> null-pointer core dump, since the 0.0 would be coerced to a zero
> Datum value.  The line is not reached in our regression tests,
> and given the lack of field complaints, it must be hard to reach
> in normal use too.  Or 32-bit machines are deader than I thought.

On closer inspection, it's unreachable because bqarr_in won't
accept an empty query, and there is no other function that will
create query_int values.  So probably it's not worth the trouble
to back-patch.

			regards, tom lane



Commits

  1. Use consistent type for pgaio_io_get_id() result

  2. Mop-up for Datum conversion cleanups.

  3. Add missing Datum conversions

  4. Remove useless/superfluous Datum conversions

  5. Fix incorrect lack of Datum conversion in _int_matchsel()

  6. Improve tests of date_trunc() with infinity and unsupported units

  7. Fix incorrect Datum conversion in timestamptz_trunc_internal()

  8. Fix various hash function uses

  9. Fix mixups of FooGetDatum() vs. DatumGetFoo()