I'd like to propose adding regression tests that verify size limit enforcement for heap tuples and index entries at their boundaries. These tests ensure that the limits are correctly applied and appropriate error messages are shown when exceeded.
The patch adds three boundary tests:
1. Heap tuple maximum size (8160 bytes) Tests inserting 8128-byte and 8129-byte text values. The former succeeds while the latter fails because MAXALIGN rounds the 8161-byte tuple to 8168 bytes, exceeding the limit.
2. B-tree index maximum entry size (approximately 2704 bytes) Tests indexing 2692-byte and 2693-byte text values. The limit is 1/3 of page size to ensure proper page splits.
3. GiST index maximum siglen parameter (2024) Tests creating indexes with siglen=2024 and siglen=2025. The limit comes from the page size constraints for GiST index tuples.
These boundary tests use values that differ by only 1 byte or unit to clearly demonstrate the exact limits, making it easier to catch regressions if these limits change in the future.
The tests are added to existing test files (insert.sql, btree_index.sql, and tsearch.sql) with their corresponding expected outputs.
Tested on: REL_14_STABLE through master Note: Applies cleanly to REL_15_STABLE and later.
REL_14_STABLE requires minor adjustments due to test file differences.
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.