Fix indentation in twophase.c
[pgsql.git] / src / include / commands / prepare.h
blob79f161561e504963122af2c4e18e6bfe3bee2e85
1 /*-------------------------------------------------------------------------
3 * prepare.h
4 * PREPARE, EXECUTE and DEALLOCATE commands, and prepared-stmt storage
7 * Copyright (c) 2002-2023, PostgreSQL Global Development Group
9 * src/include/commands/prepare.h
11 *-------------------------------------------------------------------------
13 #ifndef PREPARE_H
14 #define PREPARE_H
16 #include "commands/explain.h"
17 #include "datatype/timestamp.h"
18 #include "utils/plancache.h"
21 * The data structure representing a prepared statement. This is now just
22 * a thin veneer over a plancache entry --- the main addition is that of
23 * a name.
25 * Note: all subsidiary storage lives in the referenced plancache entry.
27 typedef struct
29 /* dynahash.c requires key to be first field */
30 char stmt_name[NAMEDATALEN];
31 CachedPlanSource *plansource; /* the actual cached plan */
32 bool from_sql; /* prepared via SQL, not FE/BE protocol? */
33 TimestampTz prepare_time; /* the time when the stmt was prepared */
34 } PreparedStatement;
37 /* Utility statements PREPARE, EXECUTE, DEALLOCATE, EXPLAIN EXECUTE */
38 extern void PrepareQuery(ParseState *pstate, PrepareStmt *stmt,
39 int stmt_location, int stmt_len);
40 extern void ExecuteQuery(ParseState *pstate,
41 ExecuteStmt *stmt, IntoClause *intoClause,
42 ParamListInfo params,
43 DestReceiver *dest, QueryCompletion *qc);
44 extern void DeallocateQuery(DeallocateStmt *stmt);
45 extern void ExplainExecuteQuery(ExecuteStmt *execstmt, IntoClause *into,
46 ExplainState *es, const char *queryString,
47 ParamListInfo params, QueryEnvironment *queryEnv);
49 /* Low-level access to stored prepared statements */
50 extern void StorePreparedStatement(const char *stmt_name,
51 CachedPlanSource *plansource,
52 bool from_sql);
53 extern PreparedStatement *FetchPreparedStatement(const char *stmt_name,
54 bool throwError);
55 extern void DropPreparedStatement(const char *stmt_name, bool showError);
56 extern TupleDesc FetchPreparedStatementResultDesc(PreparedStatement *stmt);
57 extern List *FetchPreparedStatementTargetList(PreparedStatement *stmt);
59 extern void DropAllPreparedStatements(void);
61 #endif /* PREPARE_H */