pgsql: Enlarge assertion in bloom_init() for false_positive_rate

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Enlarge assertion in bloom_init() for false_positive_rate
Date: 2023-11-08 05:07:24
Message-ID: E1r0ami-004R78-60@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Enlarge assertion in bloom_init() for false_positive_rate

false_positive_rate is a parameter that can be set with the bloom
opclass in BRIN, and setting it to a value of exactly 0.25 would trigger
an assertion in the first INSERT done on the index with value set.

The assertion changed here relied on BLOOM_{MIN|MAX}_FALSE_POSITIVE_RATE
that are somewhat arbitrary values, and specifying an out-of-range value
would also trigger a failure when defining such an index. So, as-is,
the assertion was just doubling on the min-max check of the reloption.
This is now enlarged to check that it is a correct percentage value,
instead, based on a suggestion by Tom Lane.

Author: Alexander Lakhin
Reviewed-by: Tom Lane, Shihao Zhong
Discussion: https://postgr.es/m/17969-a6c54de48026d694@postgresql.org
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4dccf9575369410f0c853e6f1b0b0579c8ec1c05

Modified Files
--------------
src/backend/access/brin/brin_bloom.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2023-11-08 07:55:32 Re: pgsql: Clean up role created in new subscription test.
Previous Message noreply 2023-11-07 23:22:24 pgsql: Tag refs/tags/REL_14_10 was created