Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wyTLT-003PbJ-2T for pgsql-bugs@arkaria.postgresql.org; Mon, 24 Aug 2026 12:00:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wyTLS-002CW3-1w for pgsql-bugs@arkaria.postgresql.org; Mon, 24 Aug 2026 12:00:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wyTLS-002CVv-17 for pgsql-bugs@lists.postgresql.org; Mon, 24 Aug 2026 12:00:06 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wyTLQ-00000002B5J-3C0h for pgsql-bugs@lists.postgresql.org; Mon, 24 Aug 2026 12:00:05 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-c1677c91969so406248866b.1 for ; Mon, 24 Aug 2026 05:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787572803; x=1788177603; darn=lists.postgresql.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mRguAMUyrGURDlxHDLHgaHnkdHOBWti8ER8MavTx9uY=; b=TAUm9MNuJqEjxKJBKJNHh6qeZ5aiaFAVst010ru4pm3qE3R9Vuby4SXpm1gOiajZBf JMmrRiYdLUdd920ma50eoHvZ8J1MdgxSjPEbZen6/Yu/TDtIeWfIZhXO/ycDE/P/JkOe D01tSXBFElYMc6SGHBFDhPrBfGWU8InLSIz/Wxp0hsS9bbKhT9TPg4McMv2bJ1GUyoHi QDwAR+8fGJ5CqwA0Q4l2HMK284K46pXMQ550mwZwvYE/Aco/nVKzDeN988Qe5J8KJo1B eJ7glHeEDcZAZWDDEVLVyLsiAo8zs1gqZG1x8BdH/Dp4qMuOkHNzGHSY2qbZZHirSuvd GhVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787572803; x=1788177603; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=mRguAMUyrGURDlxHDLHgaHnkdHOBWti8ER8MavTx9uY=; b=kPMevHiifBYQbPjbOHcJaYY9ByKAxuKAEhKx2zmcLrq7XrAVfg4VQi8Y0Xo+7POc9e eZcgTKtBUg1KBmMOYwORz4WaJxUbphHleGRv6vm3VNkNeuDEC0P6lcbO9ev5H4xi1P8Y WmtClwb9PJLmgdGEudrYHLsYGrbfoqQgc/pso3Qjai0kUlflLEVb73MKqZG9Ktj4IR/f fj5pOe6O+4/n0IqcUnr4nYuBV8oAZ0k7EWV1Y2TlmuqIWG7oR7Pl5sL65ql5VQbt0sES myC6xCqx4jW2DJ7n9LD8FSx29h/598stB0yUutkx/7o1nJygplVAGnwSusnn5qqyfvAW xcJQ== X-Forwarded-Encrypted: i=1; AHgh+RphT8AiTuSPi4aRcWEyEjwj65Ek3Wjq/JuXYCKq4sCAp6jir2eKlm/OglZa/y0SwPLTKhzMPzGiZjCy@lists.postgresql.org X-Gm-Message-State: AFuF++m8fzsqhJXhmHrZhmv7XsyT7adxFIgAphhxb9ilyXUAsrVOi/Tt rjt+o/ycc5SDxk0qHUCkglAjqcArgYKu6zqeCbyKXF0a78+XmIMVU57K X-Gm-Gg: AR+sD13A3VCpTXgeL1fnlElOwMPKU+w5oOp+UezkxHZSFcqYVoDgY0jAREhdsMu05ui cNrSXSdoJSR2Hg7BOAM3WxMpMthwHt/w5ks2cu1T0TSRwkzm4a2rbaiDCGKSKx1n9W3Um/OGfQi dPiPDmlChW6/CJ1IdqvvFP5MNrRxuhGGW7YWSbwfbF70ry+hFs2LY2FkNZ/of91o6bBbUnLsjt5 E3YosE29z4vbk0c/69ELmIBbWpFAW7MYXRNMqNZFlWmE1YMSaGWIQ5w8yrt77dDBcD3zMKwkwSq /L0IQCCFpQ4vHXa8uzuMXwO8un7cuZXQkaJitLfHN7XAwDR9/uuh321fSh56ydciPBqA26tLG4v 2cIWZCSHUwavCiu18hYN8Ez7s3Db6lUMalcGOL5OMqRDcLiyty+HyXfEXQ12TV3JMBwVUSd5OMC AtNxRvfQ4yIzyvwDo2+Z6DtFt1rdaIycX9a4SujZEf3RGW3cu6RHW3qrDa06UBmf4= X-Received: by 2002:a17:907:c245:b0:c24:6f95:4f0e with SMTP id a640c23a62f3a-c2492719d94mr2124274766b.18.1787572802886; Mon, 24 Aug 2026 05:00:02 -0700 (PDT) Received: from [192.168.0.50] ([89.149.107.253]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c24968abf18sm1323810766b.61.2026.08.24.05.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Aug 2026 05:00:02 -0700 (PDT) Message-ID: Date: Mon, 24 Aug 2026 15:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #19629: pg_restore_relation_stats reports XX000 instead of proper SQLSTATE for input validation errors To: Fujii Masao , Michael Paquier Cc: Ayush Tiwari , hackerzheng666@gmail.com, pgsql-bugs@lists.postgresql.org References: <19629-76babc04b683594d@postgresql.org> Content-Language: en-US From: Alexander Lakhin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, 21.08.2026 11:41, Fujii Masao wrote: > On Fri, Aug 21, 2026 at 7:30 AM Michael Paquier 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