pgsql: Add a macro for the declared typlen of type timetz. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Add a macro for the declared typlen of type timetz.
Date
Msg-id E1vSI4G-003IEf-0u@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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 <tgl@sss.pgh.pa.us>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/2329959.1765047648@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3628af42107d588af73280d7e96d1c6188aadad7

Modified Files
--------------
src/include/utils/date.h | 8 ++++++++
1 file changed, 8 insertions(+)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Handle constant inputs to corr() and related aggregates more pre
Next
From: Tom Lane
Date:
Subject: pgsql: ecpg: refactor to eliminate cast-away-const in find_variable().