PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | PreparedStatement |
Functions | |
void | PrepareQuery (ParseState *pstate, PrepareStmt *stmt, int stmt_location, int stmt_len) |
void | ExecuteQuery (ParseState *pstate, ExecuteStmt *stmt, IntoClause *intoClause, ParamListInfo params, DestReceiver *dest, QueryCompletion *qc) |
void | DeallocateQuery (DeallocateStmt *stmt) |
void | ExplainExecuteQuery (ExecuteStmt *execstmt, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv) |
void | StorePreparedStatement (const char *stmt_name, CachedPlanSource *plansource, bool from_sql) |
PreparedStatement * | FetchPreparedStatement (const char *stmt_name, bool throwError) |
void | DropPreparedStatement (const char *stmt_name, bool showError) |
TupleDesc | FetchPreparedStatementResultDesc (PreparedStatement *stmt) |
List * | FetchPreparedStatementTargetList (PreparedStatement *stmt) |
void | DropAllPreparedStatements (void) |
void DeallocateQuery | ( | DeallocateStmt * | stmt | ) |
Definition at line 538 of file prepare.c.
References DropAllPreparedStatements(), DropPreparedStatement(), and DeallocateStmt::name.
Referenced by standard_ProcessUtility().
void DropAllPreparedStatements | ( | void | ) |
Definition at line 573 of file prepare.c.
References DropCachedPlan(), HASH_REMOVE, hash_search(), hash_seq_init(), hash_seq_search(), PreparedStatement::plansource, and PreparedStatement::stmt_name.
Referenced by DeallocateQuery(), and DiscardAll().
void DropPreparedStatement | ( | const char * | stmt_name, |
bool | showError | ||
) |
Definition at line 552 of file prepare.c.
References DropCachedPlan(), FetchPreparedStatement(), HASH_REMOVE, hash_search(), PreparedStatement::plansource, and PreparedStatement::stmt_name.
Referenced by DeallocateQuery(), and PostgresMain().
void ExecuteQuery | ( | ParseState * | pstate, |
ExecuteStmt * | stmt, | ||
IntoClause * | intoClause, | ||
ParamListInfo | params, | ||
DestReceiver * | dest, | ||
QueryCompletion * | qc | ||
) |
Definition at line 187 of file prepare.c.
References CMD_SELECT, CachedPlanSource::commandTag, PlannedStmt::commandType, CreateExecutorState(), CreateNewPortal(), elog, ereport, errcode(), errmsg(), ERROR, EState::es_param_list_info, EvaluateParams(), FETCH_ALL, FetchPreparedStatement(), CachedPlanSource::fixed_result, FreeExecutorState(), GetActiveSnapshot(), GetCachedPlan(), GetIntoRelEFlags(), linitial_node, list_length(), MemoryContextStrdup(), ExecuteStmt::name, CachedPlanSource::num_params, ExecuteStmt::params, PreparedStatement::plansource, PortalData::portalContext, PortalDefineQuery(), PortalDrop(), PortalRun(), PortalStart(), CachedPlanSource::query_string, IntoClause::skipData, CachedPlan::stmt_list, and PortalData::visible.
Referenced by ExecCreateTableAs(), and standard_ProcessUtility().
void ExplainExecuteQuery | ( | ExecuteStmt * | execstmt, |
IntoClause * | into, | ||
ExplainState * | es, | ||
const char * | queryString, | ||
ParamListInfo | params, | ||
QueryEnvironment * | queryEnv | ||
) |
Definition at line 604 of file prepare.c.
References ExplainState::buffers, BufferUsageAccumDiff(), CMD_UTILITY, PlannedStmt::commandType, CreateExecutorState(), CurrentResourceOwner, elog, ERROR, EState::es_param_list_info, EvaluateParams(), ExplainOnePlan(), ExplainOneUtility(), ExplainSeparatePlans(), FetchPreparedStatement(), CachedPlanSource::fixed_result, FreeExecutorState(), GetCachedPlan(), INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, lfirst_node, lnext(), make_parsestate(), ExecuteStmt::name, CachedPlanSource::num_params, ParseState::p_sourcetext, ExecuteStmt::params, pgBufferUsage, PreparedStatement::plansource, CachedPlanSource::query_string, ReleaseCachedPlan(), CachedPlan::stmt_list, and PlannedStmt::utilityStmt.
Referenced by ExplainOneUtility().
PreparedStatement* FetchPreparedStatement | ( | const char * | stmt_name, |
bool | throwError | ||
) |
Definition at line 467 of file prepare.c.
References ereport, errcode(), errmsg(), ERROR, HASH_FIND, and hash_search().
Referenced by DropPreparedStatement(), errdetail_execute(), exec_bind_message(), exec_describe_statement_message(), ExecuteQuery(), ExplainExecuteQuery(), FetchStatementTargetList(), GetCommandLogLevel(), UtilityReturnsTuples(), and UtilityTupleDescriptor().
TupleDesc FetchPreparedStatementResultDesc | ( | PreparedStatement * | stmt | ) |
Definition at line 499 of file prepare.c.
References Assert, CreateTupleDescCopy(), CachedPlanSource::fixed_result, PreparedStatement::plansource, and CachedPlanSource::resultDesc.
Referenced by UtilityTupleDescriptor().
List* FetchPreparedStatementTargetList | ( | PreparedStatement * | stmt | ) |
Definition at line 522 of file prepare.c.
References CachedPlanGetTargetList(), copyObject, and PreparedStatement::plansource.
Referenced by FetchStatementTargetList().
void PrepareQuery | ( | ParseState * | pstate, |
PrepareStmt * | stmt, | ||
int | stmt_location, | ||
int | stmt_len | ||
) |
Definition at line 58 of file prepare.c.
References PrepareStmt::argtypes, CMD_DELETE, CMD_INSERT, CMD_SELECT, CMD_UPDATE, Query::commandType, CompleteCachedPlan(), copyObject, CreateCachedPlan(), CreateCommandTag(), CURSOR_OPT_PARALLEL_OK, ereport, errcode(), errmsg(), ERROR, i, InvalidOid, lfirst, list_length(), makeNode, PrepareStmt::name, ParseState::p_sourcetext, palloc(), parse_analyze_varparams(), PrepareStmt::query, QueryRewrite(), RawStmt::stmt, RawStmt::stmt_len, RawStmt::stmt_location, StorePreparedStatement(), and typenameTypeId().
Referenced by standard_ProcessUtility().
void StorePreparedStatement | ( | const char * | stmt_name, |
CachedPlanSource * | plansource, | ||
bool | from_sql | ||
) |
Definition at line 425 of file prepare.c.
References ereport, errcode(), errmsg(), ERROR, PreparedStatement::from_sql, GetCurrentStatementStartTimestamp(), HASH_ENTER, hash_search(), InitQueryHashTable(), PreparedStatement::plansource, PreparedStatement::prepare_time, and SaveCachedPlan().
Referenced by exec_parse_message(), and PrepareQuery().