Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ponDH-0000wh-JT for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Apr 2023 15:25:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ponDG-0003XC-Gc for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Apr 2023 15:25:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ponDG-0003X2-8J for pgsql-bugs@lists.postgresql.org; Tue, 18 Apr 2023 15:25:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ponDD-000WOP-Vp for pgsql-bugs@lists.postgresql.org; Tue, 18 Apr 2023 15:25:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33IFPgrv2656634; Tue, 18 Apr 2023 11:25:42 -0400 From: Tom Lane To: Pavel Borisov cc: Alexander Korotkov , Alexander Lakhin , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17847: Unaligned memory access in ltree_gist In-reply-to: References: <17847-171232970bea406b@postgresql.org> <3966266.1678995315@sss.pgh.pa.us> <365d1917-f5b7-ff20-2d0b-8d501cee5434@gmail.com> <2654443.1681830401@sss.pgh.pa.us> Comments: In-reply-to Pavel Borisov message dated "Tue, 18 Apr 2023 19:19:27 +0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2656632.1681831542.1@sss.pgh.pa.us> Date: Tue, 18 Apr 2023 11:25:42 -0400 Message-ID: <2656633.1681831542@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Pavel Borisov writes: > On Tue, 18 Apr 2023 at 19:06, Tom Lane wrote: >> The DETAIL message's grammar seems a bit off. Also, this is confusing the >> range limitation with the alignment requirement. How about just saying >> ERROR: siglen value must be a multiple of 4 > I definitely like this wording. >> and leaving out-of-range cases to be handled by the existing check? > But that means that if we try 2025 then we just get it is not multiple > of 4 (and no clue of the range). Then we try 2028 and get another > error that it's outside of range. I suppose giving clues one by one > makes this look like a step-by-step quest. But in principle it's > possible. Well, that's the case just about everywhere else that there are multiple constraints on an input. It'd be impossibly unwieldy, and confusing, for every error message to include details on all the other errors you might have hit if you didn't hit that one. FWIW, I find it odd that the multiple-of-4 error comes out in advance of the range check; that seems backwards somehow. Maybe we should alter the order of applying the range check and the custom validator? regards, tom lane