PostgreSQL Source Code  git master
functions.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * functions.h
4  * Declarations for execution of SQL-language functions.
5  *
6  *
7  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/executor/functions.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef FUNCTIONS_H
15 #define FUNCTIONS_H
16 
17 #include "nodes/execnodes.h"
18 #include "tcop/dest.h"
19 
20 /*
21  * Data structure needed by the parser callback hooks to resolve parameter
22  * references during parsing of a SQL function's body. This is separate from
23  * SQLFunctionCache since we sometimes do parsing separately from execution.
24  */
25 typedef struct SQLFunctionParseInfo
26 {
27  char *fname; /* function's name */
28  int nargs; /* number of input arguments */
29  Oid *argtypes; /* resolved types of input arguments */
30  char **argnames; /* names of input arguments; NULL if none */
31  /* Note that argnames[i] can be NULL, if some args are unnamed */
32  Oid collation; /* function's input collation, if known */
34 
36 
38 
40  Node *call_expr,
41  Oid inputCollation);
42 
43 extern void sql_fn_parser_setup(struct ParseState *pstate,
45 
46 extern void check_sql_fn_statements(List *queryTreeLists);
47 
48 extern bool check_sql_fn_retval(List *queryTreeLists,
49  Oid rettype, TupleDesc rettupdesc,
50  bool insertDroppedCols,
51  List **resultTargetList);
52 
54 
55 #endif /* FUNCTIONS_H */
SQLFunctionParseInfoPtr prepare_sql_fn_parse_info(HeapTuple procedureTuple, Node *call_expr, Oid inputCollation)
Definition: functions.c:176
bool check_sql_fn_retval(List *queryTreeLists, Oid rettype, TupleDesc rettupdesc, bool insertDroppedCols, List **resultTargetList)
Definition: functions.c:1598
Definition: nodes.h:539
unsigned int Oid
Definition: postgres_ext.h:31
struct SQLFunctionParseInfo SQLFunctionParseInfo
void check_sql_fn_statements(List *queryTreeLists)
Definition: functions.c:1523
DestReceiver * CreateSQLFunctionDestReceiver(void)
Definition: functions.c:2045
void sql_fn_parser_setup(struct ParseState *pstate, SQLFunctionParseInfoPtr pinfo)
Definition: functions.c:265
Datum fmgr_sql(PG_FUNCTION_ARGS)
Definition: functions.c:1018
uintptr_t Datum
Definition: postgres.h:411
SQLFunctionParseInfo * SQLFunctionParseInfoPtr
Definition: functions.h:35
#define PG_FUNCTION_ARGS
Definition: fmgr.h:193
Definition: pg_list.h:50