pgsql: Refactor code used by jsonpath executor to fetch variables

From: Amit Langote <amitlan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Refactor code used by jsonpath executor to fetch variables
Date: 2024-01-24 06:21:50
Message-ID: E1rSWdy-002qPV-A1@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)gluhov(at)postgrespro(dot)ru>
Author: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Author: Oleg Bartunov <obartunov(at)gmail(dot)com>
Author: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Author: Andrew Dunstan <andrew(at)dunslane(dot)net>
Author: Amit Langote <amitlangote09(at)gmail(dot)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-904886deac4b@postgrespro.ru
Discussion: https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.de
Discussion: https://postgr.es/m/abd9b83b-aa66-f230-3d6d-734817f0995d%40postgresql.org
Discussion: https://postgr.es/m/CA+HiwqHROpf9e644D8BRqYvaAPmgBZVup-xKMDPk-nd4EpgzHw@mail.gmail.com
Discussion: https://postgr.es/m/CA+HiwqE4XTdfb1nW=Ojoy_tQSRhYt-q_kb6i5d4xcKyrLC1Nbg@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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2024-01-24 07:55:38 pgsql: pgbench: Add \syncpipeline
Previous Message Amit Langote 2024-01-24 06:16:30 pgsql: Add soft error handling to some expression nodes