aboutsummaryrefslogtreecommitdiff
path: root/contrib/intarray
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-03-06 17:24:05 +0900
committerMichael Paquier <michael@paquier.xyz>2024-03-06 17:24:05 +0900
commit4ec8f7708b6b4c494bd0ccd937fc28d34a872b49 (patch)
treefda422818b6236d76dfbc280d04cb99332ac64e6 /contrib/intarray
parent8870c54d8a17da3e2f7597acf2922f0fb8eadfa5 (diff)
downloadpostgresql-4ec8f7708b6b4c494bd0ccd937fc28d34a872b49.tar.gz
postgresql-4ec8f7708b6b4c494bd0ccd937fc28d34a872b49.zip
Fix parallel-safety check of expressions and predicate for index builds
As coded, the planner logic that calculates the number of parallel workers to use for a parallel index build uses expressions and predicates from the relcache, which are flattened for the planner by eval_const_expressions(). As reported in the bug, an immutable parallel-unsafe function flattened in the relcache would become a Const, which would be considered as parallel-safe, even if the predicate or the expressions including the function are not safe in parallel workers. Depending on the expressions or predicate used, this could cause the parallel build to fail. Tests are included that check parallel index builds with parallel-unsafe predicate and expressions. Two routines are added to lsyscache.h to be able to retrieve expressions and predicate of an index from its pg_index data. Reported-by: Alexander Lakhin Author: Tender Wang Reviewed-by: Jian He, Michael Paquier Discussion: https://postgr.es/m/CAHewXN=UaAaNn9ruHDH3Os8kxLVmtWqbssnf=dZN_s9=evHUFA@mail.gmail.com Backpatch-through: 12
Diffstat (limited to 'contrib/intarray')
0 files changed, 0 insertions, 0 deletions