Hello,
21.08.2026 11:41, Fujii Masao wrote:
> On Fri, Aug 21, 2026 at 7:30 AM Michael Paquier <michael@paquier.xyz> wrote:
>> Adding an errcode() is a life improvement thing. So, while I agree
>> that the proposed patch is an improvement, I don't see a strong need
>> for a backpatch. Feel free to override this argument as you feel, of
>> course.
> I understand your point, but I'm inclined to backpatch this to v18.
>
> These are input-validation errors that are directly reachable from SQL,
> and the SQLSTATE is exposed to applications. Since applications commonly
> branch on SQLSTATE, reporting XX000 makes these errors look like internal
> errors rather than invalid input. That seems more like a bug than
> a cosmetic improvement to me.
>
>> I'd suggest to keep things isolated in their own fashion, as they
>> address different areas with slightly different user-changes changes
>> (okay, not much).
FWIW, I have my own collection of XX000 errors that can be reached by
users. I see there are distinct bug reports following this one, but I
guess, it won't be convenient to process dozens of such reports (if I
add mine). Maybe it would make sense to create a wiki page to
enumerate all these legally reachable internal errors (probably some of
them would stay as-is)...
What do you think?
Just a couple of examples to be concrete:
do $$ #print_strict_params XXX $$;
ERROR: XX000: unrecognized print_strict_params option xxx
select pg_catalog.range_in('', 23, 0);
ERROR: XX000: type 23 is not a range type
Best regards,
Alexander