57#include "utils/fmgroids.h"
110#ifdef DEBUG_NODE_TESTS_ENABLED
128 const Oid *paramTypes,
int numParams,
150 (*post_parse_analyze_hook) (pstate, query,
jstate);
168 Oid **paramTypes,
int *numParams,
192 (*post_parse_analyze_hook) (pstate, query,
jstate);
210 void *parserSetupArg,
221 (*parserSetup) (pstate, parserSetupArg);
229 (*post_parse_analyze_hook) (pstate, query,
jstate);
306 if (
stmt->intoClause)
313 ctas->is_select_into =
true;
338#ifdef DEBUG_NODE_TESTS_ENABLED
584 if (
stmt->withClause)
586 qry->hasRecursive =
stmt->withClause->recursive;
602 nsitem->p_lateral_only =
true;
603 nsitem->p_lateral_ok =
false;
614 nsitem->p_lateral_only =
false;
615 nsitem->p_lateral_ok =
true;
617 if (
stmt->forPortionOf)
678 if (
stmt->withClause)
680 qry->hasRecursive =
stmt->withClause->recursive;
685 qry->override =
stmt->override;
756 if (selectStmt ==
NULL)
805 elog(
ERROR,
"unexpected non-SELECT command in INSERT ... SELECT");
873 bool lateral =
false;
902 errmsg(
"VALUES lists must all be the same length"),
970 NULL, lateral,
true);
1044 if (
stmt->onConflictClause ||
stmt->returningClause)
1052 if (
stmt->onConflictClause &&
1054 !
stmt->returningClause)
1057 errmsg(
"ON CONFLICT DO SELECT requires a RETURNING clause"),
1061 if (
stmt->onConflictClause)
1063 stmt->onConflictClause);
1066 if (
stmt->returningClause)
1113 errmsg(
"INSERT has more expressions than target columns"),
1131 errmsg(
"INSERT has more target columns than expressions"),
1135 errhint(
"The insertion source is a row expression containing the same number of columns expected by the INSERT. Did you accidentally use extra parentheses?") : 0),
1167 Expr *subexpr = expr;
1213 int exclRelIndex = 0;
1286 result->arbiterElems = arbiterElems;
1287 result->arbiterWhere = arbiterWhere;
1290 result->onConflictSet = onConflictSet;
1291 result->onConflictWhere = onConflictWhere;
1292 result->exclRelIndex = exclRelIndex;
1293 result->exclRelTlist = exclRelTlist;
1334 errmsg(
"foreign tables don't support FOR PORTION OF")));
1343 errmsg(
"column \"%s\" of relation \"%s\" does not exist",
1358 result->rangeVar = rangeVar;
1370 if (forPortionOf->
target)
1390 errmsg(
"could not coerce FOR PORTION OF target from %s to %s",
1411 errmsg(
"column \"%s\" of relation \"%s\" is not a range or multirange type",
1432 errmsg(
"column \"%s\" of relation \"%s\" is not a range type",
1464 errmsg(
"could not coerce FOR PORTION OF %s bound from %s to %s",
1472 errmsg(
"could not coerce FOR PORTION OF %s bound from %s to %s",
1486 (
errmsg(
"FOR PORTION OF bounds cannot contain volatile functions")));
1497 errmsg(
"data type %s has no default operator class for access method \"%s\"",
1499 errhint(
"You must define a default operator class for the data type.")));
1528 elog(
ERROR,
"unexpected opcintype: %u", opcintype);
1531 elog(
ERROR,
"unexpected opclass: %u", opclass);
1559 elog(
ERROR,
"unexpected opcintype: %u", opcintype);
1565 errmsg(
"could not identify an intersect function for type %s",
1637 if (attr->attisdropped)
1648 var =
makeVar(exclRelIndex, attno + 1,
1649 attr->atttypid, attr->atttypmod,
1749 if (
stmt->withClause)
1751 qry->hasRecursive =
stmt->withClause->recursive;
1757 if (
stmt->intoClause)
1760 errmsg(
"SELECT ... INTO is not allowed here"),
1819 if (
stmt->distinctClause ==
NIL)
1822 qry->hasDistinctOn =
false;
1831 qry->hasDistinctOn =
false;
1837 stmt->distinctClause,
1840 qry->hasDistinctOn =
true;
1870 foreach(l,
stmt->lockingClause)
1902 bool lateral =
false;
1922 if (
stmt->withClause)
1924 qry->hasRecursive =
stmt->withClause->recursive;
1936 foreach(
lc,
stmt->valuesLists)
1963 errmsg(
"VALUES lists must all be the same length"),
2007 foreach(
lc, colexprs[
i])
2054 NULL, lateral,
true);
2081 if (
stmt->lockingClause)
2086 errmsg(
"%s cannot be applied to VALUES",
2122 List *lockingClause;
2157 errmsg(
"SELECT ... INTO is not allowed here"),
2166 sortClause =
stmt->sortClause;
2167 limitOffset =
stmt->limitOffset;
2168 limitCount =
stmt->limitCount;
2169 lockingClause =
stmt->lockingClause;
2170 withClause =
stmt->withClause;
2184 errmsg(
"%s is not allowed with UNION/INTERSECT/EXCEPT",
2186 linitial(lockingClause))->strength))));
2191 qry->hasRecursive = withClause->
recursive;
2324 errmsg(
"invalid UNION/INTERSECT/EXCEPT ORDER BY clause"),
2325 errdetail(
"Only result column names can be used, not expressions or functions."),
2326 errhint(
"Add the expression/function to every SELECT, or move the UNION into a FROM clause."),
2347 foreach(l, lockingClause)
2379 &sortop, &eqop,
NULL,
2392 grpcl->tleSortGroupRef = 0;
2394 grpcl->sortop = sortop;
2395 grpcl->reverse_sort =
false;
2396 grpcl->nulls_first =
false;
2397 grpcl->hashable = hashable;
2430 if (
stmt->intoClause)
2433 errmsg(
"INTO is only allowed on first SELECT of UNION/INTERSECT/EXCEPT"),
2438 if (
stmt->lockingClause)
2443 errmsg(
"%s is not allowed with UNION/INTERSECT/EXCEPT",
2461 if (
stmt->sortClause ||
stmt->limitOffset ||
stmt->limitCount ||
2462 stmt->lockingClause ||
stmt->withClause)
2490 NULL,
false,
false);
2503 errmsg(
"UNION/INTERSECT/EXCEPT member statement cannot refer to other relations of same query level"),
2547 const char *context;
2582 context, recursive);
2603 List **targetlist,
const char *context,
bool recursive)
2615 errmsg(
"each %s query must have the same number of columns",
2623 op->colTypmods =
NIL;
2624 op->colCollations =
NIL;
2625 op->groupClauses =
NIL;
2731 op->groupClauses =
lappend(op->groupClauses,
2824 qry->isReturn =
true;
2859 if (
stmt->withClause)
2861 qry->hasRecursive =
stmt->withClause->recursive;
2867 stmt->relation->inh,
2871 if (
stmt->forPortionOf)
2873 qry->resultRelation,
2881 nsitem->p_lateral_ok =
false;
2890 nsitem->p_lateral_only =
false;
2891 nsitem->p_lateral_ok =
true;
2960 elog(
ERROR,
"UPDATE target count mismatch --- internal error");
2968 errmsg(
"column \"%s\" of relation \"%s\" does not exist",
2973 errhint(
"SET target columns cannot be qualified with the relation name.") : 0,
2980 if (forPortionOf !=
NULL)
2985 errmsg(
"cannot update column \"%s\" because it is used in FOR PORTION OF",
3002 elog(
ERROR,
"UPDATE target count mismatch --- internal error");
3031 nscolumns[
i].p_varreturningtype = returning_type;
3040 nsitem->p_returning_type = returning_type;
3058 if (returningClause ==
NULL)
3070 if (qry->returningOldAlias !=
NULL)
3074 errmsg(
"%s cannot be specified multiple times",
"OLD"),
3076 qry->returningOldAlias =
option->value;
3080 if (qry->returningNewAlias !=
NULL)
3084 errmsg(
"%s cannot be specified multiple times",
"NEW"),
3086 qry->returningNewAlias =
option->value;
3096 errmsg(
"table name \"%s\" specified more than once",
3109 if (qry->returningOldAlias ==
NULL &&
3112 qry->returningOldAlias =
"old";
3115 if (qry->returningNewAlias ==
NULL &&
3118 qry->returningNewAlias =
"new";
3132 returningClause->
exprs,
3144 errmsg(
"RETURNING must have at least one column"),
3177 List *indirection =
stmt->indirection;
3178 int nnames =
stmt->nnames;
3194 while (--nnames > 0 && indirection !=
NIL)
3199 elog(
ERROR,
"invalid name count in PLAssignStmt");
3219 passthru.indirection = indirection;
3269 "assignment source returned %d columns",
3299 else if (targettype != type_id &&
3321 targettype, targettypmod,
3329 errmsg(
"variable \"%s\" is of type %s"
3330 " but expression is of type %s",
3334 errhint(
"You will need to rewrite or cast the expression."),
3365 errmsg(
"cannot specify both %s and %s",
3366 "SCROLL",
"NO SCROLL")));
3373 errmsg(
"cannot specify both %s and %s",
3374 "ASENSITIVE",
"INSENSITIVE")));
3383 elog(
ERROR,
"unexpected non-SELECT command in DECLARE CURSOR");
3390 if (query->hasModifyingCTE)
3393 errmsg(
"DECLARE CURSOR must not contain data-modifying statements in WITH")));
3401 errmsg(
"DECLARE CURSOR WITH HOLD ... %s is not supported",
3404 errdetail(
"Holdable cursors must be READ ONLY.")));
3412 errmsg(
"DECLARE SCROLL CURSOR ... %s is not supported",
3415 errdetail(
"Scrollable cursors must be READ ONLY.")));
3423 errmsg(
"DECLARE INSENSITIVE CURSOR ... %s is not valid",
3426 errdetail(
"Insensitive cursors must be READ ONLY.")));
3464 foreach(
lc,
stmt->options)
3519 if (query->hasModifyingCTE)
3522 errmsg(
"materialized views must not use data-modifying statements in WITH")));
3532 errmsg(
"materialized views must not use temporary objects"),
3533 errdetail(
"This view depends on temporary %s.",
3544 errmsg(
"materialized views may not be defined using bound parameters")));
3556 errmsg(
"materialized views cannot be unlogged")));
3596 foreach(
lc,
stmt->funccall->args)
3604 stmt->funccall->funcname,
3609 stmt->funccall->location);
3617 elog(
ERROR,
"cache lookup failed for function %u",
fexpr->funcid);
3627 fexpr->funcresulttype,
3652 elog(
ERROR,
"proargmodes is not a 1-D char array of length %d or it contains nulls",
3669 outargs =
lappend(outargs, n);
3677 elog(
ERROR,
"invalid argmode %c for procedure",
3687 stmt->outargs = outargs;
3712 return "FOR KEY SHARE";
3716 return "FOR NO KEY UPDATE";
3718 return "FOR UPDATE";
3738 errmsg(
"%s is not allowed with UNION/INTERSECT/EXCEPT",
3745 errmsg(
"%s is not allowed with DISTINCT clause",
3752 errmsg(
"%s is not allowed with GROUP BY clause",
3759 errmsg(
"%s is not allowed with HAVING clause",
3766 errmsg(
"%s is not allowed with aggregate functions",
3768 if (qry->hasWindowFuncs)
3773 errmsg(
"%s is not allowed with window functions",
3775 if (qry->hasTargetSRFs)
3780 errmsg(
"%s is not allowed with set-returning functions in the target list",
3796 List *lockedRels =
lc->lockedRels;
3810 if (lockedRels ==
NIL)
3828 switch (
rte->rtekind)
3869 foreach(l, lockedRels)
3879 errmsg(
"%s must specify unqualified relation names",
3906 if (
rte->join_using_alias ==
NULL)
3917 switch (
rte->rtekind)
3933 lc->waitPolicy, pushedDown);
3943 errmsg(
"%s cannot be applied to a join",
3952 errmsg(
"%s cannot be applied to a function",
3961 errmsg(
"%s cannot be applied to a table function",
3970 errmsg(
"%s cannot be applied to VALUES",
3979 errmsg(
"%s cannot be applied to a WITH query",
3988 errmsg(
"%s cannot be applied to a named tuplestore",
3996 elog(
ERROR,
"unrecognized RTE type: %d",
3997 (
int)
rte->rtekind);
4008 errmsg(
"relation \"%s\" in %s clause not found in FROM clause",
4030 qry->hasForUpdate =
true;
4069#ifdef DEBUG_NODE_TESTS_ENABLED
void(* post_parse_analyze_hook_type)(ParseState *pstate, Query *query, const JumbleState *jstate)
#define DatumGetArrayTypeP(X)
#define InvalidAttrNumber
void pgstat_report_query_id(int64 query_id, bool force)
Bitmapset * bms_add_member(Bitmapset *a, int x)
#define Assert(condition)
#define OidIsValid(objectId)
memcpy(sums, checksumBaseOffsets, sizeof(checksumBaseOffsets))
bool contain_volatile_functions_after_planning(Expr *expr)
List * expand_function_arguments(List *args, bool include_out_arguments, Oid result_type, HeapTuple func_tuple)
bool defGetBoolean(DefElem *def)
bool query_uses_temp_object(Query *query, ObjectAddress *temp_object)
int errcode(int sqlerrcode)
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
int int int errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
#define ereport(elevel,...)
#define palloc_object(type)
#define palloc_array(type, count)
#define HeapTupleIsValid(tuple)
Oid GetDefaultOpClass(Oid type_id, Oid am_id)
void GetOperatorFromCompareType(Oid opclass, Oid rhstype, CompareType cmptype, Oid *opid, StrategyNumber *strat)
List * lappend(List *list, void *datum)
List * list_delete_first(List *list)
List * list_copy(const List *oldlist)
List * lappend_int(List *list, int datum)
List * lappend_oid(List *list, Oid datum)
List * list_delete_last(List *list)
void list_free(List *list)
List * list_truncate(List *list, int new_size)
Oid get_range_subtype(Oid rangeOid)
RegProcedure get_range_constructor2(Oid rangeOid)
bool type_is_range(Oid typid)
bool get_opclass_opfamily_and_input_type(Oid opclass, Oid *opfamily, Oid *opcintype)
RegProcedure get_opcode(Oid opno)
Oid getBaseType(Oid typid)
bool type_is_multirange(Oid typid)
Alias * makeAlias(const char *aliasname, List *colnames)
Var * makeVarFromTargetEntry(int varno, TargetEntry *tle)
FromExpr * makeFromExpr(List *fromlist, Node *quals)
Var * makeVar(int varno, AttrNumber varattno, Oid vartype, int32 vartypmod, Oid varcollid, Index varlevelsup)
Const * makeNullConst(Oid consttype, int32 consttypmod, Oid constcollid)
TargetEntry * makeTargetEntry(Expr *expr, AttrNumber resno, char *resname, bool resjunk)
FuncExpr * makeFuncExpr(Oid funcid, Oid rettype, List *args, Oid funccollid, Oid inputcollid, CoercionForm fformat)
char * pstrdup(const char *in)
void * palloc0(Size size)
Oid exprType(const Node *expr)
int32 exprTypmod(const Node *expr)
Oid exprCollation(const Node *expr)
int exprLocation(const Node *expr)
#define raw_expression_tree_walker(n, w, c)
#define IsA(nodeptr, _type_)
#define castNode(_type_, nodeptr)
char * getObjectDescription(const ObjectAddress *object, bool missing_ok)
void(* ParserSetupHook)(ParseState *pstate, void *arg)
void parseCheckAggregates(ParseState *pstate, Query *qry)
Node * transformWhereClause(ParseState *pstate, Node *clause, ParseExprKind exprKind, const char *constructName)
List * transformGroupClause(ParseState *pstate, List *grouplist, bool groupByAll, List **groupingSets, List **targetlist, List *sortClause, ParseExprKind exprKind, bool useSQL99)
List * transformSortClause(ParseState *pstate, List *orderlist, List **targetlist, ParseExprKind exprKind, bool useSQL99)
List * transformDistinctOnClause(ParseState *pstate, List *distinctlist, List **targetlist, List *sortClause)
List * transformWindowDefinitions(ParseState *pstate, List *windowdefs, List **targetlist)
void transformFromClause(ParseState *pstate, List *frmList)
List * transformDistinctClause(ParseState *pstate, List **targetlist, List *sortClause, bool is_agg)
Node * transformLimitClause(ParseState *pstate, Node *clause, ParseExprKind exprKind, const char *constructName, LimitOption limitOption)
void transformOnConflictArbiter(ParseState *pstate, OnConflictClause *onConflictClause, List **arbiterExpr, Node **arbiterWhere, Oid *constraint)
int setTargetTable(ParseState *pstate, RangeVar *relation, bool inh, bool alsoSource, AclMode requiredPerms)
Node * coerce_to_common_type(ParseState *pstate, Node *node, Oid targetTypeId, const char *context)
int32 select_common_typmod(ParseState *pstate, List *exprs, Oid common_type)
Node * coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId, int32 targetTypeMod, CoercionContext ccontext, CoercionForm cformat, int location)
Oid select_common_type(ParseState *pstate, List *exprs, const char *context, Node **which_expr)
bool can_coerce_type(int nargs, const Oid *input_typeids, const Oid *target_typeids, CoercionContext ccontext)
Node * coerce_to_target_type(ParseState *pstate, Node *expr, Oid exprtype, Oid targettype, int32 targettypmod, CoercionContext ccontext, CoercionForm cformat, int location)
void assign_list_collations(ParseState *pstate, List *exprs)
Oid select_common_collation(ParseState *pstate, List *exprs, bool none_ok)
void assign_query_collations(ParseState *pstate, Query *query)
void assign_expr_collations(ParseState *pstate, Node *expr)
void analyzeCTETargetList(ParseState *pstate, CommonTableExpr *cte, List *tlist)
List * transformWithClause(ParseState *pstate, WithClause *withClause)
Node * transformExpr(ParseState *pstate, Node *expr, ParseExprKind exprKind)
void make_fn_arguments(ParseState *pstate, List *fargs, Oid *actual_arg_types, Oid *declared_arg_types)
Node * ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, Node *last_srf, FuncCall *fn, bool proc_call, int location)
Query * transformMergeStmt(ParseState *pstate, MergeStmt *stmt)
void cancel_parser_errposition_callback(ParseCallbackState *pcbstate)
void free_parsestate(ParseState *pstate)
int parser_errposition(ParseState *pstate, int location)
void setup_parser_errposition_callback(ParseCallbackState *pcbstate, ParseState *pstate, int location)
ParseState * make_parsestate(ParseState *parentParseState)
@ EXPR_KIND_INSERT_TARGET
@ EXPR_KIND_UPDATE_TARGET
@ EXPR_KIND_SELECT_TARGET
@ EXPR_KIND_CALL_ARGUMENT
@ EXPR_KIND_UPDATE_SOURCE
@ EXPR_KIND_VALUES_SINGLE
void get_sort_group_operators(Oid argtype, bool needLT, bool needEQ, bool needGT, Oid *ltOpr, Oid *eqOpr, Oid *gtOpr, bool *isHashable)
void check_variable_parameters(ParseState *pstate, Query *query)
bool query_contains_extern_params(Query *query)
void setup_parse_variable_parameters(ParseState *pstate, Oid **paramTypes, int *numParams)
void setup_parse_fixed_parameters(ParseState *pstate, const Oid *paramTypes, int numParams)
RTEPermissionInfo * getRTEPermissionInfo(List *rteperminfos, RangeTblEntry *rte)
void markVarForSelectPriv(ParseState *pstate, Var *var)
RowMarkClause * get_parse_rowmark(Query *qry, Index rtindex)
TargetEntry * get_tle_by_resno(List *tlist, AttrNumber resno)
List * expandNSItemVars(ParseState *pstate, ParseNamespaceItem *nsitem, int sublevels_up, int location, List **colnames)
void addNSItemToQuery(ParseState *pstate, ParseNamespaceItem *nsitem, bool addToJoinList, bool addToRelNameSpace, bool addToVarNameSpace)
ParseNamespaceItem * addRangeTableEntryForRelation(ParseState *pstate, Relation rel, LOCKMODE lockmode, Alias *alias, bool inh, bool inFromCl)
ParseNamespaceItem * addRangeTableEntryForSubquery(ParseState *pstate, Query *subquery, Alias *alias, bool lateral, bool inFromCl)
ParseNamespaceItem * addRangeTableEntryForJoin(ParseState *pstate, List *colnames, ParseNamespaceColumn *nscolumns, JoinType jointype, int nummergedcols, List *aliasvars, List *leftcols, List *rightcols, Alias *join_using_alias, Alias *alias, bool inFromCl)
List * expandNSItemAttrs(ParseState *pstate, ParseNamespaceItem *nsitem, int sublevels_up, bool require_col_privs, int location)
ParseNamespaceItem * refnameNamespaceItem(ParseState *pstate, const char *schemaname, const char *refname, int location, int *sublevels_up)
RangeTblEntry * GetRTEByRangeTablePosn(ParseState *pstate, int varno, int sublevels_up)
int attnameAttNum(Relation rd, const char *attname, bool sysColOK)
ParseNamespaceItem * addRangeTableEntryForValues(ParseState *pstate, List *exprs, List *coltypes, List *coltypmods, List *colcollations, Alias *alias, bool lateral, bool inFromCl)
Expr * transformAssignedExpr(ParseState *pstate, Expr *expr, ParseExprKind exprKind, const char *colname, int attrno, List *indirection, int location)
List * transformExpressionList(ParseState *pstate, List *exprlist, ParseExprKind exprKind, bool allowDefault)
Node * transformAssignmentIndirection(ParseState *pstate, Node *basenode, const char *targetName, bool targetIsSubscripting, Oid targetTypeId, int32 targetTypMod, Oid targetCollation, List *indirection, ListCell *indirection_cell, Node *rhs, CoercionContext ccontext, int location)
void updateTargetListEntry(ParseState *pstate, TargetEntry *tle, char *colname, int attrno, List *indirection, int location)
List * transformTargetList(ParseState *pstate, List *targetlist, ParseExprKind exprKind)
void resolveTargetListUnknowns(ParseState *pstate, List *targetlist)
void markTargetListOrigins(ParseState *pstate, List *targetlist)
List * checkInsertTargets(ParseState *pstate, List *cols, List **attrnos)
#define ISCOMPLEX(typeid)
#define CURSOR_OPT_INSENSITIVE
#define CURSOR_OPT_SCROLL
#define ACL_SELECT_FOR_UPDATE
#define CURSOR_OPT_ASENSITIVE
#define CURSOR_OPT_NO_SCROLL
static OnConflictExpr * transformOnConflictClause(ParseState *pstate, OnConflictClause *onConflictClause)
static Query * transformOptionalSelectInto(ParseState *pstate, Node *parseTree)
static void transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc, bool pushedDown)
static Query * transformDeleteStmt(ParseState *pstate, DeleteStmt *stmt)
void CheckSelectLocking(Query *qry, LockClauseStrength strength)
SortGroupClause * makeSortGroupClauseForSetOp(Oid rescoltype, bool require_hash)
static Node * transformSetOperationTree(ParseState *pstate, SelectStmt *stmt, bool isTopLevel, List **targetlist)
Query * parse_analyze_withcb(RawStmt *parseTree, const char *sourceText, ParserSetupHook parserSetup, void *parserSetupArg, QueryEnvironment *queryEnv)
bool analyze_requires_snapshot(RawStmt *parseTree)
List * transformInsertRow(ParseState *pstate, List *exprlist, List *stmtcols, List *icolumns, List *attrnos, bool strip_indirection)
void applyLockingClause(Query *qry, Index rtindex, LockClauseStrength strength, LockWaitPolicy waitPolicy, bool pushedDown)
static void determineRecursiveColTypes(ParseState *pstate, Node *larg, List *nrtargetlist)
void constructSetOpTargetlist(ParseState *pstate, SetOperationStmt *op, const List *ltargetlist, const List *rtargetlist, List **targetlist, const char *context, bool recursive)
static Query * transformReturnStmt(ParseState *pstate, ReturnStmt *stmt)
static void addNSItemForReturning(ParseState *pstate, const char *aliasname, VarReturningType returning_type)
void transformReturningClause(ParseState *pstate, Query *qry, ReturningClause *returningClause, ParseExprKind exprKind)
static Query * transformPLAssignStmt(ParseState *pstate, PLAssignStmt *stmt)
static Query * transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt)
post_parse_analyze_hook_type post_parse_analyze_hook
static Query * transformCallStmt(ParseState *pstate, CallStmt *stmt)
static Query * transformSetOperationStmt(ParseState *pstate, SelectStmt *stmt)
List * transformUpdateTargetList(ParseState *pstate, List *origTlist, ForPortionOfExpr *forPortionOf)
bool query_requires_rewrite_plan(Query *query)
static Query * transformSelectStmt(ParseState *pstate, SelectStmt *stmt, SelectStmtPassthrough *passthru)
Query * transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree)
const char * LCS_asString(LockClauseStrength strength)
Query * parse_analyze_fixedparams(RawStmt *parseTree, const char *sourceText, const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
static Query * transformUpdateStmt(ParseState *pstate, UpdateStmt *stmt)
Query * parse_sub_analyze(Node *parseTree, ParseState *parentParseState, CommonTableExpr *parentCTE, bool locked_from_parent, bool resolve_unknowns)
static ForPortionOfExpr * transformForPortionOfClause(ParseState *pstate, int rtindex, const ForPortionOfClause *forPortionOfClause, bool isUpdate)
static Query * transformExplainStmt(ParseState *pstate, ExplainStmt *stmt)
List * BuildOnConflictExcludedTargetlist(Relation targetrel, Index exclRelIndex)
static List * transformPLAssignStmtTarget(ParseState *pstate, List *tlist, SelectStmtPassthrough *passthru)
static int count_rowexpr_columns(ParseState *pstate, Node *expr)
Query * parse_analyze_varparams(RawStmt *parseTree, const char *sourceText, Oid **paramTypes, int *numParams, QueryEnvironment *queryEnv)
bool stmt_requires_parse_analysis(RawStmt *parseTree)
static Query * transformDeclareCursorStmt(ParseState *pstate, DeclareCursorStmt *stmt)
static Query * transformInsertStmt(ParseState *pstate, InsertStmt *stmt)
static Query * transformValuesClause(ParseState *pstate, SelectStmt *stmt)
Query * transformStmt(ParseState *pstate, Node *parseTree)
#define rt_fetch(rangetable_index, rangetable)
FormData_pg_attribute * Form_pg_attribute
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define linitial_node(type, l)
#define forboth(cell1, list1, cell2, list2)
#define forthree(cell1, list1, cell2, list2, cell3, list3)
static void * list_nth(const List *list, int n)
#define foreach_node(type, var, lst)
#define forfour(cell1, list1, cell2, list2, cell3, list3, cell4, list4)
static ListCell * list_head(const List *l)
static ListCell * lnext(const List *l, const ListCell *c)
#define list_make2(x1, x2)
#define ERRCODE_UNDEFINED_TABLE
static Datum ObjectIdGetDatum(Oid X)
static bool IsQueryIdEnabled(void)
JumbleState * JumbleQuery(Query *query)
#define RelationGetNumberOfAttributes(relation)
#define RelationGetRelationName(relation)
void check_stack_depth(void)
LockClauseStrength lockStrength
ParseNamespaceColumn * p_nscolumns
RTEPermissionInfo * p_perminfo
ParseNamespaceItem * p_target_nsitem
ParseExprKind p_expr_kind
bool p_locked_from_parent
ParseParamRefHook p_paramref_hook
QueryEnvironment * p_queryEnv
const char * p_sourcetext
Relation p_target_relation
CommonTableExpr * p_parent_cte
OnConflictExpr * onConflict
ForPortionOfExpr * forPortionOf
LockClauseStrength strength
LockWaitPolicy waitPolicy
#define FirstLowInvalidHeapAttributeNumber
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)
Datum SysCacheGetAttr(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
String * makeString(char *str)
bool contain_vars_of_level(Node *node, int levelsup)
int locate_var_of_level(Node *node, int levelsup)