pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Japin Li <japinli@hotmail.com>
Cc: Rahila Syed <rahilasyed90@gmail.com>
Cc: fadeymail@rambler.ru
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19367: typos in backend/utils/adt/timestamp.c
Date: Mon, 29 Dec 2025 10:37:39 -0500
Message-ID: <2867662.1767022659@sss.pgh.pa.us> (raw)
In-Reply-To: <MEAPR01MB303151496C4A38A8EA4F40F5B6BFA@MEAPR01MB3031.ausprd01.prod.outlook.com>
References: <19367-16750e0343aaea77@postgresql.org>
	<CAH2L28tGUhoH21j_+RP9X0g=s=G0NmuMYxOKZKSspamvEe3i-Q@mail.gmail.com>
	<MEAPR01MB303151496C4A38A8EA4F40F5B6BFA@MEAPR01MB3031.ausprd01.prod.outlook.com>

Japin Li <japinli@hotmail.com> writes:
> On Mon, 29 Dec 2025 at 15:55, Rahila Syed <rahilasyed90@gmail.com> wrote:
>>> There are typos in return type of these functions:

>> You’re right — these are just typos, and they don’t affect correctness since both 
>> ultimately call Int64GetDatum(). 
>> Still, +1 for fixing them for clarity.

> The functions timestamptz_pl_interval() and timestamptz_mi_interval() have the
> same typos, right?

My recollection is that this code deliberately fuzzes the difference
between timestamp and timestamptz in many places.  An example is that
timestamp_eq and its sibling comparison functions are used as-is for
both timestamp and timestamptz --- note the comment in front of
timestamp_cmp_internal in timestamp.c.  (BTW, "thomas" there is
Lockhart not me.)

So I think that being cavalier about PG_RETURN_TIMESTAMP versus
PG_RETURN_TIMESTAMPTZ stems from that; in fact, if you go back
far enough in our git history you will find we didn't even have
the latter to begin with.

There may be places where we can clean this up and not simply be
reversing the direction in which we're type-punning, but I doubt
we'll be able to fix every one without duplicating functions.
So I can't get hugely excited about it.

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <2867662.1767022659@sss.pgh.pa.us>
Permalink:  ../2867662.1767022659@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2867662.1767022659@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, japinli@hotmail.com, rahilasyed90@gmail.com, fadeymail@rambler.ru, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19367: typos in backend/utils/adt/timestamp.c
  In-Reply-To: <2867662.1767022659@sss.pgh.pa.us>

* 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