Add a macro for the declared typlen of type timetz.
authorTom Lane <[email protected]>
Sun, 7 Dec 2025 16:33:35 +0000 (11:33 -0500)
committerTom Lane <[email protected]>
Sun, 7 Dec 2025 16:33:35 +0000 (11:33 -0500)
commit3628af42107d588af73280d7e96d1c6188aadad7
tree4b232defb5ef96dc4d1b2dc4bb3269492e163a8a
parent6498287696dafc1ebd380ea4eb249124989294d3
Add a macro for the declared typlen of type timetz.

pg_type.typlen says 12 for the size of timetz, but sizeof(TimeTzADT)
will be 16 on most platforms due to alignment padding.  Using the
sizeof number is no problem for usages such as palloc'ing a result
datum, but in usages such as datumCopy we really ought to match
what pg_type says.  Add a macro TIMETZ_TYPLEN so that we have a
symbolic way to write that rather than hard-coding "12".

I cannot find any place where we've needed this so far, but an
upcoming patch requires it.

Author: Tom Lane <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Discussion: https://postgr.es/m/2329959.1765047648@sss.pgh.pa.us
src/include/utils/date.h