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",
296 if (expr->funcretset)
404 foreach(lc, ctor->
args)
428 if (cnst->constisnull)
680 return (func_id != F_NEXTVAL &&
737 context.max_hazard = PROPARALLEL_SAFE;
738 context.max_interesting = PROPARALLEL_UNSAFE;
764 if (
root->glob->maxParallelHazard == PROPARALLEL_SAFE &&
765 root->glob->paramExecTypes ==
NIL)
768 context.max_hazard = PROPARALLEL_SAFE;
769 context.max_interesting = PROPARALLEL_RESTRICTED;
777 for (proot =
root; proot != NULL; proot = proot->parent_root)
797 case PROPARALLEL_SAFE:
800 case PROPARALLEL_RESTRICTED:
803 context->max_hazard = proparallel;
805 if (
context->max_interesting == proparallel)
808 case PROPARALLEL_UNSAFE:
809 context->max_hazard = proparallel;
813 elog(
ERROR,
"unrecognized proparallel value \"%c\"", proparallel);
904 List *save_safe_param_ids;
909 save_safe_param_ids =
context->safe_param_ids;
915 context->safe_param_ids = save_safe_param_ids;
958 context->max_hazard = PROPARALLEL_UNSAFE;
1185 #define CCDN_CASETESTEXPR_OK 0x0001
1205 int save_flags = *flags;
1220 *flags = save_flags;
1235 save_flags = *flags;
1239 *flags = save_flags;
1287 case T_NamedArgExpr:
1292 case T_CaseTestExpr:
1294 case T_SQLValueFunction:
1297 case T_NextValueExpr:
1308 case T_DistinctExpr:
1310 case T_ScalarArrayOpExpr:
1312 case T_ArrayCoerceExpr:
1324 case T_SubscriptingRef:
1344 case T_RowCompareExpr:
1357 larg, rcexpr->
largs,
1358 rarg, rcexpr->
rargs)
1400 case T_CurrentOfExpr:
1486 foreach(l, (
List *) node)
1545 foreach(l, expr->
args)
1739 foreach(l, (
List *) node)
1803 foreach(l, expr->
args)
1938 foreach(l, (
List *) node)
2034 if (expr->
useOr && falseOK)
2039 if (rightop &&
IsA(rightop,
Const))
2041 Datum arraydatum = ((
Const *) rightop)->constvalue;
2042 bool arrayisnull = ((
Const *) rightop)->constisnull;
2057 if (arrayexpr->
elements !=
NIL && !arrayexpr->multidims)
2154 elog(
ERROR,
"cannot commute non-binary-operator clause");
2159 elog(
ERROR,
"could not find commutator for operator %u",
2165 clause->
opno = opoid;
2186 Oid expectedtype,
int32 expectedtypmod,
2187 Oid expectedcollation)
2193 if (rowtypeid == RECORDOID)
2196 if (fieldnum <= 0 || fieldnum > tupdesc->
natts)
2202 if (attr->attisdropped ||
2203 attr->atttypid != expectedtype ||
2204 attr->atttypmod != expectedtypmod ||
2205 attr->attcollation != expectedcollation)
2268 #define MIN_ARRAY_SIZE_FOR_HASHED_SAOP 9
2304 if (arrayarg &&
IsA(arrayarg,
Const) &&
2305 !((
Const *) arrayarg)->constisnull)
2310 lefthashfunc == righthashfunc)
2312 Datum arrdatum = ((
Const *) arrayarg)->constvalue;
2326 saop->hashfuncid = lefthashfunc;
2342 lefthashfunc == righthashfunc)
2344 Datum arrdatum = ((
Const *) arrayarg)->constvalue;
2358 saop->hashfuncid = lefthashfunc;
2416 #define ece_generic_processing(node) \
2417 expression_tree_mutator((Node *) (node), eval_const_expressions_mutator, \
2425 #define ece_all_arguments_const(node) \
2426 (!expression_tree_walker((Node *) (node), contain_non_const_walker, NULL))
2429 #define ece_evaluate_expr(node) \
2430 ((Node *) evaluate_expr((Expr *) (node), \
2431 exprType((Node *) (node)), \
2432 exprTypmod((Node *) (node)), \
2433 exprCollation((Node *) (node))))
2500 &typLen, &typByVal);
2501 if (prm->
isnull || typByVal)
2513 return (
Node *) con;
2542 elog(
ERROR,
"cache lookup failed for function %u", funcid);
2545 false, expr->wintype,
2556 aggfilter = (
Expr *)
2563 newexpr->wintype = expr->wintype;
2564 newexpr->wincollid = expr->wincollid;
2565 newexpr->inputcollid = expr->inputcollid;
2568 newexpr->runCondition = expr->runCondition;
2570 newexpr->winstar = expr->winstar;
2571 newexpr->winagg = expr->winagg;
2574 return (
Node *) newexpr;
2591 expr->funcresulttype,
2601 return (
Node *) simple;
2611 newexpr->funcresulttype = expr->funcresulttype;
2612 newexpr->funcretset = expr->funcretset;
2613 newexpr->funcvariadic = expr->funcvariadic;
2614 newexpr->funcformat = expr->funcformat;
2615 newexpr->funccollid = expr->funccollid;
2616 newexpr->inputcollid = expr->inputcollid;
2619 return (
Node *) newexpr;
2639 expr->opresulttype, -1,
2648 return (
Node *) simple;
2655 if (expr->
opno == BooleanEqualOperator ||
2656 expr->
opno == BooleanNotEqualOperator)
2661 return (
Node *) simple;
2671 newexpr->opfuncid = expr->opfuncid;
2672 newexpr->opresulttype = expr->opresulttype;
2673 newexpr->opretset = expr->opretset;
2674 newexpr->opcollid = expr->opcollid;
2675 newexpr->inputcollid = expr->inputcollid;
2678 return (
Node *) newexpr;
2680 case T_DistinctExpr:
2685 bool has_null_input =
false;
2686 bool all_null_input =
true;
2687 bool has_nonconst_input =
false;
2714 has_nonconst_input =
true;
2718 if (!has_nonconst_input)
2743 expr->opresulttype, -1,
2759 csimple->constvalue =
2761 return (
Node *) csimple;
2772 newexpr->opfuncid = expr->opfuncid;
2773 newexpr->opresulttype = expr->opresulttype;
2774 newexpr->opretset = expr->opretset;
2775 newexpr->opcollid = expr->opcollid;
2776 newexpr->inputcollid = expr->inputcollid;
2779 return (
Node *) newexpr;
2785 bool has_nonconst_input =
false;
2794 has_nonconst_input =
true;
2805 if (!has_nonconst_input &&
2809 return (
Node *) expr;
2811 case T_ScalarArrayOpExpr:
2828 return (
Node *) saop;
2839 bool haveNull =
false;
2840 bool forceTrue =
false;
2867 bool haveNull =
false;
2868 bool forceFalse =
false;
2914 case T_JsonValueExpr:
2928 if (formatted_expr &&
IsA(formatted_expr,
Const))
2929 return formatted_expr;
2934 (
Expr *) formatted_expr,
2939 case T_AlternativeSubPlan:
2959 relabel->resulttypmod,
2960 relabel->resultcollid,
2961 relabel->relabelformat,
2970 bool outtypisvarlena;
2989 &outfunc, &outtypisvarlena);
2991 &infunc, &intypioparam);
3035 return (
Node *) simple;
3046 newexpr->resultcollid = expr->resultcollid;
3047 newexpr->coerceformat = expr->coerceformat;
3049 return (
Node *) newexpr;
3051 case T_ArrayCoerceExpr:
3054 Node *save_case_val;
3070 save_case_val =
context->case_val;
3077 context->case_val = save_case_val;
3152 Node *save_case_val;
3155 bool const_true_cond;
3156 Node *defresult = NULL;
3164 save_case_val =
context->case_val;
3175 const_true_cond =
false;
3191 if (casecond &&
IsA(casecond,
Const))
3195 if (const_input->constisnull ||
3199 const_true_cond =
true;
3207 if (!const_true_cond)
3211 newcasewhen->
expr = (
Expr *) casecond;
3214 newargs =
lappend(newargs, newcasewhen);
3223 defresult = caseresult;
3228 if (!const_true_cond)
3232 context->case_val = save_case_val;
3242 newcase->casetype = caseexpr->casetype;
3243 newcase->casecollid = caseexpr->casecollid;
3244 newcase->
arg = (
Expr *) newarg;
3245 newcase->
args = newargs;
3248 return (
Node *) newcase;
3250 case T_CaseTestExpr:
3262 case T_SubscriptingRef:
3289 case T_CoalesceExpr:
3297 foreach(
arg, coalesceexpr->
args)
3314 if (((
Const *)
e)->constisnull)
3331 coalesceexpr->coalescecollid);
3334 newcoalesce->coalescetype = coalesceexpr->coalescetype;
3335 newcoalesce->coalescecollid = coalesceexpr->coalescecollid;
3336 newcoalesce->
args = newargs;
3338 return (
Node *) newcoalesce;
3340 case T_SQLValueFunction:
3391 ((
Var *)
arg)->varlevelsup == 0)
3395 fselect->resulttype,
3396 fselect->resulttypmod,
3397 fselect->resultcollid))
3403 fselect->resulttype,
3404 fselect->resulttypmod,
3405 fselect->resultcollid,
3406 ((
Var *)
arg)->varlevelsup);
3408 newvar->varnullingrels = ((
Var *)
arg)->varnullingrels;
3409 return (
Node *) newvar;
3424 fselect->resulttype,
3425 fselect->resulttypmod,
3426 fselect->resultcollid) &&
3427 fselect->resulttype ==
exprType(fld) &&
3436 newfselect->resulttype = fselect->resulttype;
3437 newfselect->resulttypmod = fselect->resulttypmod;
3438 newfselect->resultcollid = fselect->resultcollid;
3445 newfselect->resulttype,
3446 newfselect->resulttypmod,
3447 newfselect->resultcollid))
3450 return (
Node *) newfselect;
3472 foreach(l, rarg->
args)
3484 if (carg->constisnull ?
3498 newntest->
arg = (
Expr *) relem;
3500 newntest->argisrow =
false;
3502 newargs =
lappend(newargs, newntest);
3521 result = carg->constisnull;
3524 result = !carg->constisnull;
3527 elog(
ERROR,
"unrecognized nulltesttype: %d",
3539 newntest->argisrow = ntest->argisrow;
3541 return (
Node *) newntest;
3566 result = (!carg->constisnull &&
3570 result = (carg->constisnull ||
3574 result = (!carg->constisnull &&
3578 result = (carg->constisnull ||
3582 result = carg->constisnull;
3585 result = !carg->constisnull;
3588 elog(
ERROR,
"unrecognized booltesttype: %d",
3601 return (
Node *) newbtest;
3603 case T_CoerceToDomain:
3632 cdomain->resulttypmod,
3633 cdomain->resultcollid,
3634 cdomain->coercionformat,
3642 newcdomain->resulttypmod = cdomain->resulttypmod;
3643 newcdomain->resultcollid = cdomain->resultcollid;
3644 newcdomain->coercionformat = cdomain->coercionformat;
3646 return (
Node *) newcdomain;
3648 case T_PlaceHolderVar:
3665 case T_ConvertRowtypeExpr:
3676 newcre->convertformat = cre->convertformat;
3702 newcre->convertformat = argcre->convertformat;
3709 return (
Node *) newcre;
3762 if (provolatile == PROVOLATILE_IMMUTABLE)
3764 if (
context->estimate && provolatile == PROVOLATILE_STABLE)
3791 bool *haveNull,
bool *forceTrue)
3794 List *unprocessed_args;
3808 while (unprocessed_args)
3818 List *oldlist = unprocessed_args;
3851 if (const_input->constisnull)
3897 bool *haveNull,
bool *forceFalse)
3900 List *unprocessed_args;
3904 while (unprocessed_args)
3914 List *oldlist = unprocessed_args;
3947 if (const_input->constisnull)
4000 if (opno == BooleanEqualOperator)
4015 if (rightop &&
IsA(rightop,
Const))
4018 if (opno == BooleanEqualOperator)
4059 Oid result_collid,
Oid input_collid,
List **args_p,
4060 bool funcvariadic,
bool process_args,
bool allow_non_const,
4082 elog(
ERROR,
"cache lookup failed for function %u", funcid);
4104 result_collid, input_collid,
4108 if (!newexpr && allow_non_const &&
OidIsValid(func_form->prosupport))
4120 fexpr.
xpr.type = T_FuncExpr;
4122 fexpr.funcresulttype = result_type;
4123 fexpr.funcretset = func_form->proretset;
4124 fexpr.funcvariadic = funcvariadic;
4126 fexpr.funccollid = result_collid;
4127 fexpr.inputcollid = input_collid;
4131 req.
type = T_SupportRequestSimplify;
4143 if (!newexpr && allow_non_const)
4145 input_collid,
args, funcvariadic,
4178 Oid *proargtypes = funcform->proargtypes.values;
4180 bool has_named_args =
false;
4191 if (include_out_arguments)
4193 Datum proallargtypes;
4197 Anum_pg_proc_proallargtypes,
4208 elog(
ERROR,
"proallargtypes is not a 1-D Oid array or it contains nulls");
4221 has_named_args =
true;
4265 elog(
ERROR,
"too many function arguments");
4278 argarray[
i++] =
arg;
4298 i =
pronargs - funcform->pronargdefaults;
4299 foreach(lc, defaults)
4301 if (argarray[
i] == NULL)
4337 elog(
ERROR,
"not enough default arguments");
4352 Datum proargdefaults;
4356 Anum_pg_proc_proargdefaults);
4391 elog(
ERROR,
"too many function arguments");
4398 memcpy(declared_arg_types, proargtypes,
pronargs *
sizeof(
Oid));
4402 funcform->prorettype,
4405 if (rettype != result_type)
4406 elog(
ERROR,
"function's resolved result type changed during planning");
4431 bool has_nonconst_input =
false;
4432 bool has_null_input =
false;
4439 if (funcform->proretset)
4452 if (funcform->prorettype == RECORDOID)
4463 has_nonconst_input =
true;
4472 if (funcform->proisstrict && has_null_input)
4481 if (has_nonconst_input)
4491 if (funcform->provolatile == PROVOLATILE_IMMUTABLE)
4493 else if (
context->estimate && funcform->provolatile == PROVOLATILE_STABLE)
4504 newexpr->
funcid = funcid;
4505 newexpr->funcresulttype = result_type;
4506 newexpr->funcretset =
false;
4507 newexpr->funcvariadic = funcvariadic;
4509 newexpr->funccollid = result_collid;
4510 newexpr->inputcollid = input_collid;
4568 List *raw_parsetree_list;
4569 List *querytree_list;
4580 if (funcform->prolang != SQLlanguageId ||
4581 funcform->prokind != PROKIND_FUNCTION ||
4582 funcform->prosecdef ||
4583 funcform->proretset ||
4584 funcform->prorettype == RECORDOID ||
4617 fexpr->funcresulttype = result_type;
4618 fexpr->funcretset =
false;
4619 fexpr->funcvariadic = funcvariadic;
4621 fexpr->funccollid = result_collid;
4622 fexpr->inputcollid = input_collid;
4635 callback_arg.
prosrc = src;
4638 sqlerrcontext.
arg = &callback_arg;
4645 Anum_pg_proc_prosqlbody,
4740 result_type, rettupdesc,
4763 if (
exprType(newexpr) != result_type)
4774 if (funcform->provolatile == PROVOLATILE_IMMUTABLE &&
4777 else if (funcform->provolatile == PROVOLATILE_STABLE &&
4781 if (funcform->proisstrict &&
4798 usecounts = (
int *)
palloc0(funcform->pronargs *
sizeof(
int));
4808 if (usecounts[
i] == 0)
4811 if (funcform->proisstrict)
4814 else if (usecounts[
i] != 1)
4862 if (
OidIsValid(exprcoll) && exprcoll != result_collid)
4866 newnode->
arg = (
Expr *) newexpr;
4867 newnode->
collOid = result_collid;
4870 newexpr = (
Node *) newnode;
4891 return (
Expr *) newexpr;
4913 context.usecounts = usecounts;
4950 int syntaxerrposition;
4954 if (syntaxerrposition > 0)
4972 Oid result_collation)
4980 bool resultTypByVal;
5027 if (resultTypLen == -1)
5030 const_val =
datumCopy(const_val, resultTypByVal, resultTypLen);
5039 return (
Expr *)
makeConst(result_type, result_typmod, result_collation,
5041 const_val, const_is_null,
5080 List *raw_parsetree_list;
5081 List *querytree_list;
5107 func_oid = fexpr->
funcid;
5114 if (!fexpr->funcretset)
5143 elog(
ERROR,
"cache lookup failed for function %u", func_oid);
5156 if (funcform->prolang != SQLlanguageId ||
5157 funcform->prokind != PROKIND_FUNCTION ||
5158 funcform->proisstrict ||
5159 funcform->provolatile == PROVOLATILE_VOLATILE ||
5160 funcform->prorettype == VOIDOID ||
5161 funcform->prosecdef ||
5162 !funcform->proretset ||
5175 "inline_set_returning_function",
5188 callback_arg.
prosrc = src;
5191 sqlerrcontext.
arg = &callback_arg;
5198 Anum_pg_proc_prosqlbody,
5229 fexpr->inputcollid);
5254 if (rtfunc->funccolnames !=
NIL)
5258 rtfunc->funccoltypes,
5259 rtfunc->funccoltypmods,
5260 rtfunc->funccolcollations);
5286 fexpr->funcresulttype, rettupdesc,
5335 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)