pgsql: Move resowner from common JitContext to LLVM specific

2024-07-19 Thread Heikki Linnakangas
Move resowner from common JitContext to LLVM specific Only the LLVM specific code uses it since resource owners were made extensible in commit b8bff07daa85c837a2747b4d35cd5a27e73fb7b2. This is new in v17, so backpatch there to keep the branches from diverging just yet. Author: Andreas Karlsson D

pgsql: Move resowner from common JitContext to LLVM specific

2024-07-19 Thread Heikki Linnakangas
Move resowner from common JitContext to LLVM specific Only the LLVM specific code uses it since resource owners were made extensible in commit b8bff07daa85c837a2747b4d35cd5a27e73fb7b2. This is new in v17, so backpatch there to keep the branches from diverging just yet. Author: Andreas Karlsson D

pgsql: Add more test coverage for jsonpath "$.*" with arrays

2024-07-19 Thread Michael Paquier
Add more test coverage for jsonpath "$.*" with arrays There was no coverage for the code path to unwrap an array before applying ".*" to it, so add tests to provide more coverage for both objects and arrays. This shows, for example, that no results are returned for an array of scalars, and what r

pgsql: Test that vacuum removes tuples older than OldestXmin

2024-07-19 Thread Melanie Plageman
Test that vacuum removes tuples older than OldestXmin If vacuum fails to prune a tuple killed before OldestXmin, it will decide to freeze its xmax and later error out in pre-freeze checks. Add a test reproducing this scenario to the recovery suite which creates a table on a primary, updates the t

pgsql: Ensure vacuum removes all visibly dead tuples older than OldestX

2024-07-19 Thread Melanie Plageman
Ensure vacuum removes all visibly dead tuples older than OldestXmin If vacuum fails to remove a tuple with xmax older than VacuumCutoffs->OldestXmin and younger than GlobalVisState->maybe_needed, it will loop infinitely in lazy_scan_prune(), which compares tuples' visibility information to OldestX

pgsql: Test that vacuum removes tuples older than OldestXmin

2024-07-19 Thread Melanie Plageman
Test that vacuum removes tuples older than OldestXmin If vacuum fails to prune a tuple killed before OldestXmin, it will decide to freeze its xmax and later error out in pre-freeze checks. Add a test reproducing this scenario to the recovery suite which creates a table on a primary, updates the t

pgsql: Ensure vacuum removes all visibly dead tuples older than OldestX

2024-07-19 Thread Melanie Plageman
Ensure vacuum removes all visibly dead tuples older than OldestXmin If vacuum fails to remove a tuple with xmax older than VacuumCutoffs->OldestXmin and younger than GlobalVisState->maybe_needed, it will loop infinitely in lazy_scan_prune(), which compares tuples' visibility information to OldestX

pgsql: Ensure vacuum removes all visibly dead tuples older than OldestX

2024-07-19 Thread Melanie Plageman
Ensure vacuum removes all visibly dead tuples older than OldestXmin If vacuum fails to remove a tuple with xmax older than VacuumCutoffs->OldestXmin and younger than GlobalVisState->maybe_needed, it may attempt to freeze the tuple's xmax and then ERROR out in pre-freeze checks with "cannot freeze

pgsql: Test that vacuum removes tuples older than OldestXmin

2024-07-19 Thread Melanie Plageman
Test that vacuum removes tuples older than OldestXmin If vacuum fails to prune a tuple killed before OldestXmin, it will later find that tuple dead in lazy_scan_prune() and loop infinitely. Add a test reproducing this scenario to the recovery suite which creates a table on a primary, updates the

pgsql: Test that vacuum removes tuples older than OldestXmin

2024-07-19 Thread Melanie Plageman
Test that vacuum removes tuples older than OldestXmin If vacuum fails to prune a tuple killed before OldestXmin, it will later find that tuple dead in lazy_scan_prune() and loop infinitely. Add a test reproducing this scenario to the recovery suite which creates a table on a primary, updates the

pgsql: Test that vacuum removes tuples older than OldestXmin

2024-07-19 Thread Melanie Plageman
Test that vacuum removes tuples older than OldestXmin If vacuum fails to prune a tuple killed before OldestXmin, it will later find that tuple dead in lazy_scan_prune() and loop infinitely. Add a test reproducing this scenario to the recovery suite which creates a table on a primary, updates the

pgsql: Ensure vacuum removes all visibly dead tuples older than OldestX

2024-07-19 Thread Melanie Plageman
Ensure vacuum removes all visibly dead tuples older than OldestXmin If vacuum fails to remove a tuple with xmax older than VacuumCutoffs->OldestXmin and younger than GlobalVisState->maybe_needed, it may attempt to freeze the tuple's xmax and then ERROR out in pre-freeze checks with "cannot freeze

pgsql: Ensure vacuum removes all visibly dead tuples older than OldestX

2024-07-19 Thread Melanie Plageman
Ensure vacuum removes all visibly dead tuples older than OldestXmin If vacuum fails to remove a tuple with xmax older than VacuumCutoffs->OldestXmin and younger than GlobalVisState->maybe_needed, it will loop infinitely in lazy_scan_prune(), which compares tuples' visibility information to OldestX

pgsql: Add overflow checks to money type.

2024-07-19 Thread Nathan Bossart
Add overflow checks to money type. None of the arithmetic functions for the the money type handle overflow. This commit introduces several helper functions with overflow checking and makes use of them in the money type's arithmetic functions. Fixes bug #18240. Reported-by: Alexander Lakhin Auth

pgsql: Add overflow checks to money type.

2024-07-19 Thread Nathan Bossart
Add overflow checks to money type. None of the arithmetic functions for the the money type handle overflow. This commit introduces several helper functions with overflow checking and makes use of them in the money type's arithmetic functions. Fixes bug #18240. Reported-by: Alexander Lakhin Auth

pgsql: Add overflow checks to money type.

2024-07-19 Thread Nathan Bossart
Add overflow checks to money type. None of the arithmetic functions for the the money type handle overflow. This commit introduces several helper functions with overflow checking and makes use of them in the money type's arithmetic functions. Fixes bug #18240. Reported-by: Alexander Lakhin Auth

pgsql: Add overflow checks to money type.

2024-07-19 Thread Nathan Bossart
Add overflow checks to money type. None of the arithmetic functions for the the money type handle overflow. This commit introduces several helper functions with overflow checking and makes use of them in the money type's arithmetic functions. Fixes bug #18240. Reported-by: Alexander Lakhin Auth

pgsql: Add overflow checks to money type.

2024-07-19 Thread Nathan Bossart
Add overflow checks to money type. None of the arithmetic functions for the the money type handle overflow. This commit introduces several helper functions with overflow checking and makes use of them in the money type's arithmetic functions. Fixes bug #18240. Reported-by: Alexander Lakhin Auth

pgsql: Add overflow checks to money type.

2024-07-19 Thread Nathan Bossart
Add overflow checks to money type. None of the arithmetic functions for the the money type handle overflow. This commit introduces several helper functions with overflow checking and makes use of them in the money type's arithmetic functions. Fixes bug #18240. Reported-by: Alexander Lakhin Auth

pgsql: Add overflow checks to money type.

2024-07-19 Thread Nathan Bossart
Add overflow checks to money type. None of the arithmetic functions for the the money type handle overflow. This commit introduces several helper functions with overflow checking and makes use of them in the money type's arithmetic functions. Fixes bug #18240. Reported-by: Alexander Lakhin Auth