Re: More jsonpath methods: translate, split, join - Mailing list pgsql-hackers

From Zsolt Parragi
Subject Re: More jsonpath methods: translate, split, join
Date
Msg-id CAN4CZFMGKt2=QnGJ74yU_Ds1dDT29abgoZUspq20szAgbRHF4A@mail.gmail.com
Whole thread
In response to Re: More jsonpath methods: translate, split, join  (Florents Tselai <florents.tselai@gmail.com>)
Responses Re: More jsonpath methods: translate, split, join
List pgsql-hackers
Hello

+                /* Validate target is an array */
+                if (JsonbType(jb) != jbvArray)
+                {
+                    RETURN_ERROR(ereport(ERROR,
+                                         (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+                                          errmsg("jsonpath item method .join() can only be applied
to an array"))));

Other methods seem to use ERRCODE_SQL_JSON_ARRAY_NOT_FOUND

+                else
+                {
+                    /* Recursive Tree (jbvArray) */
+                    for (int i = 0; i < jb->val.array.nElems; i++)

Isn't this branch unreachable?



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Fix \crosstabview to honor \pset display_true/display_false
Next
From: Melanie Plageman
Date:
Subject: Re: Checkpointer write combining