mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
PLAN clauses for JSON_TABLE
These clauses allow the user to specify how data from nested paths are joined, allowing considerable freedom in shaping the tabular output of JSON_TABLE. PLAN DEFAULT allows the user to specify the global strategies when dealing with sibling or child nested paths. The is often sufficient to achieve the necessary goal, and is considerably simpler than the full PLAN clause, which allows the user to specify the strategy to be used for each named nested path. Nikita Glukhov Reviewers have included (in no particular order) Andres Freund, Alexander Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers, Zhihong Yu, Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby. Discussion: https://postgr.es/m/7e2cb85d-24cf-4abb-30a5-1a33715959bd@postgrespro.ru
This commit is contained in:
@ -867,6 +867,25 @@ makeJsonBehavior(JsonBehaviorType type, Node *default_expr)
|
||||
return behavior;
|
||||
}
|
||||
|
||||
/*
|
||||
* makeJsonTableJoinedPlan -
|
||||
* creates a joined JsonTablePlan node
|
||||
*/
|
||||
Node *
|
||||
makeJsonTableJoinedPlan(JsonTablePlanJoinType type, Node *plan1, Node *plan2,
|
||||
int location)
|
||||
{
|
||||
JsonTablePlan *n = makeNode(JsonTablePlan);
|
||||
|
||||
n->plan_type = JSTP_JOINED;
|
||||
n->join_type = type;
|
||||
n->plan1 = castNode(JsonTablePlan, plan1);
|
||||
n->plan2 = castNode(JsonTablePlan, plan2);
|
||||
n->location = location;
|
||||
|
||||
return (Node *) n;
|
||||
}
|
||||
|
||||
/*
|
||||
* makeJsonEncoding -
|
||||
* converts JSON encoding name to enum JsonEncoding
|
||||
|
Reference in New Issue
Block a user