On Mon, 2026-07-27 at 13:06 -0400, Tom Lane wrote:
> Laurenz Albe <[email protected]> writes:
> > On Mon, 2026-07-27 at 08:23 -0400, Tom Lane wrote:
> > > I thought for a bit about changing the support function
> > > timestamp_cmp_timestamptz so that it instead converts the
> > > timestamptz side down to timestamp.  That would make an index
> > > search work consistently ... but it would be inconsistent with
> > > what the SQL-accessible operators do, so I think it's a nonstarter.
> 
> > What if we change the definition of the SQL operators accordingly?
> > That should only affect very few actual values.  We can do that
> > in master, with a note in the compatibility section, right?
> 
> It would behave very strangely I think: you'd have a situation where,
> eg,
>       A::timestamp > B::timestamptz
>       B::timestamptz < A::timestamp
> sometimes give different answers, so that we'd have to stop marking
> them as commutators.  The downsides of that seem pretty awful.

I thought about that for a while, but I can't see how it could happen.
If the "timestamptz" side is cast to "timestamp", it would be cast to
the same value in both cases.  So that would mean that there are two
"timestamp" values where x > y is different from y < x.
Where is the hole in my reasoning?

Yours,
Laurenz Albe


Reply via email to