39#include "utils/fmgroids.h"
78 int sublevels_up,
int location);
98 List **passing_values,
List **passing_names);
105 List *largs,
List *rargs,
int location);
218 elog(
ERROR,
"unrecognized A_Expr kind: %d",
a->kind);
314 errmsg(
"DEFAULT is not allowed in this context"),
407 errmsg(
"column %s.%s does not exist",
419 errmsg(
"column \"%s\" not found in data type %s",
425 errmsg(
"could not identify column \"%s\" in record data type",
431 errmsg(
"column notation .%s applied to type %s, "
432 "which is not a composite type",
452 foreach(
i,
ind->indirection)
462 errmsg(
"row expansion via \"*\" is not supported here"),
514 char *nspname =
NULL;
516 char *colname =
NULL;
586 err =
_(
"cannot use column reference in DEFAULT expression");
589 err =
_(
"cannot use column reference in partition bound expression");
592 err =
_(
"cannot use column reference in FOR PORTION OF expression");
861 errmsg(
"column reference \"%s\" is ambiguous",
883 errmsg(
"cross-database references are not implemented: %s",
890 errmsg(
"improper qualified name (too many dotted names): %s",
917 errmsg(
"there is no parameter $%d",
pref->number),
940 Node *lexpr =
a->lexpr;
941 Node *rexpr =
a->rexpr;
982 s->operName =
a->name;
1049 Node *lexpr =
a->lexpr;
1050 Node *rexpr =
a->rexpr;
1118 errmsg(
"%s requires = operator to yield boolean",
"NULLIF"),
1124 errmsg(
"%s must not return a set",
"NULLIF"),
1173 foreach(l, (
List *)
a->rexpr)
1242 newa->array_typeid = array_type;
1246 newa->multidims =
false;
1247 newa->location = -1;
1395 elog(
ERROR,
"unrecognized A_Expr kind: %d",
a->kind);
1421 errmsg(
"MERGE_ACTION() can only be used in the RETURNING list of a MERGE command"),
1447 elog(
ERROR,
"unrecognized boolop: %d", (
int)
a->boolop);
1452 foreach(
lc,
a->args)
1473 foreach(args,
fn->args)
1487 if (
fn->agg_within_group)
1490 foreach(args,
fn->agg_order)
1521 if (
maref->colno == 1)
1545 errmsg(
"number of columns does not match number of values"),
1577 errmsg(
"number of columns does not match number of values"),
1591 errmsg(
"source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"),
1628 return (
Node *) param;
1653 elog(
ERROR,
"unexpected expr type in multiassign list");
1739 defresult = (
Node *)
c->defresult;
1740 if (defresult ==
NULL)
1746 defresult = (
Node *) n;
1759 newc->casetype = ptype;
1770 foreach(l,
newc->args)
1786 errmsg(
"set-returning functions are not allowed in %s",
1788 errhint(
"You might be able to move the set-returning function into a LATERAL FROM item."),
1792 newc->location =
c->location;
1850 err =
_(
"cannot use subquery in check constraint");
1854 err =
_(
"cannot use subquery in DEFAULT expression");
1857 err =
_(
"cannot use subquery in index expression");
1860 err =
_(
"cannot use subquery in index predicate");
1863 err =
_(
"cannot use subquery in statistics expression");
1866 err =
_(
"cannot use subquery in transform expression");
1869 err =
_(
"cannot use subquery in EXECUTE parameter");
1872 err =
_(
"cannot use subquery in trigger WHEN condition");
1875 err =
_(
"cannot use subquery in partition bound");
1878 err =
_(
"cannot use subquery in partition key expression");
1881 err =
_(
"cannot use subquery in CALL argument");
1884 err =
_(
"cannot use subquery in COPY FROM WHERE condition");
1887 err =
_(
"cannot use subquery in column generation expression");
1890 err =
_(
"cannot use subquery in property definition expression");
1893 err =
_(
"cannot use subquery in FOR PORTION OF expression");
1923 elog(
ERROR,
"unexpected non-SELECT command in SubLink");
1946 errmsg(
"subquery must return only one column"),
1990 foreach(l,
qtree->targetList)
2017 errmsg(
"subquery has too many columns"),
2022 errmsg(
"subquery has too few columns"),
2063 newa->multidims =
false;
2082 newa->multidims =
true;
2094 if (!
newa->multidims)
2100 newa->multidims =
true;
2126 errmsg(
"cannot determine type of empty array"),
2127 errhint(
"Explicitly cast to the desired type, "
2128 "for example ARRAY[]::integer[]."),
2134 if (
newa->multidims)
2141 errmsg(
"could not find element type for data type %s",
2152 errmsg(
"could not find array type for data type %s",
2186 errmsg(
"cannot cast type %s to %s",
2198 newa->array_typeid = array_type;
2200 newa->element_typeid = element_type;
2202 newa->list_start =
a->list_start;
2203 newa->list_end =
a->list_end;
2204 newa->location =
a->location;
2226 errmsg(
"ROW expressions can have at most %d entries",
2256 foreach(args,
c->args)
2285 errmsg(
"set-returning functions are not allowed in %s",
2287 errhint(
"You might be able to move the set-returning function into a LATERAL FROM item."),
2292 newc->location =
c->location;
2306 foreach(args, m->
args)
2385 return (
Node *) svf;
2401 newx->xmloption =
x->xmloption;
2404 newx->location =
x->location;
2413 foreach(
lc,
x->named_args)
2431 ?
errmsg(
"unnamed XML attribute value must be a column reference")
2432 :
errmsg(
"unnamed XML element value must be a column reference"),
2447 errmsg(
"XML attribute name \"%s\" appears more than once",
2460 foreach(
lc,
x->args)
2534 xexpr->xmloption =
xs->xmloption;
2555 errmsg(
"cannot cast XMLSERIALIZE result to %s",
2566 switch (
b->booltesttype)
2587 elog(
ERROR,
"unrecognized booltesttype: %d",
2588 (
int)
b->booltesttype);
2620 cref->location = -1;
2647 return (
Node *) cexpr;
2655 int sublevels_up,
int location)
2686 sublevels_up,
true);
2692 result->location = location;
2714 nsitem->p_returning_type, location,
false,
NULL, &fields);
2725 return (
Node *) rowexpr;
2794 location =
tc->location;
2796 location =
tc->typeName->location;
2806 errmsg(
"cannot cast type %s to %s",
2837 errmsg(
"collations are not supported by type %s",
2842 newc->location =
c->location;
2861 List *largs,
List *rargs,
int location)
2879 errmsg(
"unequal number of entries in row expressions"),
2889 errmsg(
"cannot compare rows of zero length"),
2914 errmsg(
"row comparison operator must yield type boolean, "
2921 errmsg(
"row comparison operator must not return a set"),
2980 errmsg(
"could not determine interpretation of row comparison operator %s",
2982 errhint(
"Row comparison operators must be associated with btree operator families."),
3010 if (
opinfo->cmptype == cmptype)
3012 opfamily =
opinfo->opfamily_id;
3021 errmsg(
"could not determine interpretation of row comparison operator %s",
3023 errdetail(
"There are multiple equally-plausible candidates."),
3046 rcexpr->cmptype = cmptype;
3075 errmsg(
"unequal number of entries in row expressions"),
3117 errmsg(
"%s requires = operator to yield boolean",
3118 "IS DISTINCT FROM"),
3124 errmsg(
"%s must not return a set",
"IS DISTINCT FROM"),
3152 nt->argisrow =
false;
3170 return "invalid expression context";
3172 return "extension expression";
3176 return "JOIN/USING";
3178 return "sub-SELECT in FROM";
3180 return "function in FROM";
3190 return "window PARTITION BY";
3192 return "window ORDER BY";
3194 return "window RANGE";
3196 return "window ROWS";
3198 return "window GROUPS";
3207 return "MERGE WHEN";
3213 return "DISTINCT ON";
3231 return "index expression";
3233 return "index predicate";
3235 return "statistics expression";
3243 return "partition bound";
3245 return "PARTITION BY";
3251 return "GENERATED AS";
3255 return "property definition expression";
3257 return "FOR PORTION OF";
3266 return "unrecognized expression kind";
3322 fexpr->location = location;
3362 errmsg(
"JSON ENCODING clause is only allowed for bytea input type"),
3411 (
OidIsValid(targettype) && exprtype != targettype))
3426 errmsg(
"cannot use non-string types with implicit FORMAT JSON clause") :
3427 errmsg(
"cannot use non-string types with explicit FORMAT JSON clause"),
3429 ve->format->location : location));
3461 errmsg(
"cannot cast type %s to %s",
3470 fexpr->location = location;
3516 errmsg(
"cannot use JSON format with non-string output types"));
3529 errmsg(
"cannot set JSON encoding for non-bytea output types"));
3534 errmsg(
"unsupported JSON encoding"),
3535 errhint(
"Only UTF8 JSON encoding is supported."),
3569 if (
output->typeName->setof)
3572 errmsg(
"returning SETOF types is not supported in SQL/JSON functions"));
3577 errmsg(
"returning pseudo-types is not supported in SQL/JSON functions"));
3667 fexpr->location = location;
3690 errmsg(
"cannot cast type %s to %s",
3704 bool unique,
bool absent_on_null,
int location)
3713 jsctor->returning = returning;
3715 jsctor->absent_on_null = absent_on_null;
3716 jsctor->location = location;
3790 returning,
ctor->unique,
3791 ctor->absent_on_null,
ctor->location);
3820 errmsg(
"subquery must return only one column"),
3835 agg->absent_on_null =
ctor->absent_on_null;
3837 agg->constructor->agg_order =
NIL;
3838 agg->constructor->output =
ctor->output;
3839 agg->constructor->location =
ctor->location;
3849 range->lateral =
false;
3851 range->alias = alias;
3874 bool unique,
bool absent_on_null)
3893 wfunc->runCondition =
NIL;
3895 wfunc->winstar =
false;
3896 wfunc->winagg =
true;
3905 errmsg(
"aggregate ORDER BY is not implemented for window functions"),
3911 node = (
Node *) wfunc;
3926 aggref->aggstar =
false;
3927 aggref->aggvariadic =
false;
3929 aggref->aggpresorted =
false;
3933 aggref->aggtransno = -1;
3938 node = (
Node *) aggref;
3942 returning, unique, absent_on_null,
3977 if (
agg->absent_on_null)
3982 else if (
agg->unique)
3991 if (
agg->absent_on_null)
3996 else if (
agg->unique)
4007 agg->unique,
agg->absent_on_null);
4047 false,
agg->absent_on_null);
4083 returning,
false,
ctor->absent_on_null,
4092 Node *expr = raw_expr;
4128 errmsg(
"cannot use JSON FORMAT ENCODING clause for non-bytea input types")));
4148 errmsg(
"cannot use type %s in IS JSON predicate",
4175 errmsg(
"cannot use type %s in RETURNING clause of %s",
4177 errhint(
"Try returning json or jsonb."),
4188 returning->
typid = targettype;
4225 errmsg(
"cannot use non-string types with WITH UNIQUE KEYS clause"),
4263 returning,
false,
false, jsexpr->
location);
4296 errmsg(
"cannot use type %s in RETURNING clause of %s",
4298 "JSON_SERIALIZE()"),
4299 errhint(
"Try returning a string type or bytea.")));
4327 const char *func_name =
NULL;
4333 func_name =
"JSON_EXISTS";
4337 func_name =
"JSON_QUERY";
4341 func_name =
"JSON_VALUE";
4345 func_name =
"JSON_TABLE";
4349 elog(
ERROR,
"invalid JsonFuncExpr op %d", (
int) func->
op);
4367 errmsg(
"cannot specify FORMAT JSON in RETURNING clause of %s()",
4380 errmsg(
"SQL/JSON QUOTES behavior must not be specified when WITH WRAPPER is used"),
4394 errmsg(
"invalid %s behavior",
"ON EMPTY"),
4397 errdetail(
"Only ERROR, NULL, EMPTY ARRAY, EMPTY OBJECT, or DEFAULT expression is allowed in %s for %s.",
4398 "ON EMPTY",
"JSON_QUERY()"),
4404 errmsg(
"invalid %s behavior for column \"%s\"",
4407 errdetail(
"Only ERROR, NULL, EMPTY ARRAY, EMPTY OBJECT, or DEFAULT expression is allowed in %s for formatted columns.",
4423 errmsg(
"invalid %s behavior",
"ON ERROR"),
4426 errdetail(
"Only ERROR, NULL, EMPTY ARRAY, EMPTY OBJECT, or DEFAULT expression is allowed in %s for %s.",
4427 "ON ERROR",
"JSON_QUERY()"),
4433 errmsg(
"invalid %s behavior for column \"%s\"",
4436 errdetail(
"Only ERROR, NULL, EMPTY ARRAY, EMPTY OBJECT, or DEFAULT expression is allowed in %s for formatted columns.",
4454 errmsg(
"invalid %s behavior",
"ON ERROR"),
4455 errdetail(
"Only ERROR, TRUE, FALSE, or UNKNOWN is allowed in %s for %s.",
4456 "ON ERROR",
"JSON_EXISTS()"),
4462 errmsg(
"invalid %s behavior for column \"%s\"",
4465 errdetail(
"Only ERROR, TRUE, FALSE, or UNKNOWN is allowed in %s for EXISTS columns.",
4480 errmsg(
"invalid %s behavior",
"ON EMPTY"),
4483 errdetail(
"Only ERROR, NULL, or DEFAULT expression is allowed in %s for %s.",
4484 "ON EMPTY",
"JSON_VALUE()"),
4490 errmsg(
"invalid %s behavior for column \"%s\"",
4493 errdetail(
"Only ERROR, NULL, or DEFAULT expression is allowed in %s for scalar columns.",
4506 errmsg(
"invalid %s behavior",
"ON ERROR"),
4509 errdetail(
"Only ERROR, NULL, or DEFAULT expression is allowed in %s for %s.",
4510 "ON ERROR",
"JSON_VALUE()"),
4516 errmsg(
"invalid %s behavior for column \"%s\"",
4519 errdetail(
"Only ERROR, NULL, or DEFAULT expression is allowed in %s for scalar columns.",
4527 jsexpr->
op = func->
op;
4553 errmsg(
"JSON path expression must be of type %s, not of type %s",
4699 elog(
ERROR,
"invalid JsonFuncExpr op %d", (
int) func->
op);
4703 return (
Node *) jsexpr;
4712 List **passing_values,
List **passing_names)
4716 *passing_values =
NIL;
4717 *passing_names =
NIL;
4726 *passing_values =
lappend(*passing_values, expr);
4781 btype = behavior->
btype;
4793 errmsg(
"can only specify a constant, non-aggregate function, or operator expression for DEFAULT"),
4798 errmsg(
"DEFAULT expression must not contain column references"),
4803 errmsg(
"DEFAULT expression must not return a set"),
4818 errmsg(
"collation of DEFAULT expression conflicts with RETURNING clause"),
4842 bool isnull = (
IsA(expr,
Const) && ((
Const *) expr)->constisnull);
4897 errmsg(
"cannot cast behavior expression of type %s to %s",
4900 errhint(
"You will need to explicitly cast the expression to type %s.",
4906 errmsg(
"cannot cast behavior expression of type %s to %s",
4917 behavior->
expr = expr;
4937 bool isnull =
false;
4981 elog(
ERROR,
"unrecognized SQL/JSON behavior %d", btype);
4986 con->location = location;
4988 return (
Node *) con;
#define InvalidAttrNumber
int32 anytimestamp_typmod_check(bool istz, int32 typmod)
Bitmapset * bms_int_members(Bitmapset *a, const Bitmapset *b)
int bms_next_member(const Bitmapset *a, int prevbit)
Bitmapset * bms_add_member(Bitmapset *a, int x)
#define Assert(condition)
#define OidIsValid(objectId)
int32 anytime_typmod_check(bool istz, int32 typmod)
int errcode(int sqlerrcode)
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
int int errmsg_internal(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
void err(int eval, const char *fmt,...)
#define palloc_object(type)
#define palloc_array(type, count)
#define DirectFunctionCall1(func, arg1)
#define MaxTupleAttributeNumber
Datum jsonb_in(PG_FUNCTION_ARGS)
List * lappend(List *list, void *datum)
List * list_concat(List *list1, const List *list2)
List * lappend_oid(List *list, Oid datum)
List * lcons(void *datum, List *list)
List * list_delete_last(List *list)
List * list_truncate(List *list, int new_size)
Oid get_element_type(Oid typid)
bool type_is_rowtype(Oid typid)
char * get_database_name(Oid dbid)
Oid get_typcollation(Oid typid)
char * get_collation_name(Oid colloid)
List * get_op_index_interpretation(Oid opno)
bool type_is_collatable(Oid typid)
char get_typtype(Oid typid)
Oid getBaseTypeAndTypmod(Oid typid, int32 *typmod)
Oid getBaseType(Oid typid)
Oid get_array_type(Oid typid)
void get_type_category_preferred(Oid typid, char *typcategory, bool *typispreferred)
#define type_is_array(typid)
Expr * makeBoolExpr(BoolExprType boolop, List *args, int location)
JsonBehavior * makeJsonBehavior(JsonBehaviorType btype, Node *expr, int location)
A_Expr * makeSimpleA_Expr(A_Expr_Kind kind, char *name, Node *lexpr, Node *rexpr, int location)
Var * makeWholeRowVar(RangeTblEntry *rte, int varno, Index varlevelsup, bool allowScalar)
Node * makeBoolConst(bool value, bool isnull)
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
TargetEntry * makeTargetEntry(Expr *expr, AttrNumber resno, char *resname, bool resjunk)
FuncExpr * makeFuncExpr(Oid funcid, Oid rettype, List *args, Oid funccollid, Oid inputcollid, CoercionForm fformat)
JsonValueExpr * makeJsonValueExpr(Expr *raw_expr, Expr *formatted_expr, JsonFormat *format)
Node * makeJsonIsPredicate(Node *expr, JsonFormat *format, JsonValueType item_type, bool unique_keys, Oid exprBaseType, int location)
JsonFormat * makeJsonFormat(JsonFormatType type, JsonEncoding encoding, int location)
Const * makeConst(Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval)
char * pstrdup(const char *in)
void namestrcpy(Name name, const char *str)
char * NameListToString(const List *names)
Oid exprType(const Node *expr)
int32 exprTypmod(const Node *expr)
Oid exprCollation(const Node *expr)
int exprLocation(const Node *expr)
bool expression_returns_set(Node *clause)
#define expression_tree_walker(n, w, c)
#define IsA(nodeptr, _type_)
#define NodeSetTag(nodeptr, t)
#define castNode(_type_, nodeptr)
Node * transformGroupingFunc(ParseState *pstate, GroupingFunc *p)
void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc, WindowDef *windef)
void transformAggregateCall(ParseState *pstate, Aggref *agg, List *args, List *aggorder, bool agg_distinct)
Node * transformWhereClause(ParseState *pstate, Node *clause, ParseExprKind exprKind, const char *constructName)
TYPCATEGORY TypeCategory(Oid type)
Node * coerce_to_common_type(ParseState *pstate, Node *node, Oid targetTypeId, const char *context)
bool verify_common_type(Oid common_type, List *exprs)
int parser_coercion_errposition(ParseState *pstate, int coerce_location, Node *input_expr)
Node * coerce_to_specific_type(ParseState *pstate, Node *node, Oid targetTypeId, const char *constructName)
Node * coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId, int32 targetTypeMod, CoercionContext ccontext, CoercionForm cformat, int location)
Node * coerce_to_boolean(ParseState *pstate, Node *node, const char *constructName)
Oid select_common_type(ParseState *pstate, List *exprs, const char *context, Node **which_expr)
Node * coerce_to_target_type(ParseState *pstate, Node *expr, Oid exprtype, Oid targettype, int32 targettypmod, CoercionContext ccontext, CoercionForm cformat, int location)
void assign_expr_collations(ParseState *pstate, Node *expr)
static Node * transformMergeSupportFunc(ParseState *pstate, MergeSupportFunc *f)
static Node * make_nulltest_from_distinct(ParseState *pstate, A_Expr *distincta, Node *arg)
static void unknown_attribute(ParseState *pstate, Node *relref, const char *attname, int location)
static Node * transformJsonArrayConstructor(ParseState *pstate, JsonArrayConstructor *ctor)
static Node * transformCurrentOfExpr(ParseState *pstate, CurrentOfExpr *cexpr)
static Node * transformAExprOpAll(ParseState *pstate, A_Expr *a)
static Node * makeJsonByteaToTextConversion(Node *expr, JsonFormat *format, int location)
static Node * transformJsonParseExpr(ParseState *pstate, JsonParseExpr *jsexpr)
static Node * transformAExprIn(ParseState *pstate, A_Expr *a)
static JsonReturning * transformJsonOutput(ParseState *pstate, const JsonOutput *output, bool allow_format)
static void checkJsonOutputFormat(ParseState *pstate, const JsonFormat *format, Oid targettype, bool allow_format_for_non_strings)
static Node * transformJsonParseArg(ParseState *pstate, Node *jsexpr, JsonFormat *format, Oid *exprtype)
static Node * makeJsonConstructorExpr(ParseState *pstate, JsonConstructorType type, List *args, Expr *fexpr, JsonReturning *returning, bool unique, bool absent_on_null, int location)
static Node * transformAExprOpAny(ParseState *pstate, A_Expr *a)
static Node * transformXmlSerialize(ParseState *pstate, XmlSerialize *xs)
static Node * transformExprRecurse(ParseState *pstate, Node *expr)
static JsonBehavior * transformJsonBehavior(ParseState *pstate, JsonExpr *jsexpr, JsonBehavior *behavior, JsonBehaviorType default_behavior, JsonReturning *returning)
static Node * transformAExprNullIf(ParseState *pstate, A_Expr *a)
Node * transformExpr(ParseState *pstate, Node *expr, ParseExprKind exprKind)
static Node * transformJsonScalarExpr(ParseState *pstate, JsonScalarExpr *jsexpr)
static bool exprIsNullConstant(Node *arg)
static Expr * make_distinct_op(ParseState *pstate, List *opname, Node *ltree, Node *rtree, int location)
static Node * transformJsonArrayQueryConstructor(ParseState *pstate, JsonArrayQueryConstructor *ctor)
static Node * transformSQLValueFunction(ParseState *pstate, SQLValueFunction *svf)
static Node * transformColumnRef(ParseState *pstate, ColumnRef *cref)
static Node * transformCollateClause(ParseState *pstate, CollateClause *c)
static Node * transformBoolExpr(ParseState *pstate, BoolExpr *a)
static bool ValidJsonBehaviorDefaultExpr(Node *expr, void *context)
static Node * transformFuncCall(ParseState *pstate, FuncCall *fn)
static JsonReturning * transformJsonConstructorOutput(ParseState *pstate, JsonOutput *output, List *args)
static Node * transformMinMaxExpr(ParseState *pstate, MinMaxExpr *m)
static Node * transformJsonAggConstructor(ParseState *pstate, JsonAggConstructor *agg_ctor, JsonReturning *returning, List *args, Oid aggfnoid, Oid aggtype, JsonConstructorType ctor_type, bool unique, bool absent_on_null)
static Node * transformCoalesceExpr(ParseState *pstate, CoalesceExpr *c)
bool Transform_null_equals
static Node * transformSubLink(ParseState *pstate, SubLink *sublink)
static void transformJsonPassingArgs(ParseState *pstate, const char *constructName, JsonFormatType format, List *args, List **passing_values, List **passing_names)
static Node * transformJsonObjectConstructor(ParseState *pstate, JsonObjectConstructor *ctor)
static Node * make_row_comparison_op(ParseState *pstate, List *opname, List *largs, List *rargs, int location)
static JsonReturning * transformJsonReturning(ParseState *pstate, JsonOutput *output, const char *fname)
static Node * transformAExprOp(ParseState *pstate, A_Expr *a)
static Node * GetJsonBehaviorConst(JsonBehaviorType btype, int location)
static Node * transformJsonArrayAgg(ParseState *pstate, JsonArrayAgg *agg)
static Node * transformArrayExpr(ParseState *pstate, A_ArrayExpr *a, Oid array_type, Oid element_type, int32 typmod)
static Node * transformMultiAssignRef(ParseState *pstate, MultiAssignRef *maref)
static Node * transformBooleanTest(ParseState *pstate, BooleanTest *b)
static Node * make_row_distinct_op(ParseState *pstate, List *opname, RowExpr *lrow, RowExpr *rrow, int location)
static Node * transformTypeCast(ParseState *pstate, TypeCast *tc)
static Node * transformJsonValueExpr(ParseState *pstate, const char *constructName, JsonValueExpr *ve, JsonFormatType default_format, Oid targettype, bool isarg)
static Node * transformParamRef(ParseState *pstate, ParamRef *pref)
static Node * transformCaseExpr(ParseState *pstate, CaseExpr *c)
static Node * transformIndirection(ParseState *pstate, A_Indirection *ind)
static Node * coerceJsonFuncExpr(ParseState *pstate, Node *expr, const JsonReturning *returning, bool report_error)
static Node * transformJsonSerializeExpr(ParseState *pstate, JsonSerializeExpr *expr)
static Node * transformRowExpr(ParseState *pstate, RowExpr *r, bool allowDefault)
static Node * transformXmlExpr(ParseState *pstate, XmlExpr *x)
static Const * getJsonEncodingConst(JsonFormat *format)
static Node * transformAExprBetween(ParseState *pstate, A_Expr *a)
static Node * transformWholeRowRef(ParseState *pstate, ParseNamespaceItem *nsitem, int sublevels_up, int location)
const char * ParseExprKindName(ParseExprKind exprKind)
static Node * transformJsonFuncExpr(ParseState *pstate, JsonFuncExpr *func)
static Node * transformJsonIsPredicate(ParseState *pstate, JsonIsPredicate *pred)
static Node * transformJsonObjectAgg(ParseState *pstate, JsonObjectAgg *agg)
static Node * transformAExprDistinct(ParseState *pstate, A_Expr *a)
Node * ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, Node *last_srf, FuncCall *fn, bool proc_call, int location)
Node * transformGraphTablePropertyRef(ParseState *pstate, ColumnRef *cref)
void free_parsestate(ParseState *pstate)
int parser_errposition(ParseState *pstate, int location)
SubscriptingRef * transformContainerSubscripts(ParseState *pstate, Node *containerBase, Oid containerType, int32 containerTypMod, List *indirection, bool isAssignment)
Const * make_const(ParseState *pstate, A_Const *aconst)
ParseState * make_parsestate(ParseState *parentParseState)
@ EXPR_KIND_EXECUTE_PARAMETER
@ EXPR_KIND_COLUMN_DEFAULT
@ EXPR_KIND_STATS_EXPRESSION
@ EXPR_KIND_INDEX_EXPRESSION
@ EXPR_KIND_MERGE_RETURNING
@ EXPR_KIND_PROPGRAPH_PROPERTY
@ EXPR_KIND_PARTITION_BOUND
@ EXPR_KIND_FUNCTION_DEFAULT
@ EXPR_KIND_WINDOW_FRAME_RANGE
@ EXPR_KIND_FROM_SUBSELECT
@ EXPR_KIND_WINDOW_FRAME_GROUPS
@ EXPR_KIND_PARTITION_EXPRESSION
@ EXPR_KIND_INDEX_PREDICATE
@ EXPR_KIND_INSERT_TARGET
@ EXPR_KIND_ALTER_COL_TRANSFORM
@ EXPR_KIND_UPDATE_TARGET
@ EXPR_KIND_SELECT_TARGET
@ EXPR_KIND_GENERATED_COLUMN
@ EXPR_KIND_CALL_ARGUMENT
@ EXPR_KIND_FROM_FUNCTION
@ EXPR_KIND_UPDATE_SOURCE
@ EXPR_KIND_CHECK_CONSTRAINT
@ EXPR_KIND_WINDOW_PARTITION
@ EXPR_KIND_WINDOW_FRAME_ROWS
@ EXPR_KIND_VALUES_SINGLE
Expr * make_op(ParseState *pstate, List *opname, Node *ltree, Node *rtree, Node *last_srf, int location)
Expr * make_scalar_array_op(ParseState *pstate, List *opname, bool useOr, Node *ltree, Node *rtree, int location)
void markNullableIfNeeded(ParseState *pstate, Var *var)
void errorMissingColumn(ParseState *pstate, const char *relname, const char *colname, int location)
Node * colNameToVar(ParseState *pstate, const char *colname, bool localonly, int location)
void markVarForSelectPriv(ParseState *pstate, Var *var)
void errorMissingRTE(ParseState *pstate, RangeVar *relation)
void expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up, VarReturningType returning_type, int location, bool include_dropped, List **colnames, List **colvars)
Node * scanNSItemForColumn(ParseState *pstate, ParseNamespaceItem *nsitem, int sublevels_up, const char *colname, 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)
List * transformExpressionList(ParseState *pstate, List *exprlist, ParseExprKind exprKind, bool allowDefault)
char * FigureColname(Node *node)
Oid LookupCollation(ParseState *pstate, List *collnames, int location)
void typenameTypeIdAndMod(ParseState *pstate, const TypeName *typeName, Oid *typeid_p, int32 *typmod_p)
#define ISCOMPLEX(typeid)
Query * parse_sub_analyze(Node *parseTree, ParseState *parentParseState, CommonTableExpr *parentCTE, bool locked_from_parent, bool resolve_unknowns)
Query * transformStmt(ParseState *pstate, Node *parseTree)
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define forboth(cell1, list1, cell2, list2)
static void * list_nth(const List *list, int n)
#define list_make2(x1, x2)
static Datum BoolGetDatum(bool X)
static Datum NameGetDatum(const NameData *X)
static Datum CStringGetDatum(const char *X)
@ SVFOP_CURRENT_TIMESTAMP
@ SVFOP_CURRENT_TIMESTAMP_N
@ JSON_BEHAVIOR_EMPTY_OBJECT
@ JSON_BEHAVIOR_EMPTY_ARRAY
static int cmp(const chr *x, const chr *y, size_t len)
static struct cvec * range(struct vars *v, chr a, chr b, int cases)
static chr element(struct vars *v, const chr *startp, const chr *endp)
void check_stack_depth(void)
JsonReturning * returning
JsonValueExpr * context_item
JsonReturning * returning
NullTestType nulltesttype
ParseState * parentParseState
ParseNamespaceItem * p_target_nsitem
ParseExprKind p_expr_kind
List * p_multiassign_exprs
ParseParamRefHook p_paramref_hook
PreParseColumnRefHook p_pre_columnref_hook
PostParseColumnRefHook p_post_columnref_hook
static void * fn(void *arg)
int count_nonjunk_tlist_entries(List *tlist)
bool DomainHasConstraints(Oid type_id, bool *has_volatile)
String * makeString(char *str)
bool contain_vars_of_level(Node *node, int levelsup)
bool contain_var_clause(Node *node)
#define select(n, r, w, e, timeout)
char * map_sql_identifier_to_xml_name(const char *ident, bool fully_escaped, bool escape_period)