Re: ago(interval) → timestamptz - Mailing list pgsql-hackers

From Laurenz Albe
Subject Re: ago(interval) → timestamptz
Date
Msg-id 8c0d8ec81c4a7684e8c4477c0a979ec2258b07ec.camel@cybertec.at
Whole thread Raw
In response to Re: ago(interval) → timestamptz  (Andreas Karlsson <andreas@proxel.se>)
List pgsql-hackers
On Sat, 2025-11-08 at 09:09 +0100, Andreas Karlsson wrote:
> On 11/6/25 3:54 PM, Laurenz Albe wrote:
> > On Thu, 2025-11-06 at 12:15 +0100, Florents Tselai wrote:
> > > > I don't get what users would need ago(interval) -> timestamp. That function would
> > > > not make any sense since there is no equivalent to now() which returns timestamp,
> > > > simply because a timestamp does not refer to any specific point in time and can
> > > > only be interpreted with some additional piece of information like a time zone.
> > >
> > > I agree that only a timestamptz variant makes sense.
> >
> > Lots of people model absolute time using "timestamp without time zone" with the
> > silent assumption that all such timestamps are UTC timestamps.  That would be
> > the additional piece of information.
> >
> > But I admit that that makes date arithmetic less useful.
> >
> > There is an equivalent for "now()": localtimestamp
>
> Oh, did not know of that function but using timestamp like this is
> dangerous and a bad idea.

I don't see the problem, but I guess that's getting severly off-topic.

Yours,
Laurenz Albe



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump not dumping default_text_search_config WAI?
Next
From: Tom Lane
Date:
Subject: Re: IO in wrong state on riscv64