diff options
author | Alexander Korotkov <akorotkov@postgresql.org> | 2023-04-23 13:55:49 +0300 |
---|---|---|
committer | Alexander Korotkov <akorotkov@postgresql.org> | 2023-04-23 14:00:06 +0300 |
commit | 6e7361c85e95a09ee0d1fbb2f8460962b86489ab (patch) | |
tree | 9e6e62f64372a86231eb40f7a6d40d17e877eff2 | |
parent | 109363de0a8906ed6b0b4ab5f8e8e3daa3df929a (diff) | |
download | postgresql-6e7361c85e95a09ee0d1fbb2f8460962b86489ab.tar.gz postgresql-6e7361c85e95a09ee0d1fbb2f8460962b86489ab.zip |
Fix custom validators call in build_local_reloptions()
We need to call them only when validate == true.
Backpatch to 13, where opclass options were introduced.
Reported-by: Tom Lane
Discussion: https://postgr.es/m/2656633.1681831542%40sss.pgh.pa.us
Reviewed-by: Tom Lane, Pavel Borisov
Backpatch-through: 13
-rw-r--r-- | src/backend/access/common/reloptions.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 24211807ca1..5b696043c54 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -1972,8 +1972,9 @@ build_local_reloptions(local_relopts *relopts, Datum options, bool validate) fillRelOptions(opts, relopts->relopt_struct_size, vals, noptions, validate, elems, noptions); - foreach(lc, relopts->validators) - ((relopts_validator) lfirst(lc)) (opts, vals, noptions); + if (validate) + foreach(lc, relopts->validators) + ((relopts_validator) lfirst(lc)) (opts, vals, noptions); if (elems) pfree(elems); |