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: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Pavel Borisov <pashkin.elfe@gmail.com>, Alexander Lakhin <exclusion@gmail.com>, pgsql-bugs@lists.postgresql.org
Date: 2023-04-18T15:06:41Z
Lists: pgsql-bugs
Alexander Korotkov <aekorotkov@gmail.com> writes:
> LGMT.  I'm going to push v3 unless there are more comments.

I think this reads pretty awkwardly:

+ERROR:  siglen value must be integer-aligned
+DETAIL:  Valid are int-aligned values between "4" and "2024".

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

and leaving out-of-range cases to be handled by the existing check?

			regards, tom lane



Commits

  1. Validate ltree siglen GiST option to be int-aligned

  2. Fix custom validators call in build_local_reloptions()