aboutsummaryrefslogtreecommitdiff
path: root/src/include/nodes/parsenodes.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-03-27 15:14:13 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-03-27 15:17:40 -0400
commita40fa613b516b97c37d87ac1b21fb7aa8a2f2c1b (patch)
tree1284edc47dc0dc6d84e3ae83aa64026a0aac66c6 /src/include/nodes/parsenodes.h
parent40b9b957694cf7749c420c6c51a7e1d3c9b1fec1 (diff)
downloadpostgresql-a40fa613b516b97c37d87ac1b21fb7aa8a2f2c1b.tar.gz
postgresql-a40fa613b516b97c37d87ac1b21fb7aa8a2f2c1b.zip
Add some infrastructure for contrib/pg_stat_statements.
Add a queryId field to Query and PlannedStmt. This is not used by the core backend, except for being copied around at appropriate times. It's meant to allow plug-ins to track a particular query forward from parse analysis to execution. The queryId is intentionally not dumped into stored rules (and hence this commit doesn't bump catversion). You could argue that choice either way, but it seems better that stored rule strings not have any dependency on plug-ins that might or might not be present. Also, add a post_parse_analyze_hook that gets invoked at the end of parse analysis (but only for top-level analysis of complete queries, not cases such as analyzing a domain's default-value expression). This is mainly meant to be used to compute and assign a queryId, but it could have other applications. Peter Geoghegan
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r--src/include/nodes/parsenodes.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 07a1ab75502..bc9b6bd774c 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -103,6 +103,8 @@ typedef struct Query
QuerySource querySource; /* where did I come from? */
+ uint32 queryId; /* query identifier (can be set by plugins) */
+
bool canSetTag; /* do I set the command result tag? */
Node *utilityStmt; /* non-null if this is DECLARE CURSOR or a