38#include "utils/fmgroids.h"
77 int sublevels_up,
int location);
97 List **passing_values,
List **passing_names);
104 List *largs,
List *rargs,
int location);
217 elog(
ERROR,
"unrecognized A_Expr kind: %d",
a->kind);
313 errmsg(
"DEFAULT is not allowed in this context"),
406 errmsg(
"column %s.%s does not exist",
418 errmsg(
"column \"%s\" not found in data type %s",
424 errmsg(
"could not identify column \"%s\" in record data type",
430 errmsg(
"column notation .%s applied to type %s, "
431 "which is not a composite type",
451 foreach(
i,
ind->indirection)
461 errmsg(
"row expansion via \"*\" is not supported here"),
513 char *nspname =
NULL;
515 char *colname =
NULL;
584 err =
_(
"cannot use column reference in DEFAULT expression");
587 err =
_(
"cannot use column reference in partition bound expression");
846 errmsg(
"column reference \"%s\" is ambiguous",
868 errmsg(
"cross-database references are not implemented: %s",
875 errmsg(
"improper qualified name (too many dotted names): %s",
902 errmsg(
"there is no parameter $%d",
pref->number),
925 Node *lexpr =
a->lexpr;
926 Node *rexpr =
a->rexpr;
967 s->operName =
a->name;
1034 Node *lexpr =
a->lexpr;
1035 Node *rexpr =
a->rexpr;
1099 if (result->opresulttype !=
BOOLOID)
1103 errmsg(
"%s requires = operator to yield boolean",
"NULLIF"),
1105 if (result->opretset)
1109 errmsg(
"%s must not return a set",
"NULLIF"),
1122 return (
Node *) result;
1158 foreach(l, (
List *)
a->rexpr)
1227 newa->array_typeid = array_type;
1231 newa->multidims =
false;
1232 newa->location = -1;
1380 elog(
ERROR,
"unrecognized A_Expr kind: %d",
a->kind);
1406 errmsg(
"MERGE_ACTION() can only be used in the RETURNING list of a MERGE command"),
1432 elog(
ERROR,
"unrecognized boolop: %d", (
int)
a->boolop);
1437 foreach(
lc,
a->args)
1458 foreach(args,
fn->args)
1472 if (
fn->agg_within_group)
1475 foreach(args,
fn->agg_order)
1506 if (
maref->colno == 1)
1530 errmsg(
"number of columns does not match number of values"),
1562 errmsg(
"number of columns does not match number of values"),
1576 errmsg(
"source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"),
1613 return (
Node *) param;
1638 elog(
ERROR,
"unexpected expr type in multiassign list");
1724 defresult = (
Node *)
c->defresult;
1725 if (defresult ==
NULL)
1731 defresult = (
Node *) n;
1744 newc->casetype = ptype;
1755 foreach(l,
newc->args)
1771 errmsg(
"set-returning functions are not allowed in %s",
1773 errhint(
"You might be able to move the set-returning function into a LATERAL FROM item."),
1777 newc->location =
c->location;
1835 err =
_(
"cannot use subquery in check constraint");
1839 err =
_(
"cannot use subquery in DEFAULT expression");
1842 err =
_(
"cannot use subquery in index expression");
1845 err =
_(
"cannot use subquery in index predicate");
1848 err =
_(
"cannot use subquery in statistics expression");
1851 err =
_(
"cannot use subquery in transform expression");
1854 err =
_(
"cannot use subquery in EXECUTE parameter");
1857 err =
_(
"cannot use subquery in trigger WHEN condition");
1860 err =
_(
"cannot use subquery in partition bound");
1863 err =
_(
"cannot use subquery in partition key expression");
1866 err =
_(
"cannot use subquery in CALL argument");
1869 err =
_(
"cannot use subquery in COPY FROM WHERE condition");
1872 err =
_(
"cannot use subquery in column generation expression");
1902 elog(
ERROR,
"unexpected non-SELECT command in SubLink");
1925 errmsg(
"subquery must return only one column"),
1969 foreach(l,
qtree->targetList)
1996 errmsg(
"subquery has too many columns"),
2001 errmsg(
"subquery has too few columns"),
2042 newa->multidims =
false;
2061 newa->multidims =
true;
2073 if (!
newa->multidims)
2079 newa->multidims =
true;
2105 errmsg(
"cannot determine type of empty array"),
2106 errhint(
"Explicitly cast to the desired type, "
2107 "for example ARRAY[]::integer[]."),
2113 if (
newa->multidims)
2120 errmsg(
"could not find element type for data type %s",
2131 errmsg(
"could not find array type for data type %s",
2165 errmsg(
"cannot cast type %s to %s",
2177 newa->array_typeid = array_type;
2179 newa->element_typeid = element_type;
2181 newa->list_start =
a->list_start;
2182 newa->list_end =
a->list_end;
2183 newa->location =
a->location;
2205 errmsg(
"ROW expressions can have at most %d entries",
2235 foreach(args,
c->args)
2264 errmsg(
"set-returning functions are not allowed in %s",
2266 errhint(
"You might be able to move the set-returning function into a LATERAL FROM item."),
2271 newc->location =
c->location;
2285 foreach(args, m->
args)
2364 return (
Node *) svf;
2380 newx->xmloption =
x->xmloption;
2383 newx->location =
x->location;
2392 foreach(
lc,
x->named_args)
2410 ?
errmsg(
"unnamed XML attribute value must be a column reference")
2411 :
errmsg(
"unnamed XML element value must be a column reference"),
2426 errmsg(
"XML attribute name \"%s\" appears more than once",
2439 foreach(
lc,
x->args)
2513 xexpr->xmloption =
xs->xmloption;
2534 errmsg(
"cannot cast XMLSERIALIZE result to %s",
2545 switch (
b->booltesttype)
2566 elog(
ERROR,
"unrecognized booltesttype: %d",
2567 (
int)
b->booltesttype);
2599 cref->location = -1;
2626 return (
Node *) cexpr;
2634 int sublevels_up,
int location)
2665 sublevels_up,
true);
2679 return (
Node *) result;
2693 nsitem->p_returning_type, location,
false,
NULL, &fields);
2704 return (
Node *) rowexpr;
2773 location =
tc->location;
2775 location =
tc->typeName->location;
2785 errmsg(
"cannot cast type %s to %s",
2816 errmsg(
"collations are not supported by type %s",
2821 newc->location =
c->location;
2840 List *largs,
List *rargs,
int location)
2858 errmsg(
"unequal number of entries in row expressions"),
2868 errmsg(
"cannot compare rows of zero length"),
2893 errmsg(
"row comparison operator must yield type boolean, "
2900 errmsg(
"row comparison operator must not return a set"),
2959 errmsg(
"could not determine interpretation of row comparison operator %s",
2961 errhint(
"Row comparison operators must be associated with btree operator families."),
2989 if (
opinfo->cmptype == cmptype)
2991 opfamily =
opinfo->opfamily_id;
3000 errmsg(
"could not determine interpretation of row comparison operator %s",
3002 errdetail(
"There are multiple equally-plausible candidates."),
3025 rcexpr->cmptype = cmptype;
3054 errmsg(
"unequal number of entries in row expressions"),
3096 errmsg(
"%s requires = operator to yield boolean",
3097 "IS DISTINCT FROM"),
3103 errmsg(
"%s must not return a set",
"IS DISTINCT FROM"),
3131 nt->argisrow =
false;
3149 return "invalid expression context";
3151 return "extension expression";
3155 return "JOIN/USING";
3157 return "sub-SELECT in FROM";
3159 return "function in FROM";
3169 return "window PARTITION BY";
3171 return "window ORDER BY";
3173 return "window RANGE";
3175 return "window ROWS";
3177 return "window GROUPS";
3186 return "MERGE WHEN";
3192 return "DISTINCT ON";
3210 return "index expression";
3212 return "index predicate";
3214 return "statistics expression";
3222 return "partition bound";
3224 return "PARTITION BY";
3230 return "GENERATED AS";
3241 return "unrecognized expression kind";
3297 fexpr->location = location;
3337 errmsg(
"JSON ENCODING clause is only allowed for bytea input type"),
3386 (
OidIsValid(targettype) && exprtype != targettype))
3401 errmsg(
"cannot use non-string types with implicit FORMAT JSON clause") :
3402 errmsg(
"cannot use non-string types with explicit FORMAT JSON clause"),
3404 ve->format->location : location));
3436 errmsg(
"cannot cast type %s to %s",
3445 fexpr->location = location;
3491 errmsg(
"cannot use JSON format with non-string output types"));
3504 errmsg(
"cannot set JSON encoding for non-bytea output types"));
3509 errmsg(
"unsupported JSON encoding"),
3510 errhint(
"Only UTF8 JSON encoding is supported."),
3544 if (
output->typeName->setof)
3547 errmsg(
"returning SETOF types is not supported in SQL/JSON functions"));
3552 errmsg(
"returning pseudo-types is not supported in SQL/JSON functions"));
3642 fexpr->location = location;
3665 errmsg(
"cannot cast type %s to %s",
3679 bool unique,
bool absent_on_null,
int location)
3688 jsctor->returning = returning;
3690 jsctor->absent_on_null = absent_on_null;
3691 jsctor->location = location;
3765 returning,
ctor->unique,
3766 ctor->absent_on_null,
ctor->location);
3795 errmsg(
"subquery must return only one column"),
3810 agg->absent_on_null =
ctor->absent_on_null;
3812 agg->constructor->agg_order =
NIL;
3813 agg->constructor->output =
ctor->output;
3814 agg->constructor->location =
ctor->location;
3824 range->lateral =
false;
3826 range->alias = alias;
3849 bool unique,
bool absent_on_null)
3868 wfunc->runCondition =
NIL;
3870 wfunc->winstar =
false;
3871 wfunc->winagg =
true;
3880 errmsg(
"aggregate ORDER BY is not implemented for window functions"),
3886 node = (
Node *) wfunc;
3901 aggref->aggstar =
false;
3902 aggref->aggvariadic =
false;
3904 aggref->aggpresorted =
false;
3908 aggref->aggtransno = -1;
3913 node = (
Node *) aggref;
3917 returning, unique, absent_on_null,
3952 if (
agg->absent_on_null)
3957 else if (
agg->unique)
3966 if (
agg->absent_on_null)
3971 else if (
agg->unique)
3982 agg->unique,
agg->absent_on_null);
4022 false,
agg->absent_on_null);
4058 returning,
false,
ctor->absent_on_null,
4067 Node *expr = raw_expr;
4103 errmsg(
"cannot use JSON FORMAT ENCODING clause for non-bytea input types")));
4123 errmsg(
"cannot use type %s in IS JSON predicate",
4149 errmsg(
"cannot use type %s in RETURNING clause of %s",
4151 errhint(
"Try returning json or jsonb."),
4162 returning->
typid = targettype;
4199 errmsg(
"cannot use non-string types with WITH UNIQUE KEYS clause"),
4237 returning,
false,
false, jsexpr->
location);
4270 errmsg(
"cannot use type %s in RETURNING clause of %s",
4272 "JSON_SERIALIZE()"),
4273 errhint(
"Try returning a string type or bytea.")));
4301 const char *func_name =
NULL;
4307 func_name =
"JSON_EXISTS";
4311 func_name =
"JSON_QUERY";
4315 func_name =
"JSON_VALUE";
4319 func_name =
"JSON_TABLE";
4323 elog(
ERROR,
"invalid JsonFuncExpr op %d", (
int) func->
op);
4341 errmsg(
"cannot specify FORMAT JSON in RETURNING clause of %s()",
4354 errmsg(
"SQL/JSON QUOTES behavior must not be specified when WITH WRAPPER is used"),
4368 errmsg(
"invalid %s behavior",
"ON EMPTY"),
4371 errdetail(
"Only ERROR, NULL, EMPTY ARRAY, EMPTY OBJECT, or DEFAULT expression is allowed in %s for %s.",
4372 "ON EMPTY",
"JSON_QUERY()"),
4378 errmsg(
"invalid %s behavior for column \"%s\"",
4381 errdetail(
"Only ERROR, NULL, EMPTY ARRAY, EMPTY OBJECT, or DEFAULT expression is allowed in %s for formatted columns.",
4397 errmsg(
"invalid %s behavior",
"ON ERROR"),
4400 errdetail(
"Only ERROR, NULL, EMPTY ARRAY, EMPTY OBJECT, or DEFAULT expression is allowed in %s for %s.",
4401 "ON ERROR",
"JSON_QUERY()"),
4407 errmsg(
"invalid %s behavior for column \"%s\"",
4410 errdetail(
"Only ERROR, NULL, EMPTY ARRAY, EMPTY OBJECT, or DEFAULT expression is allowed in %s for formatted columns.",
4428 errmsg(
"invalid %s behavior",
"ON ERROR"),
4429 errdetail(
"Only ERROR, TRUE, FALSE, or UNKNOWN is allowed in %s for %s.",
4430 "ON ERROR",
"JSON_EXISTS()"),
4436 errmsg(
"invalid %s behavior for column \"%s\"",
4439 errdetail(
"Only ERROR, TRUE, FALSE, or UNKNOWN is allowed in %s for EXISTS columns.",
4454 errmsg(
"invalid %s behavior",
"ON EMPTY"),
4457 errdetail(
"Only ERROR, NULL, or DEFAULT expression is allowed in %s for %s.",
4458 "ON EMPTY",
"JSON_VALUE()"),
4464 errmsg(
"invalid %s behavior for column \"%s\"",
4467 errdetail(
"Only ERROR, NULL, or DEFAULT expression is allowed in %s for scalar columns.",
4480 errmsg(
"invalid %s behavior",
"ON ERROR"),
4483 errdetail(
"Only ERROR, NULL, or DEFAULT expression is allowed in %s for %s.",
4484 "ON ERROR",
"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.",
4501 jsexpr->
op = func->
op;
4527 errmsg(
"JSON path expression must be of type %s, not of type %s",
4673 elog(
ERROR,
"invalid JsonFuncExpr op %d", (
int) func->
op);
4677 return (
Node *) jsexpr;
4686 List **passing_values,
List **passing_names)
4690 *passing_values =
NIL;
4691 *passing_names =
NIL;
4700 *passing_values =
lappend(*passing_values, expr);
4755 btype = behavior->
btype;
4767 errmsg(
"can only specify a constant, non-aggregate function, or operator expression for DEFAULT"),
4772 errmsg(
"DEFAULT expression must not contain column references"),
4777 errmsg(
"DEFAULT expression must not return a set"),
4792 errmsg(
"collation of DEFAULT expression conflicts with RETURNING clause"),
4816 bool isnull = (
IsA(expr,
Const) && ((
Const *) expr)->constisnull);
4871 errmsg(
"cannot cast behavior expression of type %s to %s",
4874 errhint(
"You will need to explicitly cast the expression to type %s.",
4880 errmsg(
"cannot cast behavior expression of type %s to %s",
4891 behavior->
expr = expr;
4911 bool isnull =
false;
4955 elog(
ERROR,
"unrecognized SQL/JSON behavior %d", btype);
4960 con->location = location;
4962 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 errmsg_internal(const char *fmt,...)
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#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)
JsonFormat * makeJsonFormat(JsonFormatType type, JsonEncoding encoding, int location)
Const * makeConst(Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval)
Node * makeJsonIsPredicate(Node *expr, JsonFormat *format, JsonValueType item_type, bool unique_keys, int location)
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)
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_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
VarReturningType varreturningtype
static void * fn(void *arg)
int count_nonjunk_tlist_entries(List *tlist)
bool DomainHasConstraints(Oid type_id)
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)