pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add a macro for the declared typlen of type timetz.
Date: Sun, 07 Dec 2025 16:57:04 +0000
Message-ID: <E1vSI4G-003IEf-0u@gemulon.postgresql.org> (raw)

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(+)



Message-ID: <E1vSI4G-003IEf-0u@gemulon.postgresql.org>
Permalink:  ../E1vSI4G-003IEf-0u@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vSI4G-003IEf-0u@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add a macro for the declared typlen of type timetz.
  In-Reply-To: <E1vSI4G-003IEf-0u@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox