Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / include / commands / prepare.h
blobbf16bd347f28ac09b738f35eec9e7129795248a5
1 /*-------------------------------------------------------------------------
3 * prepare.h
4 * PREPARE, EXECUTE and DEALLOCATE commands, and prepared-stmt storage
7 * Copyright (c) 2002-2009, PostgreSQL Global Development Group
9 * $PostgreSQL$
11 *-------------------------------------------------------------------------
13 #ifndef PREPARE_H
14 #define PREPARE_H
16 #include "executor/executor.h"
17 #include "utils/plancache.h"
18 #include "utils/timestamp.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(PrepareStmt *stmt, const char *queryString);
39 extern void ExecuteQuery(ExecuteStmt *stmt, const char *queryString,
40 ParamListInfo params,
41 DestReceiver *dest, char *completionTag);
42 extern void DeallocateQuery(DeallocateStmt *stmt);
43 extern void ExplainExecuteQuery(ExecuteStmt *execstmt, ExplainStmt *stmt,
44 const char *queryString,
45 ParamListInfo params, TupOutputState *tstate);
47 /* Low-level access to stored prepared statements */
48 extern void StorePreparedStatement(const char *stmt_name,
49 Node *raw_parse_tree,
50 const char *query_string,
51 const char *commandTag,
52 Oid *param_types,
53 int num_params,
54 int cursor_options,
55 List *stmt_list,
56 bool from_sql);
57 extern PreparedStatement *FetchPreparedStatement(const char *stmt_name,
58 bool throwError);
59 extern void DropPreparedStatement(const char *stmt_name, bool showError);
60 extern TupleDesc FetchPreparedStatementResultDesc(PreparedStatement *stmt);
61 extern List *FetchPreparedStatementTargetList(PreparedStatement *stmt);
63 void DropAllPreparedStatements(void);
65 #endif /* PREPARE_H */