1/*-------------------------------------------------------------------------
4 * interface for TableFunc executor node
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * src/include/executor/tablefunc.h
11 *-------------------------------------------------------------------------
16/* Forward-declare this to avoid including execnodes.h here */
20 * TableFuncRoutine holds function pointers used for generating content of
21 * table-producer functions, such as XMLTABLE.
23 * InitOpaque initializes table builder private objects. The output tuple
24 * descriptor, input functions for the columns, and typioparams are passed
25 * from executor state.
27 * SetDocument is called to define the input document. The table builder may
28 * apply additional transformations not exposed outside the table builder
31 * SetNamespace is called to pass namespace declarations from the table
32 * expression. This function may be NULL if namespaces are not supported by
33 * the table builder. Namespaces must be given before setting the row and
34 * column filters. If the name is given as NULL, the entry shall be for the
37 * SetRowFilter is called do define the row-generating filter, which shall be
38 * used to extract each row from the input document.
40 * SetColumnFilter is called once for each column, to define the column-
41 * generating filter for the given column.
43 * FetchRow shall be called repeatedly until it returns that no more rows are
44 * found in the document. On each invocation it shall set state in the table
45 * builder context such that each subsequent GetValue call returns the values
46 * for the indicated column for the row being processed.
48 * DestroyOpaque shall release all resources associated with a table builder
49 * context. It may be called either because all rows have been consumed, or
50 * because an error occurred while processing the table expression.
60 const char *path,
int colnum);
63 Oid typid,
int32 typmod,
bool *isnull);
67#endif /* _TABLEFUNC_H */
void(* SetNamespace)(TableFuncScanState *state, const char *name, const char *uri)
void(* SetDocument)(TableFuncScanState *state, Datum value)
void(* DestroyOpaque)(TableFuncScanState *state)
void(* SetColumnFilter)(TableFuncScanState *state, const char *path, int colnum)
void(* InitOpaque)(TableFuncScanState *state, int natts)
Datum(* GetValue)(TableFuncScanState *state, int colnum, Oid typid, int32 typmod, bool *isnull)
bool(* FetchRow)(TableFuncScanState *state)
void(* SetRowFilter)(TableFuncScanState *state, const char *path)
struct TableFuncRoutine TableFuncRoutine