Refactoring: Use soft error reporting for *_opt_error functions

From: Amul Sul <sulamul(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Refactoring: Use soft error reporting for *_opt_error functions
Date: 2025-09-01 09:35:16
Message-ID: CAAJ_b96No5h5tRuR+KhcC44YcYUCw8WAHuLoqqyyop8_k3+JDQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While reviewing version v6 of the CAST(... ON DEFAULT) patch [1], I
noticed that it attempts to change the type conversion function to use
soft error reporting. However, some of the underlying functions of the
type conversion, such as *_opt_error, still rely on a boolean argument
passed by the caller. This results in an error flag being set rather
than a proper error being thrown.

I believe we should update all *_opt_error functions to use the new
soft error reporting infrastructure instead of boolean flags -- did
the same in the attached patch. I am not sure if this patch should be
part of that thread[1]. It's a significant improvement in itself, as
it would make the code more compact and consistent.

1]http://postgr.es/m/CACJufxE053=bO3pDUpGba6Yz3VGpU_XCbg4HO6Rew5EJ7k7VnQ@mail.gmail.com

--
Regards,
Amul Sul
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
0001-Change-_opt_error-to-soft-error-reporting.patch application/x-patch 28.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2025-09-01 09:40:05 Re: Raw parse tree is not dumped to log
Previous Message vignesh C 2025-09-01 09:25:15 Re: New commitfest app release on August 19th