You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Fix JsonExpr deparsing to emit QUOTES and WRAPPER correctly
Currently, get_json_expr_options() does not emit the default valuesfor QUOTES (KEEP QUOTES) and WRAPPER (WITHOUT WRAPPER). That causesthe deparsed JSON_TABLE() columns, such as those contained in a aview's query, to behave differently when executed than the originaldefinition. That's because the rules encoded intransformJsonTableColumns() will choose either JSON_VALUE() orJSON_QUERY() as implementation to execute a given column's pathexpression depending on the QUOTES and WRAPPER specificationd andthey have slightly different semantics.Reported-by: Jian He <jian.universality@gmail.com>Discussion:https://postgr.es/m/CACJufxEqhqsfrg_p7EMyo5zak3d767iFDL8vz_4%3DZBHpOtrghw%40mail.gmail.com
Table Function Call: JSON_TABLE('null'::jsonb, '$[*]' AS json_table_path_0 PASSING 3 AS a, '"foo"'::jsonb AS "b c" COLUMNS (js json PATH '$', jb jsonb PATH '$', jst text FORMAT JSON PATH '$', jsc character(4) FORMAT JSON PATH '$', jsv character varying(4) FORMAT JSON PATH '$'))
381
+
Table Function Call: JSON_TABLE('null'::jsonb, '$[*]' AS json_table_path_0 PASSING 3 AS a, '"foo"'::jsonb AS "b c" COLUMNS (js json PATH '$' WITHOUT WRAPPER KEEP QUOTES, jb jsonb PATH '$' WITHOUT WRAPPER KEEP QUOTES, jst text FORMAT JSON PATH '$' WITHOUT WRAPPER KEEP QUOTES, jsc character(4) FORMAT JSON PATH '$' WITHOUT WRAPPER KEEP QUOTES, jsv character varying(4) FORMAT JSON PATH '$' WITHOUT WRAPPER KEEP QUOTES))
382
382
(3 rows)
383
383
384
384
EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM jsonb_table_view4;