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-2025, 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 */
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
43extern void sql_fn_parser_setup(struct ParseState *pstate,
45
46extern void check_sql_fn_statements(List *queryTreeLists);
47
48extern bool check_sql_fn_retval(List *queryTreeLists,
49 Oid rettype, TupleDesc rettupdesc,
50 char prokind,
51 bool insertDroppedCols,
52 List **resultTargetList);
53
55
56#endif /* FUNCTIONS_H */
#define PG_FUNCTION_ARGS
Definition: fmgr.h:193
struct SQLFunctionParseInfo SQLFunctionParseInfo
Datum fmgr_sql(PG_FUNCTION_ARGS)
Definition: functions.c:1031
void check_sql_fn_statements(List *queryTreeLists)
Definition: functions.c:1536
DestReceiver * CreateSQLFunctionDestReceiver(void)
Definition: functions.c:2071
void sql_fn_parser_setup(struct ParseState *pstate, SQLFunctionParseInfoPtr pinfo)
Definition: functions.c:265
bool check_sql_fn_retval(List *queryTreeLists, Oid rettype, TupleDesc rettupdesc, char prokind, bool insertDroppedCols, List **resultTargetList)
Definition: functions.c:1611
SQLFunctionParseInfoPtr prepare_sql_fn_parse_info(HeapTuple procedureTuple, Node *call_expr, Oid inputCollation)
Definition: functions.c:176
SQLFunctionParseInfo * SQLFunctionParseInfoPtr
Definition: functions.h:35
uintptr_t Datum
Definition: postgres.h:69
unsigned int Oid
Definition: postgres_ext.h:32
Definition: pg_list.h:54
Definition: nodes.h:129