#include <ctype.h>
-#include "foreign/fdwapi.h"
+#include "lib/stringinfo.h"
+#include "nodes/plannodes.h"
+#include "nodes/relation.h"
#include "utils/datum.h"
static void
_outList(StringInfo str, const List *node)
{
- const ListCell *lc;
+ const ListCell *lc;
appendStringInfoChar(str, '(');
WRITE_NODE_TYPE("PLANNEDSTMT");
WRITE_ENUM_FIELD(commandType, CmdType);
+ WRITE_UINT_FIELD(queryId);
WRITE_BOOL_FIELD(hasReturning);
WRITE_BOOL_FIELD(hasModifyingCTE);
WRITE_BOOL_FIELD(canSetTag);
WRITE_NODE_FIELD(rtable);
WRITE_NODE_FIELD(resultRelations);
WRITE_NODE_FIELD(utilityStmt);
- WRITE_NODE_FIELD(intoClause);
WRITE_NODE_FIELD(subplans);
WRITE_BITMAPSET_FIELD(rewindPlanIDs);
WRITE_NODE_FIELD(rowMarks);
_outScanInfo(str, (const Scan *) node);
- WRITE_BOOL_FIELD(fsSystemCol);
- WRITE_NODE_FIELD(fdwplan);
-}
-
-static void
-_outFdwPlan(StringInfo str, const FdwPlan *node)
-{
- WRITE_NODE_TYPE("FDWPLAN");
-
- WRITE_FLOAT_FIELD(startup_cost, "%.2f");
- WRITE_FLOAT_FIELD(total_cost, "%.2f");
+ WRITE_NODE_FIELD(fdw_exprs);
WRITE_NODE_FIELD(fdw_private);
+ WRITE_BOOL_FIELD(fsSystemCol);
}
static void
*
* Note we do NOT print the parent, else we'd be in infinite recursion.
* We can print the parent's relids for identification purposes, though.
+ * We also do not print the whole of param_info, since it's printed by
+ * _outRelOptInfo; it's sufficient and less cluttering to print just the
+ * required outer relids.
*/
static void
_outPathInfo(StringInfo str, const Path *node)
WRITE_ENUM_FIELD(pathtype, NodeTag);
appendStringInfo(str, " :parent_relids ");
_outBitmapset(str, node->parent->relids);
+ appendStringInfo(str, " :required_outer ");
+ if (node->param_info)
+ _outBitmapset(str, node->param_info->ppi_req_outer);
+ else
+ _outBitmapset(str, NULL);
+ WRITE_FLOAT_FIELD(rows, "%.0f");
WRITE_FLOAT_FIELD(startup_cost, "%.2f");
WRITE_FLOAT_FIELD(total_cost, "%.2f");
WRITE_NODE_FIELD(pathkeys);
WRITE_NODE_FIELD(indexqualcols);
WRITE_NODE_FIELD(indexorderbys);
WRITE_NODE_FIELD(indexorderbycols);
- WRITE_BOOL_FIELD(isjoininner);
WRITE_ENUM_FIELD(indexscandir, ScanDirection);
WRITE_FLOAT_FIELD(indextotalcost, "%.2f");
WRITE_FLOAT_FIELD(indexselectivity, "%.4f");
- WRITE_FLOAT_FIELD(rows, "%.0f");
}
static void
_outPathInfo(str, (const Path *) node);
WRITE_NODE_FIELD(bitmapqual);
- WRITE_BOOL_FIELD(isjoininner);
- WRITE_FLOAT_FIELD(rows, "%.0f");
}
static void
_outPathInfo(str, (const Path *) node);
- WRITE_NODE_FIELD(fdwplan);
+ WRITE_NODE_FIELD(fdw_private);
}
static void
WRITE_ENUM_FIELD(umethod, UniquePathMethod);
WRITE_NODE_FIELD(in_operators);
WRITE_NODE_FIELD(uniq_exprs);
- WRITE_FLOAT_FIELD(rows, "%.0f");
}
static void
WRITE_NODE_TYPE("PLANNERGLOBAL");
/* NB: this isn't a complete set of fields */
- WRITE_NODE_FIELD(paramlist);
WRITE_NODE_FIELD(subplans);
WRITE_BITMAPSET_FIELD(rewindPlanIDs);
WRITE_NODE_FIELD(finalrtable);
WRITE_NODE_FIELD(resultRelations);
WRITE_NODE_FIELD(relationOids);
WRITE_NODE_FIELD(invalItems);
+ WRITE_INT_FIELD(nParamExec);
WRITE_UINT_FIELD(lastPHId);
WRITE_UINT_FIELD(lastRowMarkId);
WRITE_BOOL_FIELD(transientPlan);
WRITE_NODE_FIELD(parse);
WRITE_NODE_FIELD(glob);
WRITE_UINT_FIELD(query_level);
+ WRITE_NODE_FIELD(plan_params);
+ WRITE_BITMAPSET_FIELD(all_baserels);
WRITE_NODE_FIELD(join_rel_list);
WRITE_INT_FIELD(join_cur_level);
WRITE_NODE_FIELD(init_plans);
WRITE_NODE_FIELD(right_join_clauses);
WRITE_NODE_FIELD(full_join_clauses);
WRITE_NODE_FIELD(join_info_list);
+ WRITE_NODE_FIELD(lateral_info_list);
WRITE_NODE_FIELD(append_rel_list);
WRITE_NODE_FIELD(rowMarks);
WRITE_NODE_FIELD(placeholder_list);
WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
WRITE_BOOL_FIELD(hasInheritedTarget);
WRITE_BOOL_FIELD(hasJoinRTEs);
+ WRITE_BOOL_FIELD(hasLateralRTEs);
WRITE_BOOL_FIELD(hasHavingQual);
WRITE_BOOL_FIELD(hasPseudoConstantQuals);
WRITE_BOOL_FIELD(hasRecursion);
WRITE_BITMAPSET_FIELD(relids);
WRITE_FLOAT_FIELD(rows, "%.0f");
WRITE_INT_FIELD(width);
+ WRITE_BOOL_FIELD(consider_startup);
WRITE_NODE_FIELD(reltargetlist);
WRITE_NODE_FIELD(pathlist);
+ WRITE_NODE_FIELD(ppilist);
WRITE_NODE_FIELD(cheapest_startup_path);
WRITE_NODE_FIELD(cheapest_total_path);
WRITE_NODE_FIELD(cheapest_unique_path);
+ WRITE_NODE_FIELD(cheapest_parameterized_paths);
WRITE_UINT_FIELD(relid);
WRITE_UINT_FIELD(reltablespace);
WRITE_ENUM_FIELD(rtekind, RTEKind);
WRITE_INT_FIELD(min_attr);
WRITE_INT_FIELD(max_attr);
+ WRITE_NODE_FIELD(lateral_vars);
+ WRITE_BITMAPSET_FIELD(lateral_relids);
WRITE_NODE_FIELD(indexlist);
WRITE_UINT_FIELD(pages);
WRITE_FLOAT_FIELD(tuples, "%.0f");
WRITE_FLOAT_FIELD(allvisfrac, "%.6f");
WRITE_NODE_FIELD(subplan);
WRITE_NODE_FIELD(subroot);
+ WRITE_NODE_FIELD(subplan_params);
+ /* we don't try to print fdwroutine or fdw_private */
WRITE_NODE_FIELD(baserestrictinfo);
WRITE_NODE_FIELD(joininfo);
WRITE_BOOL_FIELD(has_eclass_joins);
- WRITE_BITMAPSET_FIELD(index_outer_relids);
- WRITE_NODE_FIELD(index_inner_paths);
}
static void
WRITE_BOOL_FIELD(pk_nulls_first);
}
+static void
+_outParamPathInfo(StringInfo str, const ParamPathInfo *node)
+{
+ WRITE_NODE_TYPE("PARAMPATHINFO");
+
+ WRITE_BITMAPSET_FIELD(ppi_req_outer);
+ WRITE_FLOAT_FIELD(ppi_rows, "%.0f");
+ WRITE_NODE_FIELD(ppi_clauses);
+}
+
static void
_outRestrictInfo(StringInfo str, const RestrictInfo *node)
{
WRITE_BOOL_FIELD(pseudoconstant);
WRITE_BITMAPSET_FIELD(clause_relids);
WRITE_BITMAPSET_FIELD(required_relids);
+ WRITE_BITMAPSET_FIELD(outer_relids);
WRITE_BITMAPSET_FIELD(nullable_relids);
WRITE_BITMAPSET_FIELD(left_relids);
WRITE_BITMAPSET_FIELD(right_relids);
WRITE_OID_FIELD(hashjoinoperator);
}
-static void
-_outInnerIndexscanInfo(StringInfo str, const InnerIndexscanInfo *node)
-{
- WRITE_NODE_TYPE("INNERINDEXSCANINFO");
- WRITE_BITMAPSET_FIELD(other_relids);
- WRITE_BOOL_FIELD(isouterjoin);
- WRITE_NODE_FIELD(cheapest_startup_innerpath);
- WRITE_NODE_FIELD(cheapest_total_innerpath);
-}
-
static void
_outPlaceHolderVar(StringInfo str, const PlaceHolderVar *node)
{
WRITE_NODE_FIELD(join_quals);
}
+static void
+_outLateralJoinInfo(StringInfo str, const LateralJoinInfo *node)
+{
+ WRITE_NODE_TYPE("LATERALJOININFO");
+
+ WRITE_UINT_FIELD(lateral_rhs);
+ WRITE_BITMAPSET_FIELD(lateral_lhs);
+}
+
static void
_outAppendRelInfo(StringInfo str, const AppendRelInfo *node)
{
WRITE_NODE_TYPE("PLANNERPARAMITEM");
WRITE_NODE_FIELD(item);
- WRITE_UINT_FIELD(abslevel);
+ WRITE_INT_FIELD(paramId);
}
/*****************************************************************************
*
*****************************************************************************/
+/*
+ * print the basic stuff of all nodes that inherit from CreateStmt
+ */
static void
-_outCreateStmt(StringInfo str, const CreateStmt *node)
+_outCreateStmtInfo(StringInfo str, const CreateStmt *node)
{
- WRITE_NODE_TYPE("CREATESTMT");
-
WRITE_NODE_FIELD(relation);
WRITE_NODE_FIELD(tableElts);
WRITE_NODE_FIELD(inhRelations);
WRITE_BOOL_FIELD(if_not_exists);
}
+static void
+_outCreateStmt(StringInfo str, const CreateStmt *node)
+{
+ WRITE_NODE_TYPE("CREATESTMT");
+
+ _outCreateStmtInfo(str, (const CreateStmt *) node);
+}
+
static void
_outCreateForeignTableStmt(StringInfo str, const CreateForeignTableStmt *node)
{
WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
- _outCreateStmt(str, (const CreateStmt *) &node->base);
+ _outCreateStmtInfo(str, (const CreateStmt *) node);
WRITE_STRING_FIELD(servername);
WRITE_NODE_FIELD(options);
WRITE_NODE_FIELD(options);
WRITE_NODE_FIELD(whereClause);
WRITE_NODE_FIELD(excludeOpNames);
+ WRITE_STRING_FIELD(idxcomment);
WRITE_OID_FIELD(indexOid);
WRITE_OID_FIELD(oldNode);
WRITE_BOOL_FIELD(unique);
WRITE_NODE_FIELD(groupClause);
WRITE_NODE_FIELD(havingClause);
WRITE_NODE_FIELD(windowClause);
- WRITE_NODE_FIELD(withClause);
WRITE_NODE_FIELD(valuesLists);
WRITE_NODE_FIELD(sortClause);
WRITE_NODE_FIELD(limitOffset);
WRITE_NODE_FIELD(limitCount);
WRITE_NODE_FIELD(lockingClause);
+ WRITE_NODE_FIELD(withClause);
WRITE_ENUM_FIELD(op, SetOperation);
WRITE_BOOL_FIELD(all);
WRITE_NODE_FIELD(larg);
}
static void
-_outInhRelation(StringInfo str, const InhRelation *node)
+_outTableLikeClause(StringInfo str, const TableLikeClause *node)
{
- WRITE_NODE_TYPE("INHRELATION");
+ WRITE_NODE_TYPE("TABLELIKECLAUSE");
WRITE_NODE_FIELD(relation);
WRITE_UINT_FIELD(options);
WRITE_BOOL_FIELD(is_local);
WRITE_BOOL_FIELD(is_not_null);
WRITE_BOOL_FIELD(is_from_type);
- WRITE_INT_FIELD(storage);
+ WRITE_CHAR_FIELD(storage);
WRITE_NODE_FIELD(raw_default);
WRITE_NODE_FIELD(cooked_default);
WRITE_NODE_FIELD(collClause);
WRITE_ENUM_FIELD(commandType, CmdType);
WRITE_ENUM_FIELD(querySource, QuerySource);
+ /* we intentionally do not print the queryId field */
WRITE_BOOL_FIELD(canSetTag);
/*
appendStringInfo(str, " :utilityStmt <>");
WRITE_INT_FIELD(resultRelation);
- WRITE_NODE_FIELD(intoClause);
WRITE_BOOL_FIELD(hasAggs);
WRITE_BOOL_FIELD(hasWindowFuncs);
WRITE_BOOL_FIELD(hasSubLinks);
break;
}
+ WRITE_BOOL_FIELD(lateral);
WRITE_BOOL_FIELD(inh);
WRITE_BOOL_FIELD(inFromCl);
WRITE_UINT_FIELD(requiredPerms);
{
WRITE_NODE_TYPE("RANGESUBSELECT");
+ WRITE_BOOL_FIELD(lateral);
WRITE_NODE_FIELD(subquery);
WRITE_NODE_FIELD(alias);
}
{
WRITE_NODE_TYPE("RANGEFUNCTION");
+ WRITE_BOOL_FIELD(lateral);
WRITE_NODE_FIELD(funccallnode);
WRITE_NODE_FIELD(alias);
WRITE_NODE_FIELD(coldeflist);
case CONSTR_CHECK:
appendStringInfo(str, "CHECK");
+ WRITE_BOOL_FIELD(is_no_inherit);
WRITE_NODE_FIELD(raw_expr);
WRITE_STRING_FIELD(cooked_expr);
break;
WRITE_CHAR_FIELD(fk_matchtype);
WRITE_CHAR_FIELD(fk_upd_action);
WRITE_CHAR_FIELD(fk_del_action);
+ WRITE_NODE_FIELD(old_conpfeqop);
WRITE_BOOL_FIELD(skip_validation);
WRITE_BOOL_FIELD(initially_valid);
break;
case T_ForeignScan:
_outForeignScan(str, obj);
break;
- case T_FdwPlan:
- _outFdwPlan(str, obj);
- break;
case T_Join:
_outJoin(str, obj);
break;
case T_PathKey:
_outPathKey(str, obj);
break;
+ case T_ParamPathInfo:
+ _outParamPathInfo(str, obj);
+ break;
case T_RestrictInfo:
_outRestrictInfo(str, obj);
break;
- case T_InnerIndexscanInfo:
- _outInnerIndexscanInfo(str, obj);
- break;
case T_PlaceHolderVar:
_outPlaceHolderVar(str, obj);
break;
case T_SpecialJoinInfo:
_outSpecialJoinInfo(str, obj);
break;
+ case T_LateralJoinInfo:
+ _outLateralJoinInfo(str, obj);
+ break;
case T_AppendRelInfo:
_outAppendRelInfo(str, obj);
break;
case T_DefElem:
_outDefElem(str, obj);
break;
- case T_InhRelation:
- _outInhRelation(str, obj);
+ case T_TableLikeClause:
+ _outTableLikeClause(str, obj);
break;
case T_LockingClause:
_outLockingClause(str, obj);