agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Fujii Masao <masao.fujii@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Cc: hackerzheng666@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19629: pg_restore_relation_stats reports XX000 instead of proper SQLSTATE for input validation errors
Date: Mon, 24 Aug 2026 15:00:01 +0300
Message-ID: <bea2e8a5-4d84-4ecf-9433-470fc356ef9f@gmail.com> (raw)
In-Reply-To: <CAHGQGwG4aJ8xpjGphoW3e0-TA1MSXOcYnarMQ2dKWrVJQjtYTw@mail.gmail.com>
References: <19629-76babc04b683594d@postgresql.org>
	<CAHGQGwHZLiLa9iM7NAiugp1B7CumN94=YBeho9t=qKJMnTGwMQ@mail.gmail.com>
	<CAJTYsWX8WYhEC-A92cfDGSUxOZmk474_knCnwYmUiXELQnPtGA@mail.gmail.com>
	<aoeAHXVBs8S5mk-c@paquier.xyz>
	<CAHGQGwG4aJ8xpjGphoW3e0-TA1MSXOcYnarMQ2dKWrVJQjtYTw@mail.gmail.com>

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





view thread (11+ messages)  latest in thread

Message-ID: <bea2e8a5-4d84-4ecf-9433-470fc356ef9f@gmail.com>
Permalink:  ../bea2e8a5-4d84-4ecf-9433-470fc356ef9f@gmail.com/
Also on:    postgresql.org/message-id/bea2e8a5-4d84-4ecf-9433-470fc356ef9f@gmail.com

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: pgsql-bugs@postgresql.org
  Cc: exclusion@gmail.com, masao.fujii@gmail.com, michael@paquier.xyz, ayushtiwari.slg01@gmail.com, hackerzheng666@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19629: pg_restore_relation_stats reports XX000 instead of proper SQLSTATE for input validation errors
  In-Reply-To: <bea2e8a5-4d84-4ecf-9433-470fc356ef9f@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