50 #include "utils/fmgroids.h"
119 bool *haveNull,
bool *forceTrue);
122 bool *haveNull,
bool *forceFalse);
125 Oid result_type,
int32 result_typmod,
126 Oid result_collid,
Oid input_collid,
List **args_p,
127 bool funcvariadic,
bool process_args,
bool allow_non_const,
249 elog(
ERROR,
"WindowFunc contains out-of-range winref %u",
297 if (expr->funcretset)
405 foreach(lc, ctor->
args)
429 if (cnst->constisnull)
681 return (func_id != F_NEXTVAL &&
738 context.max_hazard = PROPARALLEL_SAFE;
739 context.max_interesting = PROPARALLEL_UNSAFE;
765 if (
root->glob->maxParallelHazard == PROPARALLEL_SAFE &&
766 root->glob->paramExecTypes ==
NIL)
769 context.max_hazard = PROPARALLEL_SAFE;
770 context.max_interesting = PROPARALLEL_RESTRICTED;
778 for (proot =
root; proot != NULL; proot = proot->parent_root)
798 case PROPARALLEL_SAFE:
801 case PROPARALLEL_RESTRICTED:
804 context->max_hazard = proparallel;
806 if (
context->max_interesting == proparallel)
809 case PROPARALLEL_UNSAFE:
810 context->max_hazard = proparallel;
814 elog(
ERROR,
"unrecognized proparallel value \"%c\"", proparallel);
905 List *save_safe_param_ids;
910 save_safe_param_ids =
context->safe_param_ids;
916 context->safe_param_ids = save_safe_param_ids;
959 context->max_hazard = PROPARALLEL_UNSAFE;
1186 #define CCDN_CASETESTEXPR_OK 0x0001
1206 int save_flags = *flags;
1221 *flags = save_flags;
1236 save_flags = *flags;
1240 *flags = save_flags;
1288 case T_NamedArgExpr:
1293 case T_CaseTestExpr:
1295 case T_SQLValueFunction:
1298 case T_NextValueExpr:
1309 case T_DistinctExpr:
1311 case T_ScalarArrayOpExpr:
1313 case T_ArrayCoerceExpr:
1325 case T_SubscriptingRef:
1345 case T_RowCompareExpr:
1358 larg, rcexpr->
largs,
1359 rarg, rcexpr->
rargs)
1401 case T_CurrentOfExpr:
1487 foreach(l, (
List *) node)
1546 foreach(l, expr->
args)
1740 foreach(l, (
List *) node)
1804 foreach(l, expr->
args)
1939 foreach(l, (
List *) node)
2035 if (expr->
useOr && falseOK)
2040 if (rightop &&
IsA(rightop,
Const))
2042 Datum arraydatum = ((
Const *) rightop)->constvalue;
2043 bool arrayisnull = ((
Const *) rightop)->constisnull;
2058 if (arrayexpr->
elements !=
NIL && !arrayexpr->multidims)
2155 elog(
ERROR,
"cannot commute non-binary-operator clause");
2160 elog(
ERROR,
"could not find commutator for operator %u",
2166 clause->
opno = opoid;
2187 Oid expectedtype,
int32 expectedtypmod,
2188 Oid expectedcollation)
2194 if (rowtypeid == RECORDOID)
2197 if (fieldnum <= 0 || fieldnum > tupdesc->
natts)
2203 if (attr->attisdropped ||
2204 attr->atttypid != expectedtype ||
2205 attr->atttypmod != expectedtypmod ||
2206 attr->attcollation != expectedcollation)
2269 #define MIN_ARRAY_SIZE_FOR_HASHED_SAOP 9
2305 if (arrayarg &&
IsA(arrayarg,
Const) &&
2306 !((
Const *) arrayarg)->constisnull)
2311 lefthashfunc == righthashfunc)
2313 Datum arrdatum = ((
Const *) arrayarg)->constvalue;
2327 saop->hashfuncid = lefthashfunc;
2343 lefthashfunc == righthashfunc)
2345 Datum arrdatum = ((
Const *) arrayarg)->constvalue;
2359 saop->hashfuncid = lefthashfunc;
2417 #define ece_generic_processing(node) \
2418 expression_tree_mutator((Node *) (node), eval_const_expressions_mutator, \
2426 #define ece_all_arguments_const(node) \
2427 (!expression_tree_walker((Node *) (node), contain_non_const_walker, NULL))
2430 #define ece_evaluate_expr(node) \
2431 ((Node *) evaluate_expr((Expr *) (node), \
2432 exprType((Node *) (node)), \
2433 exprTypmod((Node *) (node)), \
2434 exprCollation((Node *) (node))))
2501 &typLen, &typByVal);
2502 if (prm->
isnull || typByVal)
2514 return (
Node *) con;
2543 elog(
ERROR,
"cache lookup failed for function %u", funcid);
2546 false, expr->wintype,
2557 aggfilter = (
Expr *)
2564 newexpr->wintype = expr->wintype;
2565 newexpr->wincollid = expr->wincollid;
2566 newexpr->inputcollid = expr->inputcollid;
2569 newexpr->runCondition = expr->runCondition;
2571 newexpr->winstar = expr->winstar;
2572 newexpr->winagg = expr->winagg;
2575 return (
Node *) newexpr;
2592 expr->funcresulttype,
2602 return (
Node *) simple;
2612 newexpr->funcresulttype = expr->funcresulttype;
2613 newexpr->funcretset = expr->funcretset;
2614 newexpr->funcvariadic = expr->funcvariadic;
2615 newexpr->funcformat = expr->funcformat;
2616 newexpr->funccollid = expr->funccollid;
2617 newexpr->inputcollid = expr->inputcollid;
2620 return (
Node *) newexpr;
2640 expr->opresulttype, -1,
2649 return (
Node *) simple;
2656 if (expr->
opno == BooleanEqualOperator ||
2657 expr->
opno == BooleanNotEqualOperator)
2662 return (
Node *) simple;
2672 newexpr->opfuncid = expr->opfuncid;
2673 newexpr->opresulttype = expr->opresulttype;
2674 newexpr->opretset = expr->opretset;
2675 newexpr->opcollid = expr->opcollid;
2676 newexpr->inputcollid = expr->inputcollid;
2679 return (
Node *) newexpr;
2681 case T_DistinctExpr:
2686 bool has_null_input =
false;
2687 bool all_null_input =
true;
2688 bool has_nonconst_input =
false;
2715 has_nonconst_input =
true;
2719 if (!has_nonconst_input)
2744 expr->opresulttype, -1,
2760 csimple->constvalue =
2762 return (
Node *) csimple;
2773 newexpr->opfuncid = expr->opfuncid;
2774 newexpr->opresulttype = expr->opresulttype;
2775 newexpr->opretset = expr->opretset;
2776 newexpr->opcollid = expr->opcollid;
2777 newexpr->inputcollid = expr->inputcollid;
2780 return (
Node *) newexpr;
2786 bool has_nonconst_input =
false;
2795 has_nonconst_input =
true;
2806 if (!has_nonconst_input &&
2810 return (
Node *) expr;
2812 case T_ScalarArrayOpExpr:
2829 return (
Node *) saop;
2840 bool haveNull =
false;
2841 bool forceTrue =
false;
2868 bool haveNull =
false;
2869 bool forceFalse =
false;
2915 case T_JsonValueExpr:
2922 if (formatted &&
IsA(formatted,
Const))
2928 case T_AlternativeSubPlan:
2948 relabel->resulttypmod,
2949 relabel->resultcollid,
2950 relabel->relabelformat,
2959 bool outtypisvarlena;
2978 &outfunc, &outtypisvarlena);
2980 &infunc, &intypioparam);
3024 return (
Node *) simple;
3035 newexpr->resultcollid = expr->resultcollid;
3036 newexpr->coerceformat = expr->coerceformat;
3038 return (
Node *) newexpr;
3040 case T_ArrayCoerceExpr:
3043 Node *save_case_val;
3059 save_case_val =
context->case_val;
3066 context->case_val = save_case_val;
3141 Node *save_case_val;
3144 bool const_true_cond;
3145 Node *defresult = NULL;
3153 save_case_val =
context->case_val;
3164 const_true_cond =
false;
3180 if (casecond &&
IsA(casecond,
Const))
3184 if (const_input->constisnull ||
3188 const_true_cond =
true;
3196 if (!const_true_cond)
3200 newcasewhen->
expr = (
Expr *) casecond;
3203 newargs =
lappend(newargs, newcasewhen);
3212 defresult = caseresult;
3217 if (!const_true_cond)
3221 context->case_val = save_case_val;
3231 newcase->casetype = caseexpr->casetype;
3232 newcase->casecollid = caseexpr->casecollid;
3233 newcase->
arg = (
Expr *) newarg;
3234 newcase->
args = newargs;
3237 return (
Node *) newcase;
3239 case T_CaseTestExpr:
3251 case T_SubscriptingRef:
3278 case T_CoalesceExpr:
3286 foreach(
arg, coalesceexpr->
args)
3303 if (((
Const *)
e)->constisnull)
3320 coalesceexpr->coalescecollid);
3323 newcoalesce->coalescetype = coalesceexpr->coalescetype;
3324 newcoalesce->coalescecollid = coalesceexpr->coalescecollid;
3325 newcoalesce->
args = newargs;
3327 return (
Node *) newcoalesce;
3329 case T_SQLValueFunction:
3380 ((
Var *)
arg)->varlevelsup == 0)
3384 fselect->resulttype,
3385 fselect->resulttypmod,
3386 fselect->resultcollid))
3392 fselect->resulttype,
3393 fselect->resulttypmod,
3394 fselect->resultcollid,
3395 ((
Var *)
arg)->varlevelsup);
3397 newvar->varnullingrels = ((
Var *)
arg)->varnullingrels;
3398 return (
Node *) newvar;
3413 fselect->resulttype,
3414 fselect->resulttypmod,
3415 fselect->resultcollid) &&
3416 fselect->resulttype ==
exprType(fld) &&
3425 newfselect->resulttype = fselect->resulttype;
3426 newfselect->resulttypmod = fselect->resulttypmod;
3427 newfselect->resultcollid = fselect->resultcollid;
3434 newfselect->resulttype,
3435 newfselect->resulttypmod,
3436 newfselect->resultcollid))
3439 return (
Node *) newfselect;
3461 foreach(l, rarg->
args)
3473 if (carg->constisnull ?
3487 newntest->
arg = (
Expr *) relem;
3489 newntest->argisrow =
false;
3491 newargs =
lappend(newargs, newntest);
3510 result = carg->constisnull;
3513 result = !carg->constisnull;
3516 elog(
ERROR,
"unrecognized nulltesttype: %d",
3528 newntest->argisrow = ntest->argisrow;
3530 return (
Node *) newntest;
3555 result = (!carg->constisnull &&
3559 result = (carg->constisnull ||
3563 result = (!carg->constisnull &&
3567 result = (carg->constisnull ||
3571 result = carg->constisnull;
3574 result = !carg->constisnull;
3577 elog(
ERROR,
"unrecognized booltesttype: %d",
3590 return (
Node *) newbtest;
3592 case T_CoerceToDomain:
3621 cdomain->resulttypmod,
3622 cdomain->resultcollid,
3623 cdomain->coercionformat,
3631 newcdomain->resulttypmod = cdomain->resulttypmod;
3632 newcdomain->resultcollid = cdomain->resultcollid;
3633 newcdomain->coercionformat = cdomain->coercionformat;
3635 return (
Node *) newcdomain;
3637 case T_PlaceHolderVar:
3654 case T_ConvertRowtypeExpr:
3665 newcre->convertformat = cre->convertformat;
3691 newcre->convertformat = argcre->convertformat;
3698 return (
Node *) newcre;
3751 if (provolatile == PROVOLATILE_IMMUTABLE)
3753 if (
context->estimate && provolatile == PROVOLATILE_STABLE)
3780 bool *haveNull,
bool *forceTrue)
3783 List *unprocessed_args;
3797 while (unprocessed_args)
3807 List *oldlist = unprocessed_args;
3840 if (const_input->constisnull)
3886 bool *haveNull,
bool *forceFalse)
3889 List *unprocessed_args;
3893 while (unprocessed_args)
3903 List *oldlist = unprocessed_args;
3936 if (const_input->constisnull)
3989 if (opno == BooleanEqualOperator)
4004 if (rightop &&
IsA(rightop,
Const))
4007 if (opno == BooleanEqualOperator)
4048 Oid result_collid,
Oid input_collid,
List **args_p,
4049 bool funcvariadic,
bool process_args,
bool allow_non_const,
4071 elog(
ERROR,
"cache lookup failed for function %u", funcid);
4093 result_collid, input_collid,
4097 if (!newexpr && allow_non_const &&
OidIsValid(func_form->prosupport))
4109 fexpr.
xpr.type = T_FuncExpr;
4111 fexpr.funcresulttype = result_type;
4112 fexpr.funcretset = func_form->proretset;
4113 fexpr.funcvariadic = funcvariadic;
4115 fexpr.funccollid = result_collid;
4116 fexpr.inputcollid = input_collid;
4120 req.
type = T_SupportRequestSimplify;
4132 if (!newexpr && allow_non_const)
4134 input_collid,
args, funcvariadic,
4167 Oid *proargtypes = funcform->proargtypes.values;
4169 bool has_named_args =
false;
4180 if (include_out_arguments)
4182 Datum proallargtypes;
4186 Anum_pg_proc_proallargtypes,
4197 elog(
ERROR,
"proallargtypes is not a 1-D Oid array or it contains nulls");
4210 has_named_args =
true;
4254 elog(
ERROR,
"too many function arguments");
4267 argarray[
i++] =
arg;
4287 i =
pronargs - funcform->pronargdefaults;
4288 foreach(lc, defaults)
4290 if (argarray[
i] == NULL)
4326 elog(
ERROR,
"not enough default arguments");
4341 Datum proargdefaults;
4345 Anum_pg_proc_proargdefaults);
4380 elog(
ERROR,
"too many function arguments");
4387 memcpy(declared_arg_types, proargtypes,
pronargs *
sizeof(
Oid));
4391 funcform->prorettype,
4394 if (rettype != result_type)
4395 elog(
ERROR,
"function's resolved result type changed during planning");
4420 bool has_nonconst_input =
false;
4421 bool has_null_input =
false;
4428 if (funcform->proretset)
4441 if (funcform->prorettype == RECORDOID)
4452 has_nonconst_input =
true;
4461 if (funcform->proisstrict && has_null_input)
4470 if (has_nonconst_input)
4480 if (funcform->provolatile == PROVOLATILE_IMMUTABLE)
4482 else if (
context->estimate && funcform->provolatile == PROVOLATILE_STABLE)
4493 newexpr->
funcid = funcid;
4494 newexpr->funcresulttype = result_type;
4495 newexpr->funcretset =
false;
4496 newexpr->funcvariadic = funcvariadic;
4498 newexpr->funccollid = result_collid;
4499 newexpr->inputcollid = input_collid;
4557 List *raw_parsetree_list;
4558 List *querytree_list;
4569 if (funcform->prolang != SQLlanguageId ||
4570 funcform->prokind != PROKIND_FUNCTION ||
4571 funcform->prosecdef ||
4572 funcform->proretset ||
4573 funcform->prorettype == RECORDOID ||
4606 fexpr->funcresulttype = result_type;
4607 fexpr->funcretset =
false;
4608 fexpr->funcvariadic = funcvariadic;
4610 fexpr->funccollid = result_collid;
4611 fexpr->inputcollid = input_collid;
4624 callback_arg.
prosrc = src;
4627 sqlerrcontext.
arg = (
void *) &callback_arg;
4634 Anum_pg_proc_prosqlbody,
4729 result_type, rettupdesc,
4752 if (
exprType(newexpr) != result_type)
4763 if (funcform->provolatile == PROVOLATILE_IMMUTABLE &&
4766 else if (funcform->provolatile == PROVOLATILE_STABLE &&
4770 if (funcform->proisstrict &&
4787 usecounts = (
int *)
palloc0(funcform->pronargs *
sizeof(
int));
4797 if (usecounts[
i] == 0)
4800 if (funcform->proisstrict)
4803 else if (usecounts[
i] != 1)
4851 if (
OidIsValid(exprcoll) && exprcoll != result_collid)
4855 newnode->
arg = (
Expr *) newexpr;
4856 newnode->
collOid = result_collid;
4859 newexpr = (
Node *) newnode;
4880 return (
Expr *) newexpr;
4902 context.usecounts = usecounts;
4940 int syntaxerrposition;
4944 if (syntaxerrposition > 0)
4962 Oid result_collation)
4970 bool resultTypByVal;
5017 if (resultTypLen == -1)
5020 const_val =
datumCopy(const_val, resultTypByVal, resultTypLen);
5029 return (
Expr *)
makeConst(result_type, result_typmod, result_collation,
5031 const_val, const_is_null,
5070 List *raw_parsetree_list;
5071 List *querytree_list;
5097 func_oid = fexpr->
funcid;
5104 if (!fexpr->funcretset)
5133 elog(
ERROR,
"cache lookup failed for function %u", func_oid);
5146 if (funcform->prolang != SQLlanguageId ||
5147 funcform->prokind != PROKIND_FUNCTION ||
5148 funcform->proisstrict ||
5149 funcform->provolatile == PROVOLATILE_VOLATILE ||
5150 funcform->prorettype == VOIDOID ||
5151 funcform->prosecdef ||
5152 !funcform->proretset ||
5165 "inline_set_returning_function",
5178 callback_arg.
prosrc = src;
5181 sqlerrcontext.
arg = (
void *) &callback_arg;
5188 Anum_pg_proc_prosqlbody,
5219 fexpr->inputcollid);
5244 if (rtfunc->funccolnames !=
NIL)
5248 rtfunc->funccoltypes,
5249 rtfunc->funccoltypmods,
5250 rtfunc->funccolcollations);
5276 fexpr->funcresulttype, rettupdesc,
5325 root->glob->dependsOnRole =
true;
Datum querytree(PG_FUNCTION_ARGS)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
#define DatumGetArrayTypeP(X)
int ArrayGetNItems(int ndim, const int *dims)
#define InvalidAttrNumber
Bitmapset * bms_join(Bitmapset *a, Bitmapset *b)
void bms_free(Bitmapset *a)
int bms_num_members(const Bitmapset *a)
Bitmapset * bms_make_singleton(int x)
Bitmapset * bms_add_member(Bitmapset *a, int x)
Bitmapset * bms_add_members(Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_del_members(Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_int_members(Bitmapset *a, const Bitmapset *b)
BMS_Membership bms_membership(const Bitmapset *a)
#define TextDatumGetCString(d)
#define Assert(condition)
#define OidIsValid(objectId)
static bool contain_subplans_walker(Node *node, void *context)
#define CCDN_CASETESTEXPR_OK
static List * simplify_or_arguments(List *args, eval_const_expressions_context *context, bool *haveNull, bool *forceTrue)
static bool is_strict_saop(ScalarArrayOpExpr *expr, bool falseOK)
bool contain_volatile_functions_not_nextval(Node *clause)
static bool contain_leaked_vars_checker(Oid func_id, void *context)
static bool rowtype_field_matches(Oid rowtypeid, int fieldnum, Oid expectedtype, int32 expectedtypmod, Oid expectedcollation)
WindowFuncLists * find_window_functions(Node *clause, Index maxWinRef)
static bool contain_nonstrict_functions_walker(Node *node, void *context)
static List * add_function_defaults(List *args, int pronargs, HeapTuple func_tuple)
#define ece_all_arguments_const(node)
Expr * evaluate_expr(Expr *expr, Oid result_type, int32 result_typmod, Oid result_collation)
#define ece_evaluate_expr(node)
static bool max_parallel_hazard_checker(Oid func_id, void *context)
static bool max_parallel_hazard_test(char proparallel, max_parallel_hazard_context *context)
bool contain_agg_clause(Node *clause)
static Node * substitute_actual_srf_parameters_mutator(Node *node, substitute_actual_srf_parameters_context *context)
static bool contain_agg_clause_walker(Node *node, void *context)
static bool contain_nonstrict_functions_checker(Oid func_id, void *context)
int NumRelids(PlannerInfo *root, Node *clause)
bool contain_mutable_functions(Node *clause)
bool is_pseudo_constant_clause(Node *clause)
static bool max_parallel_hazard_walker(Node *node, max_parallel_hazard_context *context)
bool contain_window_function(Node *clause)
#define ece_generic_processing(node)
static Expr * evaluate_function(Oid funcid, Oid result_type, int32 result_typmod, Oid result_collid, Oid input_collid, List *args, bool funcvariadic, HeapTuple func_tuple, eval_const_expressions_context *context)
static Node * substitute_actual_parameters_mutator(Node *node, substitute_actual_parameters_context *context)
static bool contain_mutable_functions_checker(Oid func_id, void *context)
bool is_pseudo_constant_clause_relids(Node *clause, Relids relids)
List * expand_function_arguments(List *args, bool include_out_arguments, Oid result_type, HeapTuple func_tuple)
static Query * substitute_actual_srf_parameters(Query *expr, int nargs, List *args)
Var * find_forced_null_var(Node *node)
static bool ece_function_is_safe(Oid funcid, eval_const_expressions_context *context)
static bool contain_volatile_functions_checker(Oid func_id, void *context)
static List * simplify_and_arguments(List *args, eval_const_expressions_context *context, bool *haveNull, bool *forceFalse)
List * find_forced_null_vars(Node *node)
static Expr * simplify_function(Oid funcid, Oid result_type, int32 result_typmod, Oid result_collid, Oid input_collid, List **args_p, bool funcvariadic, bool process_args, bool allow_non_const, eval_const_expressions_context *context)
bool contain_volatile_functions_after_planning(Expr *expr)
static Expr * inline_function(Oid funcid, Oid result_type, Oid result_collid, Oid input_collid, List *args, bool funcvariadic, HeapTuple func_tuple, eval_const_expressions_context *context)
static List * reorder_function_arguments(List *args, int pronargs, HeapTuple func_tuple)
static Node * substitute_actual_parameters(Node *expr, int nargs, List *args, int *usecounts)
static bool contain_mutable_functions_walker(Node *node, void *context)
Query * inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
bool contain_mutable_functions_after_planning(Expr *expr)
static bool contain_volatile_functions_walker(Node *node, void *context)
bool contain_leaked_vars(Node *clause)
static Relids find_nonnullable_rels_walker(Node *node, bool top_level)
Bitmapset * pull_paramids(Expr *expr)
void convert_saop_to_hashed_saop(Node *node)
static void sql_inline_error_callback(void *arg)
static bool contain_volatile_functions_not_nextval_walker(Node *node, void *context)
static bool contain_leaked_vars_walker(Node *node, void *context)
static bool contain_non_const_walker(Node *node, void *context)
static bool contain_context_dependent_node(Node *clause)
Relids find_nonnullable_rels(Node *clause)
static void recheck_cast_function_args(List *args, Oid result_type, Oid *proargtypes, int pronargs, HeapTuple func_tuple)
static bool find_window_functions_walker(Node *node, WindowFuncLists *lists)
List * find_nonnullable_vars(Node *clause)
char max_parallel_hazard(Query *parse)
bool is_parallel_safe(PlannerInfo *root, Node *node)
bool contain_nonstrict_functions(Node *clause)
static bool contain_volatile_functions_not_nextval_checker(Oid func_id, void *context)
static List * find_nonnullable_vars_walker(Node *node, bool top_level)
Node * eval_const_expressions(PlannerInfo *root, Node *node)
bool contain_subplans(Node *clause)
static Node * simplify_boolean_equality(Oid opno, List *args)
static bool contain_exec_param_walker(Node *node, List *param_ids)
void CommuteOpExpr(OpExpr *clause)
static Node * eval_const_expressions_mutator(Node *node, eval_const_expressions_context *context)
static bool pull_paramids_walker(Node *node, Bitmapset **context)
static bool convert_saop_to_hashed_saop_walker(Node *node, void *context)
static List * fetch_function_defaults(HeapTuple func_tuple)
bool contain_volatile_functions(Node *clause)
double expression_returns_set_rows(PlannerInfo *root, Node *clause)
static bool contain_context_dependent_node_walker(Node *node, int *flags)
bool contain_exec_param(Node *clause, List *param_ids)
#define MIN_ARRAY_SIZE_FOR_HASHED_SAOP
Node * estimate_expression_value(PlannerInfo *root, Node *node)
void cost_qual_eval(QualCost *cost, List *quals, PlannerInfo *root)
double clamp_row_est(double nrows)
Datum datumCopy(Datum value, bool typByVal, int typLen)
static void PGresult * res
int internalerrquery(const char *query)
int internalerrposition(int cursorpos)
ErrorContextCallback * error_context_stack
int errposition(int cursorpos)
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
EState * CreateExecutorState(void)
void FreeExecutorState(EState *estate)
#define GetPerTupleExprContext(estate)
static Datum ExecEvalExprSwitchContext(ExprState *state, ExprContext *econtext, bool *isNull)
#define OidFunctionCall1(functionId, arg1)
#define PG_DETOAST_DATUM_COPY(datum)
#define FmgrHookIsNeeded(fn_oid)
TypeFuncClass get_expr_result_type(Node *expr, Oid *resultTypeId, TupleDesc *resultTupleDesc)
@ TYPEFUNC_COMPOSITE_DOMAIN
void sql_fn_parser_setup(struct ParseState *pstate, SQLFunctionParseInfoPtr pinfo)
bool check_sql_fn_retval(List *queryTreeLists, Oid rettype, TupleDesc rettupdesc, char prokind, bool insertDroppedCols, List **resultTargetList)