mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
SQL-language functions are now callable in ordinary fmgr contexts ...
for example, an SQL function can be used in a functional index. (I make no promises about speed, but it'll work ;-).) Clean up and simplify handling of functions returning sets.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: execnodes.h,v 1.47 2000/08/22 04:06:22 tgl Exp $
|
||||
* $Id: execnodes.h,v 1.48 2000/08/24 03:29:13 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -120,6 +120,31 @@ typedef struct ExprContext
|
||||
List *ecxt_range_table;
|
||||
} ExprContext;
|
||||
|
||||
/*
|
||||
* Set-result status returned by ExecEvalExpr()
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
ExprSingleResult, /* expression does not return a set */
|
||||
ExprMultipleResult, /* this result is an element of a set */
|
||||
ExprEndResult /* there are no more elements in the set */
|
||||
} ExprDoneCond;
|
||||
|
||||
/*
|
||||
* When calling a function that might return a set (multiple rows),
|
||||
* a node of this type is passed as fcinfo->resultinfo to allow
|
||||
* return status to be passed back. A function returning set should
|
||||
* raise an error if no such resultinfo is provided.
|
||||
*
|
||||
* XXX this mechanism is a quick hack and probably needs to be redesigned.
|
||||
*/
|
||||
typedef struct ReturnSetInfo
|
||||
{
|
||||
NodeTag type;
|
||||
ExprDoneCond isDone;
|
||||
} ReturnSetInfo;
|
||||
|
||||
|
||||
/* ----------------
|
||||
* ProjectionInfo node information
|
||||
*
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: nodes.h,v 1.74 2000/08/11 23:46:54 tgl Exp $
|
||||
* $Id: nodes.h,v 1.75 2000/08/24 03:29:13 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -227,7 +227,9 @@ typedef enum NodeTag
|
||||
* TAGS FOR FUNCTION-CALL CONTEXT AND RESULTINFO NODES (cf. fmgr.h)
|
||||
*---------------------
|
||||
*/
|
||||
T_TriggerData = 800 /* in commands/trigger.h */
|
||||
T_TriggerData = 800, /* in commands/trigger.h */
|
||||
T_ReturnSetInfo /* in nodes/execnodes.h */
|
||||
|
||||
} NodeTag;
|
||||
|
||||
/*
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: primnodes.h,v 1.46 2000/08/08 15:42:59 tgl Exp $
|
||||
* $Id: primnodes.h,v 1.47 2000/08/24 03:29:13 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -16,7 +16,10 @@
|
||||
|
||||
#include "access/attnum.h"
|
||||
#include "nodes/pg_list.h"
|
||||
#include "utils/fcache.h"
|
||||
|
||||
/* FunctionCache is declared in utils/fcache.h */
|
||||
typedef struct FunctionCache *FunctionCachePtr;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* node definitions
|
||||
|
||||
Reference in New Issue
Block a user