aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonpath_exec.c
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2024-06-17 10:31:29 -0400
committerAndrew Dunstan <andrew@dunslane.net>2024-06-17 10:31:29 -0400
commit653d3969bb013f14c4a6884a253ad9676caf8166 (patch)
treec12871a8d357b249f3a3ee8268883d2febcce932 /src/backend/utils/adt/jsonpath_exec.c
parent81d20fbf7a03f5e385700c90aec883c96b32ddc6 (diff)
downloadpostgresql-653d3969bb013f14c4a6884a253ad9676caf8166.tar.gz
postgresql-653d3969bb013f14c4a6884a253ad9676caf8166.zip
Teach jsonpath string() to unwrap in lax mode
This was an ommission in commit 66ea94e, and brings it into compliance with both other methods and the standard. Per complaint from David Wheeler. Author: David Wheeler, Jeevan Chalke Reviewed-by: Chapman Flack Discussion: https://postgr.es/m/A64AE04F-4410-42B7-A141-7A7349260F4D@justatheory.com
Diffstat (limited to 'src/backend/utils/adt/jsonpath_exec.c')
-rw-r--r--src/backend/utils/adt/jsonpath_exec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index ceb30033e1c..c30d059a762 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -1606,6 +1606,9 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
JsonbValue jbv;
char *tmp = NULL;
+ if (unwrap && JsonbType(jb) == jbvArray)
+ return executeItemUnwrapTargetArray(cxt, jsp, jb, found, false);
+
switch (JsonbType(jb))
{
case jbvString: