Refactor code used by jsonpath executor to fetch variables Currently, getJsonPathVariable() directly extracts a named variable/key from the source Jsonb value. This commit puts that logic into a callback function called by getJsonPathVariable(). Other implementations of the callback may accept different forms of the source value(s), for example, a List of values passed from outside jsonpath_exec.c.
Extracted from a much larger patch to add SQL/JSON query functions. Author: Nikita Glukhov <n.glu...@postgrespro.ru> Author: Teodor Sigaev <teo...@sigaev.ru> Author: Oleg Bartunov <obartu...@gmail.com> Author: Alexander Korotkov <aekorot...@gmail.com> Author: Andrew Dunstan <and...@dunslane.net> Author: Amit Langote <amitlangot...@gmail.com> Reviewers have included (in no particular order) Andres Freund, Alexander Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers, Zihong Yu, Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby, Álvaro Herrera, Jian He, Peter Eisentraut Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886dea...@postgrespro.ru Discussion: https://postgr.es/m/20220616233130.rparivafipt6d...@alap3.anarazel.de Discussion: https://postgr.es/m/abd9b83b-aa66-f230-3d6d-734817f0995d%40postgresql.org Discussion: https://postgr.es/m/ca+hiwqhropf9e644d8brqyvaapmgbzvup-xkmdpk-nd4epg...@mail.gmail.com Discussion: https://postgr.es/m/CA+HiwqE4XTdfb1nW=ojoy_tqsrhyt-q_kb6i5d4xckyrlc1...@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/faa2b953ba3be0fac9af614ac14e34cf3a0a2c46 Modified Files -------------- src/backend/utils/adt/jsonpath_exec.c | 136 +++++++++++++++++++++++++--------- 1 file changed, 99 insertions(+), 37 deletions(-)