ago(interval) → timestamptz

From: Florents Tselai <florents(dot)tselai(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: ago(interval) → timestamptz
Date: 2025-11-03 21:36:43
Message-ID: CA+v5N42fj6LtZxWJEsjPTRPqDceGLw+KrneeXXiH8_KduNV9qQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I realize this will get some "you can easily implement this yourself”
pushback,
But I keep seeing and writing a lot of WHERE ts > now() - interval '1 day'
expressions.

Having $subject should help in such cases.
We already have now, and age, so we might as well have ago too.
Other systems also expose similar helpers.

Cheers,
Flo

Attachment Content-Type Size
v1-0001-Add-ago-interval-function-to-subtract-interval-fr.patch application/octet-stream 2.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2025-11-03 21:45:00 Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue
Previous Message Rishu Bagga 2025-11-03 21:36:35 Re: [PATCH] Write Notifications Through WAL