Re: BUG #17847: Unaligned memory access in ltree_gist
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Borisov <pashkin.elfe@gmail.com>
Cc: Alexander Korotkov <aekorotkov@gmail.com>,
Alexander Lakhin <exclusion@gmail.com>,
pgsql-bugs@lists.postgresql.org
Date: 2023-04-18T15:25:42Z
Lists: pgsql-bugs
Pavel Borisov <pashkin.elfe@gmail.com> writes: > On Tue, 18 Apr 2023 at 19:06, Tom Lane <tgl@sss.pgh.pa.us> 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
Commits
-
Validate ltree siglen GiST option to be int-aligned
- f4a4a18ecbdb 14.8 landed
- 214495dc5b71 15.3 landed
- 8bbd0cce92be 16.0 landed
- 48c6825d0ec8 13.11 landed
-
Fix custom validators call in build_local_reloptions()
- 02191136cb25 13.11 landed
- 9ef5a3583784 14.8 landed
- 6e7361c85e95 15.3 landed
- cd115c3530bd 16.0 landed