88 #ifdef HAVE_COMPUTED_GOTO
89 #define EEO_USE_COMPUTED_GOTO
102 #if defined(EEO_USE_COMPUTED_GOTO)
105 typedef struct ExprEvalOpLookup
112 static const void **dispatch_table = NULL;
115 static ExprEvalOpLookup reverse_dispatch_table[
EEOP_LAST];
118 #define EEO_CASE(name) CASE_##name:
119 #define EEO_DISPATCH() goto *((void *) op->opcode)
120 #define EEO_OPCODE(opcode) ((intptr_t) dispatch_table[opcode])
124 #define EEO_SWITCH() starteval: switch ((ExprEvalOp) op->opcode)
125 #define EEO_CASE(name) case name:
126 #define EEO_DISPATCH() goto starteval
127 #define EEO_OPCODE(opcode) (opcode)
137 #define EEO_JUMP(stepno) \
139 op = &state->steps[stepno]; \
195 #define SH_PREFIX saophash
196 #define SH_ELEMENT_TYPE ScalarArrayOpExprHashEntry
197 #define SH_KEY_TYPE Datum
198 #define SH_SCOPE static inline
219 #define SH_PREFIX saophash
220 #define SH_ELEMENT_TYPE ScalarArrayOpExprHashEntry
221 #define SH_KEY_TYPE Datum
223 #define SH_HASH_KEY(tb, key) saop_element_hash(tb, key)
224 #define SH_EQUAL(tb, a, b) saop_hash_element_match(tb, a, b)
225 #define SH_SCOPE static inline
226 #define SH_STORE_HASH
227 #define SH_GET_HASH(tb, a) a->hash
275 if (
state->steps_len == 3)
318 state->steps[0].d.casetest.value)
324 else if (
state->steps_len == 2)
365 #if defined(EEO_USE_COMPUTED_GOTO)
371 for (
int off = 0; off <
state->steps_len; off++)
406 #if defined(EEO_USE_COMPUTED_GOTO)
407 static const void *
const dispatch_table[] = {
409 &&CASE_EEOP_INNER_FETCHSOME,
410 &&CASE_EEOP_OUTER_FETCHSOME,
411 &&CASE_EEOP_SCAN_FETCHSOME,
412 &&CASE_EEOP_INNER_VAR,
413 &&CASE_EEOP_OUTER_VAR,
414 &&CASE_EEOP_SCAN_VAR,
415 &&CASE_EEOP_INNER_SYSVAR,
416 &&CASE_EEOP_OUTER_SYSVAR,
417 &&CASE_EEOP_SCAN_SYSVAR,
418 &&CASE_EEOP_WHOLEROW,
419 &&CASE_EEOP_ASSIGN_INNER_VAR,
420 &&CASE_EEOP_ASSIGN_OUTER_VAR,
421 &&CASE_EEOP_ASSIGN_SCAN_VAR,
422 &&CASE_EEOP_ASSIGN_TMP,
423 &&CASE_EEOP_ASSIGN_TMP_MAKE_RO,
425 &&CASE_EEOP_FUNCEXPR,
426 &&CASE_EEOP_FUNCEXPR_STRICT,
427 &&CASE_EEOP_FUNCEXPR_FUSAGE,
428 &&CASE_EEOP_FUNCEXPR_STRICT_FUSAGE,
429 &&CASE_EEOP_BOOL_AND_STEP_FIRST,
430 &&CASE_EEOP_BOOL_AND_STEP,
431 &&CASE_EEOP_BOOL_AND_STEP_LAST,
432 &&CASE_EEOP_BOOL_OR_STEP_FIRST,
433 &&CASE_EEOP_BOOL_OR_STEP,
434 &&CASE_EEOP_BOOL_OR_STEP_LAST,
435 &&CASE_EEOP_BOOL_NOT_STEP,
438 &&CASE_EEOP_JUMP_IF_NULL,
439 &&CASE_EEOP_JUMP_IF_NOT_NULL,
440 &&CASE_EEOP_JUMP_IF_NOT_TRUE,
441 &&CASE_EEOP_NULLTEST_ISNULL,
442 &&CASE_EEOP_NULLTEST_ISNOTNULL,
443 &&CASE_EEOP_NULLTEST_ROWISNULL,
444 &&CASE_EEOP_NULLTEST_ROWISNOTNULL,
445 &&CASE_EEOP_BOOLTEST_IS_TRUE,
446 &&CASE_EEOP_BOOLTEST_IS_NOT_TRUE,
447 &&CASE_EEOP_BOOLTEST_IS_FALSE,
448 &&CASE_EEOP_BOOLTEST_IS_NOT_FALSE,
449 &&CASE_EEOP_PARAM_EXEC,
450 &&CASE_EEOP_PARAM_EXTERN,
451 &&CASE_EEOP_PARAM_CALLBACK,
452 &&CASE_EEOP_CASE_TESTVAL,
453 &&CASE_EEOP_MAKE_READONLY,
454 &&CASE_EEOP_IOCOERCE,
455 &&CASE_EEOP_IOCOERCE_SAFE,
456 &&CASE_EEOP_DISTINCT,
457 &&CASE_EEOP_NOT_DISTINCT,
459 &&CASE_EEOP_SQLVALUEFUNCTION,
460 &&CASE_EEOP_CURRENTOFEXPR,
461 &&CASE_EEOP_NEXTVALUEEXPR,
462 &&CASE_EEOP_ARRAYEXPR,
463 &&CASE_EEOP_ARRAYCOERCE,
465 &&CASE_EEOP_ROWCOMPARE_STEP,
466 &&CASE_EEOP_ROWCOMPARE_FINAL,
468 &&CASE_EEOP_FIELDSELECT,
469 &&CASE_EEOP_FIELDSTORE_DEFORM,
470 &&CASE_EEOP_FIELDSTORE_FORM,
471 &&CASE_EEOP_SBSREF_SUBSCRIPTS,
472 &&CASE_EEOP_SBSREF_OLD,
473 &&CASE_EEOP_SBSREF_ASSIGN,
474 &&CASE_EEOP_SBSREF_FETCH,
475 &&CASE_EEOP_DOMAIN_TESTVAL,
476 &&CASE_EEOP_DOMAIN_NOTNULL,
477 &&CASE_EEOP_DOMAIN_CHECK,
478 &&CASE_EEOP_CONVERT_ROWTYPE,
479 &&CASE_EEOP_SCALARARRAYOP,
480 &&CASE_EEOP_HASHED_SCALARARRAYOP,
482 &&CASE_EEOP_JSON_CONSTRUCTOR,
485 &&CASE_EEOP_GROUPING_FUNC,
486 &&CASE_EEOP_WINDOW_FUNC,
487 &&CASE_EEOP_MERGE_SUPPORT_FUNC,
489 &&CASE_EEOP_AGG_STRICT_DESERIALIZE,
490 &&CASE_EEOP_AGG_DESERIALIZE,
491 &&CASE_EEOP_AGG_STRICT_INPUT_CHECK_ARGS,
492 &&CASE_EEOP_AGG_STRICT_INPUT_CHECK_NULLS,
493 &&CASE_EEOP_AGG_PLAIN_PERGROUP_NULLCHECK,
494 &&CASE_EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL,
495 &&CASE_EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL,
496 &&CASE_EEOP_AGG_PLAIN_TRANS_BYVAL,
497 &&CASE_EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF,
498 &&CASE_EEOP_AGG_PLAIN_TRANS_STRICT_BYREF,
499 &&CASE_EEOP_AGG_PLAIN_TRANS_BYREF,
500 &&CASE_EEOP_AGG_PRESORTED_DISTINCT_SINGLE,
501 &&CASE_EEOP_AGG_PRESORTED_DISTINCT_MULTI,
502 &&CASE_EEOP_AGG_ORDERED_TRANS_DATUM,
503 &&CASE_EEOP_AGG_ORDERED_TRANS_TUPLE,
508 "dispatch_table out of whack with ExprEvalOp");
518 resultslot =
state->resultslot;
523 #if defined(EEO_USE_COMPUTED_GOTO)
633 int attnum =
op->d.assign_var.attnum;
640 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
650 int attnum =
op->d.assign_var.attnum;
657 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
667 int attnum =
op->d.assign_var.attnum;
674 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
685 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
696 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
709 *
op->resnull =
op->d.constval.isnull;
710 *
op->resvalue =
op->d.constval.value;
736 d =
op->d.func.fn_addr(fcinfo);
751 for (
int argno = 0; argno <
nargs; argno++)
760 d =
op->d.func.fn_addr(fcinfo);
796 *
op->d.boolexpr.anynull =
false;
810 *
op->d.boolexpr.anynull =
true;
838 else if (*
op->d.boolexpr.anynull)
863 *
op->d.boolexpr.anynull =
false;
877 *
op->d.boolexpr.anynull =
true;
905 else if (*
op->d.boolexpr.anynull)
940 *
op->resnull =
false;
989 *
op->resnull =
false;
997 *
op->resnull =
false;
1025 *
op->resnull =
false;
1037 *
op->resnull =
false;
1050 *
op->resnull =
false;
1063 *
op->resnull =
false;
1088 op->d.cparam.paramfunc(
state,
op, econtext);
1103 if (
op->d.casetest.value)
1105 *
op->resvalue = *
op->d.casetest.value;
1106 *
op->resnull = *
op->d.casetest.isnull;
1122 if (
op->d.casetest.value)
1124 *
op->resvalue = *
op->d.casetest.value;
1125 *
op->resnull = *
op->d.casetest.isnull;
1141 if (!*
op->d.make_readonly.isnull)
1144 *
op->resnull = *
op->d.make_readonly.isnull;
1171 fcinfo_out =
op->d.iocoerce.fcinfo_data_out;
1175 fcinfo_out->
isnull =
false;
1183 if (!
op->d.iocoerce.finfo_in->fn_strict ||
str != NULL)
1188 fcinfo_in =
op->d.iocoerce.fcinfo_data_in;
1193 fcinfo_in->
isnull =
false;
1237 *
op->resnull =
false;
1243 *
op->resnull =
false;
1251 eqresult =
op->d.func.fn_addr(fcinfo);
1268 *
op->resnull =
false;
1273 *
op->resnull =
false;
1280 eqresult =
op->d.func.fn_addr(fcinfo);
1281 *
op->resvalue = eqresult;
1301 result =
op->d.func.fn_addr(fcinfo);
1307 *
op->resnull =
true;
1380 if (
op->d.rowcompare_step.finfo->fn_strict &&
1383 *
op->resnull =
true;
1389 d =
op->d.rowcompare_step.fn_addr(fcinfo);
1395 *
op->resnull =
true;
1398 *
op->resnull =
false;
1414 *
op->resnull =
false;
1473 if (
op->d.sbsref_subscript.subscriptfunc(
state,
op, econtext))
1489 op->d.sbsref.subscriptfunc(
state,
op, econtext);
1563 int aggno =
op->d.aggref.aggno;
1616 if (
op->d.agg_deserialize.fcinfo_data->args[0].isnull)
1650 int nargs =
op->d.agg_strict_input_check.nargs;
1652 for (
int argno = 0; argno <
nargs; argno++)
1655 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
1662 bool *
nulls =
op->d.agg_strict_input_check.nulls;
1663 int nargs =
op->d.agg_strict_input_check.nargs;
1665 for (
int argno = 0; argno <
nargs; argno++)
1668 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
1683 if (pergroup_allaggs == NULL)
1684 EEO_JUMP(
op->d.agg_plain_pergroup_nullcheck.jumpnull);
1714 op->d.agg_trans.aggcontext);
1721 op->d.agg_trans.aggcontext,
1722 op->d.agg_trans.setno);
1740 op->d.agg_trans.aggcontext,
1741 op->d.agg_trans.setno);
1757 op->d.agg_trans.aggcontext,
1758 op->d.agg_trans.setno);
1775 op->d.agg_trans.aggcontext);
1778 op->d.agg_trans.aggcontext,
1779 op->d.agg_trans.setno);
1796 op->d.agg_trans.aggcontext,
1797 op->d.agg_trans.setno);
1812 op->d.agg_trans.aggcontext,
1813 op->d.agg_trans.setno);
1826 EEO_JUMP(
op->d.agg_presorted_distinctcheck.jumpdistinct);
1837 EEO_JUMP(
op->d.agg_presorted_distinctcheck.jumpdistinct);
1868 return state->resvalue;
1889 return state->evalfunc(
state, econtext, isNull);
1907 for (
int i = 0;
i <
state->steps_len;
i++)
1973 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
1978 if (attr->attisdropped)
1980 (
errcode(ERRCODE_UNDEFINED_COLUMN),
1981 errmsg(
"attribute %d of type %s has been dropped",
1984 if (
vartype != attr->atttypid)
1986 (
errcode(ERRCODE_DATATYPE_MISMATCH),
1987 errmsg(
"attribute %d of type %s has wrong type",
1989 errdetail(
"Table has type %s, but query expects %s.",
2001 #ifdef USE_ASSERT_CHECKING
2003 if (!
op->d.fetch.fixed)
2050 if (type_id != RECORDOID)
2066 if (typentry->
tupDesc == NULL)
2068 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
2069 errmsg(
"type %s is not composite",
2153 int attnum =
op->d.assign_var.attnum + 1;
2168 Assert(
resultnum >= 0 && resultnum < outslot->tts_tupleDescriptor->natts);
2209 *
op->resvalue = *
op->d.casetest.value;
2210 *
op->resnull = *
op->d.casetest.isnull;
2215 fcinfo =
op->d.func.fcinfo_data;
2219 for (
int argno = 0; argno <
nargs; argno++)
2228 d =
op->d.func.fn_addr(fcinfo);
2240 return op->d.constval.value;
2291 int attnum =
op->d.assign_var.attnum;
2300 Assert(
resultnum >= 0 && resultnum < outslot->tts_tupleDescriptor->natts);
2329 #if defined(EEO_USE_COMPUTED_GOTO)
2335 dispatch_compare_ptr(
const void *
a,
const void *
b)
2337 const ExprEvalOpLookup *la = (
const ExprEvalOpLookup *)
a;
2338 const ExprEvalOpLookup *lb = (
const ExprEvalOpLookup *)
b;
2340 if (la->opcode < lb->opcode)
2342 else if (la->opcode > lb->opcode)
2354 #if defined(EEO_USE_COMPUTED_GOTO)
2356 if (dispatch_table == NULL)
2358 dispatch_table = (
const void **)
2364 reverse_dispatch_table[
i].opcode = dispatch_table[
i];
2369 qsort(reverse_dispatch_table,
2371 sizeof(ExprEvalOpLookup),
2372 dispatch_compare_ptr);
2386 #if defined(EEO_USE_COMPUTED_GOTO)
2389 ExprEvalOpLookup
key;
2390 ExprEvalOpLookup *
res;
2392 key.opcode = (
void *)
op->opcode;
2394 reverse_dispatch_table,
2396 sizeof(ExprEvalOpLookup),
2397 dispatch_compare_ptr);
2424 d =
op->d.func.fn_addr(fcinfo);
2446 for (
int argno = 0; argno <
nargs; argno++)
2450 *
op->resnull =
true;
2458 d =
op->d.func.fn_addr(fcinfo);
2497 int paramId =
op->d.param.paramid;
2500 paramId > 0 && paramId <= paramInfo->numParams))
2507 prm = paramInfo->
paramFetch(paramInfo, paramId,
false, &prmdata);
2509 prm = ¶mInfo->
params[paramId - 1];
2516 (
errcode(ERRCODE_DATATYPE_MISMATCH),
2517 errmsg(
"type of parameter %d (%s) does not match that when preparing the plan (%s)",
2528 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2529 errmsg(
"no value found for parameter %d", paramId)));
2555 fcinfo_out =
op->d.iocoerce.fcinfo_data_out;
2559 fcinfo_out->
isnull =
false;
2567 if (!
op->d.iocoerce.finfo_in->fn_strict ||
str != NULL)
2571 fcinfo_in =
op->d.iocoerce.fcinfo_data_in;
2579 fcinfo_in->
isnull =
false;
2584 *
op->resnull =
true;
2606 *
op->resnull =
false;
2638 *
op->resnull = fcinfo->isnull;
2643 *
op->resnull = fcinfo->isnull;
2648 *
op->resnull = fcinfo->isnull;
2653 *
op->resnull = fcinfo->isnull;
2671 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2672 errmsg(
"WHERE CURRENT OF is not supported for this table type")));
2683 switch (
op->d.nextvalueexpr.seqtypid)
2695 elog(
ERROR,
"unsupported sequence type %u",
2696 op->d.nextvalueexpr.seqtypid);
2698 *
op->resnull =
false;
2732 *
op->resnull =
false;
2764 &
op->d.nulltest_row.rowcache, NULL);
2772 for (
int att = 1; att <= tupDesc->
natts; att++)
2811 int nelems =
op->d.arrayexpr.nelems;
2817 *
op->resnull =
false;
2819 if (!
op->d.arrayexpr.multidims)
2822 Datum *dvalues =
op->d.arrayexpr.elemvalues;
2823 bool *dnulls =
op->d.arrayexpr.elemnulls;
2832 op->d.arrayexpr.elemlength,
2833 op->d.arrayexpr.elembyval,
2834 op->d.arrayexpr.elemalign);
2841 int outer_nelems = 0;
2843 int *elem_dims = NULL;
2844 int *elem_lbs = NULL;
2845 bool firstone =
true;
2846 bool havenulls =
false;
2847 bool haveempty =
false;
2862 for (
int elemoff = 0; elemoff <
nelems; elemoff++)
2869 arraydatum =
op->d.arrayexpr.elemvalues[elemoff];
2870 eisnull =
op->d.arrayexpr.elemnulls[elemoff];
2884 (
errcode(ERRCODE_DATATYPE_MISMATCH),
2885 errmsg(
"cannot merge incompatible arrays"),
2886 errdetail(
"Array with element type %s cannot be "
2887 "included in ARRAY construct with element type %s.",
2893 if (this_ndims <= 0)
2902 elem_ndims = this_ndims;
2903 ndims = elem_ndims + 1;
2904 if (ndims <= 0 || ndims >
MAXDIM)
2906 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
2907 errmsg(
"number of array dimensions (%d) exceeds the maximum allowed (%d)",
2910 elem_dims = (
int *)
palloc(elem_ndims *
sizeof(
int));
2911 memcpy(elem_dims,
ARR_DIMS(array), elem_ndims *
sizeof(
int));
2912 elem_lbs = (
int *)
palloc(elem_ndims *
sizeof(
int));
2913 memcpy(elem_lbs,
ARR_LBOUND(array), elem_ndims *
sizeof(
int));
2920 if (elem_ndims != this_ndims ||
2922 elem_ndims *
sizeof(
int)) != 0 ||
2924 elem_ndims *
sizeof(
int)) != 0)
2926 (
errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
2927 errmsg(
"multidimensional arrays must have array "
2928 "expressions with matching dimensions")));
2934 nbytes += subbytes[outer_nelems];
2938 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
2939 errmsg(
"array size exceeds the maximum allowed (%d)",
2961 (
errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
2962 errmsg(
"multidimensional arrays must have array "
2963 "expressions with matching dimensions")));
2967 dims[0] = outer_nelems;
2969 for (
int i = 1;
i < ndims;
i++)
2971 dims[
i] = elem_dims[
i - 1];
2972 lbs[
i] = elem_lbs[
i - 1];
2982 nbytes += dataoffset;
2992 result->
ndim = ndims;
2995 memcpy(
ARR_DIMS(result), dims, ndims *
sizeof(
int));
2996 memcpy(
ARR_LBOUND(result), lbs, ndims *
sizeof(
int));
3000 for (
int i = 0;
i < outer_nelems;
i++)
3002 memcpy(dat, subdata[
i], subbytes[
i]);
3008 iitem += subnitems[
i];
3029 arraydatum = *
op->resvalue;
3035 if (
op->d.arraycoerce.elemexprstate == NULL)
3049 op->d.arraycoerce.elemexprstate,
3051 op->d.arraycoerce.resultelemtype,
3052 op->d.arraycoerce.amstate);
3068 op->d.row.elemvalues,
3069 op->d.row.elemnulls);
3072 *
op->resnull =
false;
3085 bool *
nulls =
op->d.minmax.nulls;
3094 *
op->resnull =
true;
3096 for (
int off = 0; off <
op->d.minmax.nelems; off++)
3106 *
op->resnull =
false;
3121 if (cmpresult > 0 &&
operator ==
IS_LEAST)
3123 else if (cmpresult < 0 &&
operator ==
IS_GREATEST)
3150 tupDatum = *
op->resvalue;
3168 elog(
ERROR,
"unsupported reference to system column %d in FieldSelect",
3171 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
3176 if (attr->attisdropped)
3178 *
op->resnull =
true;
3184 if (
op->d.fieldselect.resulttype != attr->atttypid)
3186 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3188 errdetail(
"Table has type %s, but query expects %s.",
3206 &
op->d.fieldselect.rowcache, NULL);
3214 elog(
ERROR,
"unsupported reference to system column %d in FieldSelect",
3217 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
3222 if (attr->attisdropped)
3224 *
op->resnull =
true;
3230 if (
op->d.fieldselect.resulttype != attr->atttypid)
3232 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3234 errdetail(
"Table has type %s, but query expects %s.",
3265 memset(
op->d.fieldstore.nulls,
true,
3266 op->d.fieldstore.ncolumns *
sizeof(
bool));
3274 Datum tupDatum = *
op->resvalue;
3292 op->d.fieldstore.rowcache, NULL);
3296 elog(
ERROR,
"too many columns in composite type %u",
3297 op->d.fieldstore.fstore->resulttype);
3300 op->d.fieldstore.values,
3301 op->d.fieldstore.nulls);
3317 op->d.fieldstore.rowcache, NULL);
3320 op->d.fieldstore.values,
3321 op->d.fieldstore.nulls);
3324 *
op->resnull =
false;
3342 bool changed =
false;
3348 tupDatum = *
op->resvalue;
3357 op->d.convert_rowtype.incache,
3361 op->d.convert_rowtype.outcache,
3392 if (
op->d.convert_rowtype.map != NULL)
3432 bool useOr =
op->d.scalararrayop.useOr;
3433 bool strictfunc =
op->d.scalararrayop.finfo->fn_strict;
3465 *
op->resnull =
false;
3475 *
op->resnull =
true;
3486 &
op->d.scalararrayop.typlen,
3487 &
op->d.scalararrayop.typbyval,
3488 &
op->d.scalararrayop.typalign);
3492 typlen =
op->d.scalararrayop.typlen;
3511 if (bitmap && (*bitmap & bitmask) == 0)
3529 thisresult = (
Datum) 0;
3534 thisresult =
op->d.scalararrayop.fn_addr(fcinfo);
3563 if (bitmask == 0x100)
3571 *
op->resvalue = result;
3572 *
op->resnull = resultnull;
3588 fcinfo->args[0].value =
key;
3589 fcinfo->args[0].isnull =
false;
3608 fcinfo->args[0].value = key1;
3609 fcinfo->args[0].isnull =
false;
3610 fcinfo->args[1].value = key2;
3611 fcinfo->args[1].isnull =
false;
3636 bool inclause =
op->d.hashedscalararrayop.inclause;
3637 bool strictfunc =
op->d.hashedscalararrayop.finfo->fn_strict;
3653 *
op->resnull =
true;
3672 saop =
op->d.hashedscalararrayop.saop;
3717 if (bitmap && (*bitmap & bitmask) == 0)
3736 if (bitmask == 0x100)
3768 if (!hashfound &&
op->d.hashedscalararrayop.has_nulls)
3794 result =
op->d.hashedscalararrayop.finfo->fn_addr(fcinfo);
3795 resultnull = fcinfo->
isnull;
3806 *
op->resvalue = result;
3807 *
op->resnull = resultnull;
3818 (
errcode(ERRCODE_NOT_NULL_VIOLATION),
3819 errmsg(
"domain %s does not allow null values",
3830 if (!*
op->d.domaincheck.checknull &&
3833 (
errcode(ERRCODE_CHECK_VIOLATION),
3834 errmsg(
"value for domain %s violates check constraint \"%s\"",
3836 op->d.domaincheck.constraintname),
3838 op->d.domaincheck.constraintname)));
3853 *
op->resnull =
true;
3873 *
op->resnull =
false;
3881 bool *
argnull =
op->d.xmlexpr.named_argnull;
3903 *
op->resnull =
false;
3922 op->d.xmlexpr.named_argvalue,
3923 op->d.xmlexpr.named_argnull,
3924 op->d.xmlexpr.argvalue,
3925 op->d.xmlexpr.argnull));
3926 *
op->resnull =
false;
3934 bool preserve_whitespace;
3951 preserve_whitespace));
3952 *
op->resnull =
false;
4011 *
op->resnull =
false;
4031 *
op->resnull =
false;
4049 *
op->resnull =
false;
4054 elog(
ERROR,
"unrecognized XML operation");
4131 elog(
ERROR,
"invalid JsonConstructorExpr type %d", ctor->
type);
4133 *
op->resvalue =
res;
4156 if (exprtype == TEXTOID || exprtype == JSONOID)
4192 else if (exprtype == JSONBOID)
4243 foreach(lc,
op->d.grouping_func.clauses)
4254 *
op->resnull =
false;
4270 elog(
ERROR,
"no merge action in progress");
4277 *
op->resnull =
false;
4281 *
op->resnull =
false;
4285 *
op->resnull =
false;
4288 elog(
ERROR,
"unexpected merge action: DO NOTHING");
4291 elog(
ERROR,
"unrecognized commandType: %d",
4351 if (
op->d.wholerow.junkFilter != NULL)
4361 if (
op->d.wholerow.first)
4364 op->d.wholerow.slow =
false;
4370 if (
variable->vartype != RECORDOID)
4395 if (var_tupdesc->
natts != slot_tupdesc->
natts)
4397 (
errcode(ERRCODE_DATATYPE_MISMATCH),
4398 errmsg(
"table row type and query-specified row type do not match"),
4400 "Table row contains %d attributes, but query expects %d.",
4401 slot_tupdesc->
natts,
4402 slot_tupdesc->
natts,
4403 var_tupdesc->
natts)));
4405 for (
int i = 0;
i < var_tupdesc->
natts;
i++)
4410 if (vattr->atttypid == sattr->atttypid)
4412 if (!vattr->attisdropped)
4414 (
errcode(ERRCODE_DATATYPE_MISMATCH),
4415 errmsg(
"table row type and query-specified row type do not match"),
4416 errdetail(
"Table has type %s at ordinal position %d, but query expects %s.",
4421 if (vattr->attlen != sattr->attlen ||
4422 vattr->attalign != sattr->attalign)
4423 op->d.wholerow.slow =
true;
4453 output_tupdesc->
tdtypeid = RECORDOID;
4484 op->d.wholerow.first =
false;
4493 if (
op->d.wholerow.slow)
4501 for (
int i = 0;
i < var_tupdesc->
natts;
i++)
4506 if (!vattr->attisdropped)
4510 if (vattr->attlen != sattr->attlen ||
4511 vattr->attalign != sattr->attalign)
4513 (
errcode(ERRCODE_DATATYPE_MISMATCH),
4514 errmsg(
"table row type and query-specified row type do not match"),
4515 errdetail(
"Physical storage mismatch on dropped attribute at ordinal position %d.",
4540 *
op->resnull =
false;
4556 elog(
ERROR,
"failed to fetch attribute from slot");
4618 Datum newValue,
bool newValueIsNull,
4619 Datum oldValue,
bool oldValueIsNull)
4621 Assert(newValue != oldValue);
4623 if (!newValueIsNull)
4643 newValue = (
Datum) 0;
4646 if (!oldValueIsNull)
4712 bool isdistinct =
false;
4760 int setno =
op->d.agg_trans.setno;
4763 *
op->resvalue, *
op->resnull);
4774 int setno =
op->d.agg_trans.setno;
#define DatumGetArrayTypePCopy(X)
#define ARR_NULLBITMAP(a)
#define ARR_OVERHEAD_WITHNULLS(ndims, nitems)
#define DatumGetArrayTypeP(X)
#define ARR_OVERHEAD_NONULLS(ndims)
#define ARR_DATA_OFFSET(a)
Datum array_map(Datum arrayd, ExprState *exprstate, ExprContext *econtext, Oid retType, ArrayMapState *amstate)
ArrayType * construct_empty_array(Oid elmtype)
ArrayType * construct_md_array(Datum *elems, bool *nulls, int ndims, int *dims, int *lbs, Oid elmtype, int elmlen, bool elmbyval, char elmalign)
void array_bitmap_copy(bits8 *destbitmap, int destoffset, const bits8 *srcbitmap, int srcoffset, int nitems)
int ArrayGetNItems(int ndim, const int *dims)
void ArrayCheckBounds(int ndim, const int *dims, const int *lb)
#define InvalidAttrNumber
Datum current_database(PG_FUNCTION_ARGS)
Timestamp GetSQLLocalTimestamp(int32 typmod)
TimestampTz GetSQLCurrentTimestamp(int32 typmod)
bool bms_is_member(int x, const Bitmapset *a)
static Datum values[MAXATTR]
#define pg_attribute_always_inline
#define StaticAssertDecl(condition, errmessage)
#define OidIsValid(objectId)
int64 nextval_internal(Oid relid, bool check_permissions)
TimeTzADT * GetSQLCurrentTime(int32 typmod)
TimeADT GetSQLLocalTime(int32 typmod)
DateADT GetSQLCurrentDate(void)
static Datum DateADTGetDatum(DateADT X)
static Datum TimeTzADTPGetDatum(const TimeTzADT *X)
static Datum TimeADTGetDatum(TimeADT X)
Datum datumCopy(Datum value, bool typByVal, int typLen)
static void PGresult * res
int errdatatype(Oid datatypeOid)
int errdomainconstraint(Oid datatypeOid, const char *conname)
int errdetail(const char *fmt,...)
int errdetail_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define errsave(context,...)
#define ereport(elevel,...)
void ExecEvalParamExtern(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalFieldStoreForm(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalGroupingFunc(ExprState *state, ExprEvalStep *op)
static void CheckVarSlotCompatibility(TupleTableSlot *slot, int attnum, Oid vartype)
void ExecEvalRow(ExprState *state, ExprEvalStep *op)
static pg_attribute_always_inline Datum ExecJustVarVirtImpl(ExprState *state, TupleTableSlot *slot, bool *isnull)
static pg_attribute_always_inline Datum ExecJustAssignVarImpl(ExprState *state, TupleTableSlot *inslot, bool *isnull)
void ExecEvalFieldStoreDeForm(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalCurrentOfExpr(ExprState *state, ExprEvalStep *op)
void ExecEvalSQLValueFunction(ExprState *state, ExprEvalStep *op)
void ExecEvalRowNull(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op)
static Datum ExecJustAssignInnerVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
void ExecEvalCoerceViaIOSafe(ExprState *state, ExprEvalStep *op)
static Datum ExecJustScanVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecJustApplyFuncToCase(ExprState *state, ExprContext *econtext, bool *isnull)
Datum ExecInterpExprStillValid(ExprState *state, ExprContext *econtext, bool *isNull)
static pg_attribute_always_inline void ExecAggPlainTransByVal(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup, ExprContext *aggcontext, int setno)
struct ScalarArrayOpExprHashEntry ScalarArrayOpExprHashEntry
static Datum ExecJustAssignScanVar(ExprState *state, ExprContext *econtext, bool *isnull)
void ExecEvalConvertRowtype(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
bool ExecEvalPreOrderedDistinctMulti(AggState *aggstate, AggStatePerTrans pertrans)
void ExecEvalFieldSelect(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
struct ScalarArrayOpExprHashTable ScalarArrayOpExprHashTable
static Datum ExecJustInnerVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
void ExecEvalConstraintNotNull(ExprState *state, ExprEvalStep *op)
static void ExecInitInterpreter(void)
void ExecEvalScalarArrayOp(ExprState *state, ExprEvalStep *op)
void ExecEvalAggOrderedTransDatum(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static Datum ExecJustConst(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecJustOuterVar(ExprState *state, ExprContext *econtext, bool *isnull)
void ExecEvalParamExec(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecAggInitGroup(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup, ExprContext *aggcontext)
static pg_attribute_always_inline Datum ExecJustAssignVarVirtImpl(ExprState *state, TupleTableSlot *inslot, bool *isnull)
void ExecEvalNextValueExpr(ExprState *state, ExprEvalStep *op)
void ExecEvalSysVar(ExprState *state, ExprEvalStep *op, ExprContext *econtext, TupleTableSlot *slot)
static bool saop_hash_element_match(struct saophash_hash *tb, Datum key1, Datum key2)
void ExecEvalMinMax(ExprState *state, ExprEvalStep *op)
void ExecEvalSubPlan(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalJsonIsPredicate(ExprState *state, ExprEvalStep *op)
static uint32 saop_element_hash(struct saophash_hash *tb, Datum key)
static Datum ExecJustInnerVar(ExprState *state, ExprContext *econtext, bool *isnull)
Datum ExecAggCopyTransValue(AggState *aggstate, AggStatePerTrans pertrans, Datum newValue, bool newValueIsNull, Datum oldValue, bool oldValueIsNull)
static Datum ExecJustAssignInnerVar(ExprState *state, ExprContext *econtext, bool *isnull)
void ExecEvalMergeSupportFunc(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void CheckExprStillValid(ExprState *state, ExprContext *econtext)
void ExecEvalJsonConstructor(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalWholeRowVar(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalHashedScalarArrayOp(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecReadyInterpretedExpr(ExprState *state)
static Datum ExecJustAssignScanVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
static void ExecEvalRowNullInt(ExprState *state, ExprEvalStep *op, ExprContext *econtext, bool checkisnull)
void ExecEvalRowNotNull(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
ExprEvalOp ExecEvalStepOp(ExprState *state, ExprEvalStep *op)
static Datum ExecJustAssignOuterVar(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecJustAssignOuterVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
void ExecEvalConstraintCheck(ExprState *state, ExprEvalStep *op)
void ExecEvalArrayCoerce(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static void CheckOpSlotCompatibility(ExprEvalStep *op, TupleTableSlot *slot)
void ExecEvalFuncExprStrictFusage(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static Datum ExecJustOuterVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecJustScanVar(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
static pg_attribute_always_inline Datum ExecJustVarImpl(ExprState *state, TupleTableSlot *slot, bool *isnull)
void ExecEvalFuncExprFusage(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op)
bool ExecEvalPreOrderedDistinctSingle(AggState *aggstate, AggStatePerTrans pertrans)
#define EEO_OPCODE(opcode)
static pg_attribute_always_inline void ExecAggPlainTransByRef(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup, ExprContext *aggcontext, int setno)
void ExecEvalAggOrderedTransTuple(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static TupleDesc get_cached_rowtype(Oid type_id, int32 typmod, ExprEvalRowtypeCache *rowcache, bool *changed)
#define EEO_FLAG_INTERPRETER_INITIALIZED
#define EEO_FLAG_DIRECT_THREADED
@ EEOP_FUNCEXPR_STRICT_FUSAGE
@ EEOP_AGG_PLAIN_PERGROUP_NULLCHECK
@ EEOP_AGG_STRICT_DESERIALIZE
@ EEOP_BOOLTEST_IS_NOT_FALSE
@ EEOP_AGG_PLAIN_TRANS_BYREF
@ EEOP_AGG_PRESORTED_DISTINCT_MULTI
@ EEOP_AGG_PLAIN_TRANS_BYVAL
@ EEOP_NULLTEST_ROWISNOTNULL
@ EEOP_ASSIGN_TMP_MAKE_RO
@ EEOP_BOOL_OR_STEP_FIRST
@ EEOP_AGG_STRICT_INPUT_CHECK_NULLS
@ EEOP_AGG_STRICT_INPUT_CHECK_ARGS
@ EEOP_NULLTEST_ROWISNULL
@ EEOP_NULLTEST_ISNOTNULL
@ EEOP_MERGE_SUPPORT_FUNC
@ EEOP_AGG_PRESORTED_DISTINCT_SINGLE
@ EEOP_BOOL_AND_STEP_FIRST
@ EEOP_BOOL_AND_STEP_LAST
@ EEOP_AGG_ORDERED_TRANS_DATUM
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYREF
@ EEOP_BOOLTEST_IS_NOT_TRUE
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF
@ EEOP_HASHED_SCALARARRAYOP
@ EEOP_AGG_ORDERED_TRANS_TUPLE
TupleTableSlot * ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
TupleDesc BlessTupleDesc(TupleDesc tupdesc)
const TupleTableSlotOps TTSOpsVirtual
TupleTableSlot * ExecStoreVirtualTuple(TupleTableSlot *slot)
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
const TupleTableSlotOps TTSOpsBufferHeapTuple
const TupleTableSlotOps TTSOpsHeapTuple
Datum(* ExprStateEvalFunc)(struct ExprState *expression, struct ExprContext *econtext, bool *isNull)
static RangeTblEntry * exec_rt_fetch(Index rti, EState *estate)
static bool ExecQual(ExprState *state, ExprContext *econtext)
ExpandedObjectHeader * DatumGetEOHP(Datum d)
void DeleteExpandedObject(Datum d)
Datum MakeExpandedObjectReadOnlyInternal(Datum d)
#define DatumIsReadWriteExpandedObject(d, isnull, typlen)
static Datum expanded_record_get_field(ExpandedRecordHeader *erh, int fnumber, bool *isnull)
static TupleDesc expanded_record_get_tupdesc(ExpandedRecordHeader *erh)
Datum FunctionCall2Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2)
void fmgr_info(Oid functionId, FmgrInfo *finfo)
Datum Int64GetDatum(int64 X)
#define DatumGetHeapTupleHeader(X)
#define DatumGetTextPP(X)
#define SizeForFunctionCallInfo(nargs)
#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)
#define LOCAL_FCINFO(name, nargs)
#define FunctionCallInvoke(fcinfo)
#define fmgr_info_set_expr(expr, finfo)
static Datum HeapTupleGetDatum(const HeapTupleData *tuple)
HeapTuple toast_build_flattened_tuple(TupleDesc tupleDesc, Datum *values, bool *isnull)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *values, bool *isnull)
Datum heap_copy_tuple_as_datum(HeapTuple tuple, TupleDesc tupleDesc)
#define HeapTupleHeaderSetTypMod(tup, typmod)
static Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
#define HeapTupleHeaderGetTypMod(tup)
#define HeapTupleHeaderGetTypeId(tup)
#define HeapTupleHeaderGetDatumLength(tup)
#define HeapTupleHeaderSetTypeId(tup, typeid)
if(TABLE==NULL||TABLE_index==NULL)
static void ItemPointerSetInvalid(ItemPointerData *pointer)
Datum json_build_array_worker(int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null)
Datum json_build_object_worker(int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null, bool unique_keys)
Datum datum_to_json(Datum val, JsonTypeCategory tcategory, Oid outfuncoid)
bool json_validate(text *json, bool check_unique_keys, bool throw_error)
@ JSON_TOKEN_OBJECT_START
Datum jsonb_from_text(text *js, bool unique_keys)
Datum jsonb_build_array_worker(int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null)
Datum jsonb_build_object_worker(int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null, bool unique_keys)
Datum datum_to_jsonb(Datum val, JsonTypeCategory tcategory, Oid outfuncoid)
static Jsonb * DatumGetJsonbP(Datum d)
#define JB_ROOT_IS_OBJECT(jbp_)
#define JB_ROOT_IS_ARRAY(jbp_)
#define JB_ROOT_IS_SCALAR(jbp_)
JsonTokenType json_get_first_token(text *json, bool throw_error)
Assert(fmt[strlen(fmt) - 1] !='\n')
List * lappend(List *list, void *datum)
void get_typlenbyvalalign(Oid typid, int16 *typlen, bool *typbyval, char *typalign)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
MemoryContext MemoryContextGetParent(MemoryContext context)
#define AllocSizeIsValid(size)
#define SOFT_ERROR_OCCURRED(escontext)
Datum current_user(PG_FUNCTION_ARGS)
Datum session_user(PG_FUNCTION_ARGS)
Datum current_schema(PG_FUNCTION_ARGS)
Oid exprType(const Node *expr)
void ExecSetParamPlan(SubPlanState *node, ExprContext *econtext)
Datum ExecSubPlan(SubPlanState *node, ExprContext *econtext, bool *isNull)
#define IsA(nodeptr, _type_)
#define castNode(_type_, nodeptr)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
FormData_pg_attribute * Form_pg_attribute
static int list_length(const List *l)
#define forboth(cell1, list1, cell2, list2)
void pgstat_init_function_usage(FunctionCallInfo fcinfo, PgStat_FunctionCallUsage *fcu)
void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu, bool finalize)
#define qsort(a, b, c, d)
void check_stack_depth(void)
static uint32 DatumGetUInt32(Datum X)
static bool DatumGetBool(Datum X)
static Datum PointerGetDatum(const void *X)
static char * DatumGetCString(Datum X)
static Datum Int16GetDatum(int16 X)
static Datum BoolGetDatum(bool X)
static Pointer DatumGetPointer(Datum X)
static Datum Int32GetDatum(int32 X)
static int32 DatumGetInt32(Datum X)
@ SVFOP_CURRENT_TIMESTAMP
@ SVFOP_CURRENT_TIMESTAMP_N
static chr element(struct vars *v, const chr *startp, const chr *endp)
static unsigned hash(unsigned *uv, int n)
void appendStringInfo(StringInfo str, const char *fmt,...)
void initStringInfo(StringInfo str)
TupleTableSlot * sortslot
Tuplesortstate ** sortstates
TupleTableSlot * uniqslot
FunctionCallInfo transfn_fcinfo
AggStatePerGroup * all_pergroups
ExprContext * curaggcontext
AggStatePerTrans curpertrans
Index es_range_table_size
ParamListInfo ecxt_param_list_info
MemoryContext ecxt_per_tuple_memory
TupleTableSlot * ecxt_innertuple
ParamExecData * ecxt_param_exec_vals
TupleTableSlot * ecxt_scantuple
MemoryContext ecxt_per_query_memory
struct EState * ecxt_estate
TupleTableSlot * ecxt_outertuple
union ExprEvalStep::@51 d
struct ScalarArrayOpExprHashTable * elements_tab
AggStatePerTrans pertrans
struct ExprEvalStep::@51::@83 hashedscalararrayop
ExprEvalRowtypeCache rowcache
struct JsonConstructorExprState * jcstate
NullableDatum args[FLEXIBLE_ARRAY_MEMBER]
JsonConstructorExpr * constructor
struct JsonConstructorExprState::@96 * arg_type_cache
JsonReturning * returning
MergeActionState * mt_merge_action
ParamExternData params[FLEXIBLE_ARRAY_MEMBER]
ParamFetchHook paramFetch
FunctionCallInfoBaseData hash_fcinfo_data
TupleDesc tts_tupleDescriptor
const TupleTableSlotOps *const tts_ops
uint64 tupDesc_identifier
TupleConversionMap * convert_tuples_by_name(TupleDesc indesc, TupleDesc outdesc)
HeapTuple execute_attr_map_tuple(HeapTuple tuple, TupleConversionMap *map)
void DecrTupleDescRefCount(TupleDesc tupdesc)
void IncrTupleDescRefCount(TupleDesc tupdesc)
TupleDesc CreateTupleDescCopy(TupleDesc tupdesc)
#define ReleaseTupleDesc(tupdesc)
struct TupleDescData * TupleDesc
#define TupleDescAttr(tupdesc, i)
void tuplesort_putdatum(Tuplesortstate *state, Datum val, bool isNull)
void tuplesort_puttupleslot(Tuplesortstate *state, TupleTableSlot *slot)
#define att_align_nominal(cur_offset, attalign)
#define att_addlength_pointer(cur_offset, attlen, attptr)
static Datum fetch_att(const void *T, bool attbyval, int attlen)
#define TTS_IS_VIRTUAL(slot)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
static void slot_getsomeattrs(TupleTableSlot *slot, int attnum)
static TupleTableSlot * ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
static Datum slot_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
static void slot_getallattrs(TupleTableSlot *slot)
TupleDesc lookup_rowtype_tupdesc(Oid type_id, int32 typmod)
TupleDesc lookup_rowtype_tupdesc_domain(Oid type_id, int32 typmod, bool noError)
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)
#define TYPECACHE_TUPDESC
static Datum TimestampTzGetDatum(TimestampTz X)
static Datum TimestampGetDatum(Timestamp X)
#define VARATT_IS_EXTERNAL_EXPANDED(PTR)
#define SET_VARSIZE(PTR, len)
text * cstring_to_text_with_len(const char *s, int len)
xmltype * xmlconcat(List *args)
text * xmltotext_with_options(xmltype *data, XmlOptionType xmloption_arg, bool indent)
xmltype * xmlparse(text *data, XmlOptionType xmloption_arg, bool preserve_whitespace)
bool xml_is_document(xmltype *arg)
xmltype * xmlpi(const char *target, text *arg, bool arg_is_null, bool *result_is_null)
char * map_sql_value_to_xml_value(Datum value, Oid type, bool xml_escape_strings)
xmltype * xmlelement(XmlExpr *xexpr, Datum *named_argvalue, bool *named_argnull, Datum *argvalue, bool *argnull)
xmltype * xmlroot(xmltype *data, text *version, int standalone)
static xmltype * DatumGetXmlP(Datum X)