diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-10-28 22:02:06 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-10-28 22:02:06 +0000 |
commit | e3e3d2a789e34ff6572bdf693beb1516a228c5ff (patch) | |
tree | c5c95ccfe1f4cc79e49c572b13681f628a212fe9 /src/include/executor | |
parent | a80a12247a99f0bccf47bed5786f28a35fc80845 (diff) | |
download | postgresql-e3e3d2a789e34ff6572bdf693beb1516a228c5ff.tar.gz postgresql-e3e3d2a789e34ff6572bdf693beb1516a228c5ff.zip |
Extend ExecMakeFunctionResult() to support set-returning functions that return
via a tuplestore instead of value-per-call. Refactor a few things to reduce
ensuing code duplication with nodeFunctionscan.c. This represents the
reasonably noncontroversial part of my proposed patch to switch SQL functions
over to returning tuplestores. For the moment, SQL functions still do things
the old way. However, this change enables PL SRFs to be called in targetlists
(observe changes in plperl regression results).
Diffstat (limited to 'src/include/executor')
-rw-r--r-- | src/include/executor/executor.h | 11 | ||||
-rw-r--r-- | src/include/executor/tuptable.h | 3 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index 7788a22b76c..65e7e4041d6 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.149 2008/07/26 19:15:35 tgl Exp $ + * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.150 2008/10/28 22:02:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -176,16 +176,9 @@ extern Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno, bool *isNull); extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname, bool *isNull); -extern void init_fcache(Oid foid, FuncExprState *fcache, - MemoryContext fcacheCxt); -extern Datum ExecMakeFunctionResult(FuncExprState *fcache, - ExprContext *econtext, - bool *isNull, - ExprDoneCond *isDone); extern Tuplestorestate *ExecMakeTableFunctionResult(ExprState *funcexpr, ExprContext *econtext, - TupleDesc expectedDesc, - TupleDesc *returnDesc); + TupleDesc expectedDesc); extern Datum ExecEvalExprSwitchContext(ExprState *expression, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone); extern ExprState *ExecInitExpr(Expr *node, PlanState *parent); diff --git a/src/include/executor/tuptable.h b/src/include/executor/tuptable.h index 9b8cb46a74b..337f537272d 100644 --- a/src/include/executor/tuptable.h +++ b/src/include/executor/tuptable.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/tuptable.h,v 1.38 2008/01/01 19:45:57 momjian Exp $ + * $PostgreSQL: pgsql/src/include/executor/tuptable.h,v 1.39 2008/10/28 22:02:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -160,6 +160,7 @@ extern HeapTuple ExecCopySlotTuple(TupleTableSlot *slot); extern MinimalTuple ExecCopySlotMinimalTuple(TupleTableSlot *slot); extern HeapTuple ExecFetchSlotTuple(TupleTableSlot *slot); extern MinimalTuple ExecFetchSlotMinimalTuple(TupleTableSlot *slot); +extern Datum ExecFetchSlotTupleDatum(TupleTableSlot *slot); extern HeapTuple ExecMaterializeSlot(TupleTableSlot *slot); extern TupleTableSlot *ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot); |