Re: More jsonpath methods: translate, split, join

Zsolt Parragi <zsolt.parragi@percona.com>

From: Zsolt Parragi <zsolt.parragi@percona.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2026-06-19T20:42:56Z
Lists: 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?