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, ParseState *pstate, ParamListInfo params) |
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 502 of file prepare.c.
References DropAllPreparedStatements(), DropPreparedStatement(), and stmt.
Referenced by standard_ProcessUtility().
void DropAllPreparedStatements | ( | void | ) |
Definition at line 537 of file prepare.c.
References DropCachedPlan(), HASH_REMOVE, hash_search(), hash_seq_init(), hash_seq_search(), PreparedStatement::plansource, prepared_queries, and PreparedStatement::stmt_name.
Referenced by DeallocateQuery(), and DiscardAll().
void DropPreparedStatement | ( | const char * | stmt_name, |
bool | showError | ||
) |
Definition at line 516 of file prepare.c.
References DropCachedPlan(), FetchPreparedStatement(), HASH_REMOVE, hash_search(), PreparedStatement::plansource, prepared_queries, 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 147 of file prepare.c.
References CMD_SELECT, CachedPlanSource::commandTag, PlannedStmt::commandType, CreateExecutorState(), CreateNewPortal(), generate_unaccent_rules::dest, 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(), CachedPlanSource::num_params, PreparedStatement::plansource, PortalData::portalContext, PortalDefineQuery(), PortalDrop(), PortalRun(), PortalStart(), CachedPlanSource::query_string, IntoClause::skipData, stmt, CachedPlan::stmt_list, and PortalData::visible.
Referenced by ExecCreateTableAs(), and standard_ProcessUtility().
void ExplainExecuteQuery | ( | ExecuteStmt * | execstmt, |
IntoClause * | into, | ||
ExplainState * | es, | ||
ParseState * | pstate, | ||
ParamListInfo | params | ||
) |
Definition at line 568 of file prepare.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, ExplainState::buffers, BufferUsageAccumDiff(), CMD_UTILITY, PlannedStmt::commandType, CreateExecutorState(), CurrentMemoryContext, 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, IsA, lfirst_node, lnext(), make_parsestate(), ExplainState::memory, MemoryContextMemConsumed(), MemoryContextSwitchTo(), ExecuteStmt::name, CachedPlanSource::num_params, ParseState::p_queryEnv, 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 431 of file prepare.c.
References ereport, errcode(), errmsg(), ERROR, HASH_FIND, hash_search(), and prepared_queries.
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 463 of file prepare.c.
References Assert, CreateTupleDescCopy(), and stmt.
Referenced by UtilityTupleDescriptor().
List* FetchPreparedStatementTargetList | ( | PreparedStatement * | stmt | ) |
Definition at line 486 of file prepare.c.
References CachedPlanGetTargetList(), copyObject, and stmt.
Referenced by FetchStatementTargetList().
void PrepareQuery | ( | ParseState * | pstate, |
PrepareStmt * | stmt, | ||
int | stmt_location, | ||
int | stmt_len | ||
) |
Definition at line 56 of file prepare.c.
References CompleteCachedPlan(), CreateCachedPlan(), CreateCommandTag(), CURSOR_OPT_PARALLEL_OK, ereport, errcode(), errmsg(), ERROR, i, lfirst, list_length(), makeNode, ParseState::p_sourcetext, palloc_array, pg_analyze_and_rewrite_varparams(), RawStmt::stmt, 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 389 of file prepare.c.
References ereport, errcode(), errmsg(), ERROR, PreparedStatement::from_sql, GetCurrentStatementStartTimestamp(), HASH_ENTER, hash_search(), InitQueryHashTable(), PreparedStatement::plansource, PreparedStatement::prepare_time, prepared_queries, and SaveCachedPlan().
Referenced by exec_parse_message(), and PrepareQuery().