PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | SQLFunctionParseInfo |
Typedefs | |
typedef struct SQLFunctionParseInfo | SQLFunctionParseInfo |
typedef SQLFunctionParseInfo * | SQLFunctionParseInfoPtr |
Functions | |
Datum | fmgr_sql (PG_FUNCTION_ARGS) |
SQLFunctionParseInfoPtr | prepare_sql_fn_parse_info (HeapTuple procedureTuple, Node *call_expr, Oid inputCollation) |
void | sql_fn_parser_setup (struct ParseState *pstate, SQLFunctionParseInfoPtr pinfo) |
void | check_sql_fn_statements (List *queryTreeLists) |
bool | check_sql_fn_retval (List *queryTreeLists, Oid rettype, TupleDesc rettupdesc, char prokind, bool insertDroppedCols, List **resultTargetList) |
DestReceiver * | CreateSQLFunctionDestReceiver (void) |
typedef struct SQLFunctionParseInfo SQLFunctionParseInfo |
Definition at line 35 of file functions.h.
bool check_sql_fn_retval | ( | List * | queryTreeLists, |
Oid | rettype, | ||
TupleDesc | rettupdesc, | ||
char | prokind, | ||
bool | insertDroppedCols, | ||
List ** | resultTargetList | ||
) |
Definition at line 1609 of file functions.c.
References Assert, CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_SELECT, CMD_UPDATE, coerce_fn_result_column(), Query::commandType, ereport, errcode(), errdetail(), errmsg(), ERROR, ExecCleanTargetListLength(), TargetEntry::expr, exprType(), format_type_be(), get_typtype(), RangeTblEntry::inh, InvalidOid, Query::jointree, lappend(), lfirst, lfirst_node, linitial, list_length(), list_make1, makeAlias(), makeConst(), makeFromExpr(), makeNode, makeString(), makeTargetEntry(), TupleDescData::natts, NIL, parse(), Query::rtable, RTE_SUBQUERY, RangeTblEntry::rtekind, RangeTblRef::rtindex, RangeTblEntry::subquery, Query::targetList, and TupleDescAttr.
Referenced by fmgr_sql_validator(), init_sql_fcache(), inline_function(), and inline_set_returning_function().
void check_sql_fn_statements | ( | List * | queryTreeLists | ) |
Definition at line 1534 of file functions.c.
References CMD_UTILITY, Query::commandType, ereport, errcode(), errmsg(), ERROR, if(), IsA, lfirst_node, NIL, stmt, and Query::utilityStmt.
Referenced by fmgr_sql_validator(), and init_sql_fcache().
DestReceiver* CreateSQLFunctionDestReceiver | ( | void | ) |
Definition at line 2063 of file functions.c.
References DestSQLFunction, palloc0(), sqlfunction_destroy(), sqlfunction_receive(), sqlfunction_shutdown(), and sqlfunction_startup().
Referenced by CreateDestReceiver().
Datum fmgr_sql | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1029 of file functions.c.
References ReturnSetInfo::allowedModes, ErrorContextCallback::arg, Assert, ErrorContextCallback::callback, CommandCounterIncrement(), CreateTupleDescCopy(), ReturnSetInfo::econtext, elog, ereport, errcode(), errmsg(), ERROR, error_context_stack, ExprEndResult, ExprMultipleResult, F_EXEC_DONE, F_EXEC_START, SQLFunctionCache::fcontext, SQLFunctionCache::func_state, GetTransactionSnapshot(), if(), init_sql_fcache(), IsA, ReturnSetInfo::isDone, JunkFilter::jf_cleanTupType, JunkFilter::jf_resultSlot, SQLFunctionCache::junkFilter, execution_state::lazyEval, SQLFunctionCache::lazyEval, lfirst, lnext(), SQLFunctionCache::lxid, PGPROC::lxid, MemoryContextDelete(), MemoryContextSwitchTo(), MyProc, execution_state::next, PG_GET_COLLATION, PointerGetDatum(), PopActiveSnapshot(), postquel_end(), postquel_get_single_result(), postquel_getnext(), postquel_start(), postquel_sub_params(), ErrorContextCallback::previous, PushActiveSnapshot(), execution_state::qd, SQLFunctionCache::readonly_func, RegisterExprContextCallback(), SQLFunctionCache::rettype, ReturnSetInfo::returnMode, SQLFunctionCache::returnsSet, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, SFRM_Materialize, SFRM_Materialize_Preferred, SFRM_Materialize_Random, SFRM_ValuePerCall, SQLFunctionCache::shutdown_reg, ShutdownSQLFunction(), QueryDesc::snapshot, sql_exec_error_callback(), execution_state::status, SubTransactionIsActive(), SQLFunctionCache::subxid, SQLFunctionCache::tstore, tuplestore_begin_heap(), tuplestore_clear(), tuplestore_gettupleslot(), UnregisterExprContextCallback(), UpdateActiveSnapshotCommandId(), PGPROC::vxid, and work_mem.
Referenced by fmgr_info_cxt_security().
SQLFunctionParseInfoPtr prepare_sql_fn_parse_info | ( | HeapTuple | procedureTuple, |
Node * | call_expr, | ||
Oid | inputCollation | ||
) |
Definition at line 176 of file functions.c.
References SQLFunctionParseInfo::argnames, SQLFunctionParseInfo::argtypes, SQLFunctionParseInfo::collation, ereport, errcode(), errmsg(), ERROR, SQLFunctionParseInfo::fname, format_type_be(), get_call_expr_argtype(), get_func_input_arg_names(), GETSTRUCT, InvalidOid, NameStr, SQLFunctionParseInfo::nargs, palloc(), palloc0(), PointerGetDatum(), pstrdup(), and SysCacheGetAttr().
Referenced by fmgr_sql_validator(), init_sql_fcache(), inline_function(), and inline_set_returning_function().
void sql_fn_parser_setup | ( | struct ParseState * | pstate, |
SQLFunctionParseInfoPtr | pinfo | ||
) |
Definition at line 265 of file functions.c.
References ParseState::p_paramref_hook, ParseState::p_post_columnref_hook, ParseState::p_pre_columnref_hook, ParseState::p_ref_hook_state, sql_fn_param_ref(), and sql_fn_post_column_ref().
Referenced by fmgr_sql_validator(), init_sql_fcache(), inline_function(), inline_set_returning_function(), and interpret_AS_clause().