summaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
authorAndrew Dunstan2022-04-04 19:36:03 +0000
committerAndrew Dunstan2022-04-04 20:03:47 +0000
commit4e34747c88a03ede6e9d731727815e37273d4bc9 (patch)
treec7318a224b908c5dbaba3198324c90ec5429c3a5 /src/backend/commands
parentc42a6fc41dc22b42e5417224440c02893996afb4 (diff)
JSON_TABLE
This feature allows jsonb data to be treated as a table and thus used in a FROM clause like other tabular data. Data can be selected from the jsonb using jsonpath expressions, and hoisted out of nested structures in the jsonb to form multiple rows, more or less like an outer join. Nikita Glukhov Reviewers have included (in no particular order) Andres Freund, Alexander Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers, Zhihong Yu (whose name I previously misspelled), Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby. Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/explain.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index cb13227db1f..1e5701b8eba 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -3796,7 +3796,13 @@ ExplainTargetRel(Plan *plan, Index rti, ExplainState *es)
break;
case T_TableFuncScan:
Assert(rte->rtekind == RTE_TABLEFUNC);
- objectname = "xmltable";
+ if (rte->tablefunc)
+ if (rte->tablefunc->functype == TFT_XMLTABLE)
+ objectname = "xmltable";
+ else /* Must be TFT_JSON_TABLE */
+ objectname = "json_table";
+ else
+ objectname = NULL;
objecttag = "Table Function Name";
break;
case T_ValuesScan: