172 Oid **p_argtypes,
char ***p_argnames,
182 Datum proallargtypes,
236 #define TupleGetDatum(_slot, _tuple) HeapTupleGetDatum(_tuple)
296 #define MAT_SRF_USE_EXPECTED_DESC 0x01
297 #define MAT_SRF_BLESS 0x02
305 #define SRF_IS_FIRSTCALL() (fcinfo->flinfo->fn_extra == NULL)
307 #define SRF_FIRSTCALL_INIT() init_MultiFuncCall(fcinfo)
309 #define SRF_PERCALL_SETUP() per_MultiFuncCall(fcinfo)
311 #define SRF_RETURN_NEXT(_funcctx, _result) \
313 ReturnSetInfo *rsi; \
314 (_funcctx)->call_cntr++; \
315 rsi = (ReturnSetInfo *) fcinfo->resultinfo; \
316 rsi->isDone = ExprMultipleResult; \
317 PG_RETURN_DATUM(_result); \
320 #define SRF_RETURN_NEXT_NULL(_funcctx) \
322 ReturnSetInfo *rsi; \
323 (_funcctx)->call_cntr++; \
324 rsi = (ReturnSetInfo *) fcinfo->resultinfo; \
325 rsi->isDone = ExprMultipleResult; \
329 #define SRF_RETURN_DONE(_funcctx) \
331 ReturnSetInfo *rsi; \
332 end_MultiFuncCall(fcinfo, _funcctx); \
333 rsi = (ReturnSetInfo *) fcinfo->resultinfo; \
334 rsi->isDone = ExprEndResult; \
static Datum values[MAXATTR]
TupleDesc BlessTupleDesc(TupleDesc tupdesc)
void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values)
AttInMetadata * TupleDescGetAttInMetadata(TupleDesc tupdesc)
int get_func_trftypes(HeapTuple procTup, Oid **p_trftypes)
@ TYPEFUNC_COMPOSITE_DOMAIN
struct AttInMetadata AttInMetadata
TupleDesc build_function_result_tupdesc_t(HeapTuple procTuple)
TupleDesc build_function_result_tupdesc_d(char prokind, Datum proallargtypes, Datum proargmodes, Datum proargnames)
Datum HeapTupleHeaderGetDatum(HeapTupleHeader tuple)
bool resolve_polymorphic_argtypes(int numargs, Oid *argtypes, char *argmodes, Node *call_expr)
struct FuncCallContext FuncCallContext
char * get_func_result_name(Oid functionId)
void end_MultiFuncCall(PG_FUNCTION_ARGS, FuncCallContext *funcctx)
int get_func_input_arg_names(Datum proargnames, Datum proargmodes, char ***arg_names)
int get_func_arg_info(HeapTuple procTup, Oid **p_argtypes, char ***p_argnames, char **p_argmodes)
TupleDesc RelationNameGetTupleDesc(const char *relname)
TypeFuncClass get_call_result_type(FunctionCallInfo fcinfo, Oid *resultTypeId, TupleDesc *resultTupleDesc)
static Datum HeapTupleGetDatum(const HeapTupleData *tuple)
int extract_variadic_args(FunctionCallInfo fcinfo, int variadic_start, bool convert_unknown, Datum **args, Oid **types, bool **nulls)
FuncCallContext * init_MultiFuncCall(PG_FUNCTION_ARGS)
TupleDesc get_expr_result_tupdesc(Node *expr, bool noError)
TupleDesc TypeGetTupleDesc(Oid typeoid, List *colaliases)
TypeFuncClass get_func_result_type(Oid functionId, Oid *resultTypeId, TupleDesc *resultTupleDesc)
TypeFuncClass get_expr_result_type(Node *expr, Oid *resultTypeId, TupleDesc *resultTupleDesc)
FuncCallContext * per_MultiFuncCall(PG_FUNCTION_ARGS)
AttInMetadata * attinmeta
MemoryContext multi_call_memory_ctx