[PATCH] Add tests for maximum tuple and index entry sizes

Поиск
Список
Период
Сортировка
От Henson Choi
Тема [PATCH] Add tests for maximum tuple and index entry sizes
Дата
Msg-id CAAAe_zB0WpvGiaJq0ZXkiAWjKP6HKcbxJ9=rKRVk3-kZcj7gfA@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
Hi hackers,

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.

Patch attached.

Best regards,
Henson Choi
Вложения

В списке pgsql-hackers по дате отправления: