pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Document behavior of the .** jsonpath accessor in the lax mode 3+ messages / 1 participants [nested] [flat]
* pgsql: Document behavior of the .** jsonpath accessor in the lax mode @ 2021-01-29 12:28 Alexander Korotkov <akorotkov@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Alexander Korotkov @ 2021-01-29 12:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Document behavior of the .** jsonpath accessor in the lax mode When the .** jsonpath accessor handles the array, it selects both array and each of its elements. When using lax mode, subsequent accessors automatically unwrap arrays. So, the content of each array element may be selected twice. Even though this behavior is counterintuitive, it's correct because everything works as designed. This commit documents it. Backpatch to 12 where the jsonpath language was introduced. Reported-by: Thomas Kellerer Bug: #16828 Discussion: https://postgr.es/m/16828-2b0229babfad2d8c%40postgresql.org Discussion: https://postgr.es/m/CAPpHfdtS-nNidT%3DEqZbAYOPcnNOWh_sd6skVdu2CAQUGdvpT8Q%40mail.gmail.com Author: Alexandex Korotkov, revised by Tom Lane Reviewed-by: Alvaro Herrera, Thomas Kellerer, Tom Lane Backpatch-through: 12 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/b41645460af563cfd4e4f57f354058cf69ef3b14 Modified Files -------------- doc/src/sgml/func.sgml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Document behavior of the .** jsonpath accessor in the lax mode @ 2021-01-29 12:28 Alexander Korotkov <akorotkov@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Alexander Korotkov @ 2021-01-29 12:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Document behavior of the .** jsonpath accessor in the lax mode When the .** jsonpath accessor handles the array, it selects both array and each of its elements. When using lax mode, subsequent accessors automatically unwrap arrays. So, the content of each array element may be selected twice. Even though this behavior is counterintuitive, it's correct because everything works as designed. This commit documents it. Backpatch to 12 where the jsonpath language was introduced. Reported-by: Thomas Kellerer Bug: #16828 Discussion: https://postgr.es/m/16828-2b0229babfad2d8c%40postgresql.org Discussion: https://postgr.es/m/CAPpHfdtS-nNidT%3DEqZbAYOPcnNOWh_sd6skVdu2CAQUGdvpT8Q%40mail.gmail.com Author: Alexandex Korotkov, revised by Tom Lane Reviewed-by: Alvaro Herrera, Thomas Kellerer, Tom Lane Backpatch-through: 12 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9915fe22969a46f9d06d6c2c53dea7269ec4cc7e Modified Files -------------- doc/src/sgml/func.sgml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Document behavior of the .** jsonpath accessor in the lax mode @ 2021-01-29 12:28 Alexander Korotkov <akorotkov@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Alexander Korotkov @ 2021-01-29 12:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Document behavior of the .** jsonpath accessor in the lax mode When the .** jsonpath accessor handles the array, it selects both array and each of its elements. When using lax mode, subsequent accessors automatically unwrap arrays. So, the content of each array element may be selected twice. Even though this behavior is counterintuitive, it's correct because everything works as designed. This commit documents it. Backpatch to 12 where the jsonpath language was introduced. Reported-by: Thomas Kellerer Bug: #16828 Discussion: https://postgr.es/m/16828-2b0229babfad2d8c%40postgresql.org Discussion: https://postgr.es/m/CAPpHfdtS-nNidT%3DEqZbAYOPcnNOWh_sd6skVdu2CAQUGdvpT8Q%40mail.gmail.com Author: Alexandex Korotkov, revised by Tom Lane Reviewed-by: Alvaro Herrera, Thomas Kellerer, Tom Lane Backpatch-through: 12 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/bd6366129b1b97769c5293da1ec7f112cc68a444 Modified Files -------------- doc/src/sgml/func.sgml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-01-29 12:28 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-01-29 12:28 pgsql: Document behavior of the .** jsonpath accessor in the lax mode Alexander Korotkov <akorotkov@postgresql.org> 2021-01-29 12:28 pgsql: Document behavior of the .** jsonpath accessor in the lax mode Alexander Korotkov <akorotkov@postgresql.org> 2021-01-29 12:28 pgsql: Document behavior of the .** jsonpath accessor in the lax mode Alexander Korotkov <akorotkov@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox