mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
Include a pointer to the query's source text in QueryDesc structs. This is
practically free given prior 8.4 changes in plancache and portal management, and it makes it a lot easier for ExecutorStart/Run/End hooks to get at the query text. Extracted from Itagaki Takahiro's pg_stat_statements patch, with minor editorialization.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/executor/execdesc.h,v 1.39 2009/01/01 17:23:59 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/executor/execdesc.h,v 1.40 2009/01/02 20:42:00 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -37,6 +37,7 @@ typedef struct QueryDesc
|
||||
CmdType operation; /* CMD_SELECT, CMD_UPDATE, etc. */
|
||||
PlannedStmt *plannedstmt; /* planner's output, or null if utility */
|
||||
Node *utilitystmt; /* utility statement, or null */
|
||||
const char *sourceText; /* source text of the query */
|
||||
Snapshot snapshot; /* snapshot to use for query */
|
||||
Snapshot crosscheck_snapshot; /* crosscheck for RI update/delete */
|
||||
DestReceiver *dest; /* the destination for tuple output */
|
||||
@@ -54,6 +55,7 @@ typedef struct QueryDesc
|
||||
|
||||
/* in pquery.c */
|
||||
extern QueryDesc *CreateQueryDesc(PlannedStmt *plannedstmt,
|
||||
const char *sourceText,
|
||||
Snapshot snapshot,
|
||||
Snapshot crosscheck_snapshot,
|
||||
DestReceiver *dest,
|
||||
@@ -61,6 +63,7 @@ extern QueryDesc *CreateQueryDesc(PlannedStmt *plannedstmt,
|
||||
bool doInstrument);
|
||||
|
||||
extern QueryDesc *CreateUtilityQueryDesc(Node *utilitystmt,
|
||||
const char *sourceText,
|
||||
Snapshot snapshot,
|
||||
DestReceiver *dest,
|
||||
ParamListInfo params);
|
||||
|
Reference in New Issue
Block a user