public inbox for [email protected]  
help / color / mirror / Atom feed
From: Corey Huinker <[email protected]>
To: jian he <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: Amul Sul <[email protected]>
Cc: Kirill Reshke <[email protected]>
Cc: Vik Fearing <[email protected]>
Cc: Isaac Morland <[email protected]>
Cc: [email protected]
Subject: Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions
Date: Fri, 27 Mar 2026 16:59:49 -0400
Message-ID: <CADkLM=euzh4v-FK6Tx-yrXfZX4YVd1X5WCpWN7o5=cQsrT7-Yg@mail.gmail.com> (raw)
In-Reply-To: <CACJufxHx-UfprE6P4_ZB_cOYktHd4pLMNx=jWJFOGGGFj2YZWQ@mail.gmail.com>
References: <CADkLM=fv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ@mail.gmail.com>
	<CACJufxHGxB7KPAStUHZcWhFEDXsnU06qOugh60X4hHG6J-xoUA@mail.gmail.com>
	<CADkLM=f0xruKRH+6XvCsM1EVic9y4BL4AFo3VUfvRLdu-Qp5Gg@mail.gmail.com>
	<CADkLM=e4y2bLv-6_JY5c6vC9QtweW9VfxVmVJFpcriy8Rs23TA@mail.gmail.com>
	<CACJufxGO_qmyGjBvkwhCZzm6bWiqj8iyd1dGbL+_guok6yPMCQ@mail.gmail.com>
	<CADkLM=cZ7N+f4Bj-8MiccFcTASjBB2r1_s3BD9OFbbQOwK01cg@mail.gmail.com>
	<CACJufxE7yoH42juViFvYuCQMPwXMWxDVwiugs-BW+N4oUXB=1w@mail.gmail.com>
	<CADkLM=dFZ8-mBJDkiZZ4JadnJy8zLExUoo_b1FOs2Ozrtge=gQ@mail.gmail.com>
	<CACJufxHynx40aHHUCR4wZh1qnL=X0yw6baW4Z-+vkUgT0OhjOg@mail.gmail.com>
	<CADkLM=eCPiVhGKcbNW5bUEYpozUaKNXjd_UmBVR256p2zWtYQQ@mail.gmail.com>
	<CACJufxH4LrCpL63SRYO3zVk46YdD4--VYQoBL7GmHmCm=NCAJQ@mail.gmail.com>
	<CADkLM=cmv_bmxBe8KmZd6rEgiqSdoDfHnJa63u7rdRuAsqOwDA@mail.gmail.com>
	<CACJufxGbw9iNT8QVm4QD9cPFKnDnvDBQp7AGxkoqDa-JjzVXmg@mail.gmail.com>
	<CACJufxFkLLuX1VJ-J3fppCr37PHtxkvwyd_e4zNd+VYK0v0gnQ@mail.gmail.com>
	<[email protected]>
	<CACJufxHx-UfprE6P4_ZB_cOYktHd4pLMNx=jWJFOGGGFj2YZWQ@mail.gmail.com>

On Wed, Mar 25, 2026 at 9:14 AM jian he <[email protected]> wrote:

> On Tue, Mar 24, 2026 at 9:13 PM Peter Eisentraut <[email protected]>
> wrote:
> >
> > In patch 0012, I did not apply the changes involving
> > float_*flow_error() in dtof().  These should be considered together
> > with the error handling changes in patch 0018 (about which below).
> >
> > Patch 0004 is probably ok, I just need to study a bit more, since it's
> > a bit different from the other ones.
> >
> > In the comment for patch 0008 you write that supporting soft errors in
> > int4_cash() is not easy.  I suppose this is because of the external
> > function call to int8mul()?  Maybe that was necessary in ancient
> > times, but int8mul() is nowadays just a fmgr wrapper around
> > pg_mul_s64_overflow(), which you can call directly in int4_cash(), and
> > then it should be easy.
> >
>
> cash_numeric is not easy to refactor safely,
> To do this, we have to refactor (numeric_round, numeric_div), which
> will require refactoring more functions.
> So CoercionErrorSafe_Internal still checks whether the source
> element/base type is MONEYOID.
>

What if we just...didn't? The MONEY has been deprecated since 7.4. If we
simply didn't implement this, and someone attempted to use this cast with
default, what bad would happen?


view thread (75+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions
  In-Reply-To: <CADkLM=euzh4v-FK6Tx-yrXfZX4YVd1X5WCpWN7o5=cQsrT7-Yg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox