JsonbValue jbv;
char *tmp = NULL;
+ if (unwrap && JsonbType(jb) == jbvArray)
+ return executeItemUnwrapTargetArray(cxt, jsp, jb, found, false);
+
switch (JsonbType(jb))
{
case jbvString:
(0 rows)
select jsonb_path_query('[]', '$.string()');
-ERROR: jsonpath item method .string() can only be applied to a bool, string, numeric, or datetime value
+ jsonb_path_query
+------------------
+(0 rows)
+
select jsonb_path_query('[]', 'strict $.string()');
ERROR: jsonpath item method .string() can only be applied to a bool, string, numeric, or datetime value
select jsonb_path_query('{}', '$.string()');
"string"
(1 row)
+select jsonb_path_query('[2, true]', '$.string()');
+ jsonb_path_query
+------------------
+ "2"
+ "true"
+(2 rows)
+
select jsonb_path_query('"2023-08-15 12:34:56 +5:30"', '$.timestamp().string()');
ERROR: cannot convert value from timestamptz to timestamp without time zone usage
HINT: Use *_tz() function for time zone support.
select jsonb_path_query('1234', '$.string()');
select jsonb_path_query('true', '$.string()');
select jsonb_path_query('1234', '$.string().type()');
+select jsonb_path_query('[2, true]', '$.string()');
select jsonb_path_query('"2023-08-15 12:34:56 +5:30"', '$.timestamp().string()');
select jsonb_path_query_tz('"2023-08-15 12:34:56 +5:30"', '$.timestamp().string()'); -- should work
select jsonb_path_query_array('[1.23, "yes", false]', '$[*].string()');