Re: Refactoring: Use soft error reporting for *_opt_overflow functions of date/timestamp

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Amul Sul <sulamul(at)gmail(dot)com>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Refactoring: Use soft error reporting for *_opt_overflow functions of date/timestamp
Date: 2025-12-01 07:01:52
Message-ID: aS09YF2GmVXjAxbJ@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 28, 2025 at 09:46:43AM +0530, Amul Sul wrote:
> I have attached patch 0002 that renames it. I also updated patch 0001
> to accommodate Amit's comment suggestions.

Thanks, applied this one after more tweaks. Regarding 0002, just
doing a renaming makes me a bit uncomfortable after a second look.
Another way to look at the problem while being consistent would be to
convert date2timestamp_no_overflow() to use soft error reports,
requiring its caller in selfuncs.c to use an error context node. I
cannot get really excited at the end just for the sake of the planner
stats.

There were two more functions that btree_gin.c is pointing at that
could to the switch: timestamp->timestamptz and its opposite. This
also shaves some code, which is nice. Please see the attached.
--
Michael

Attachment Content-Type Size
0001-Update-timestamp-tz-functions-to-use-soft-error-repo.patch text/x-diff 8.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-12-01 07:02:59 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Previous Message Tatsuo Ishii 2025-12-01 06:57:02 Re: Row pattern recognition