1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +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:
Tom Lane
2009-01-02 20:42:00 +00:00
parent ccd31eb861
commit bbeb0bbf6b
8 changed files with 45 additions and 18 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.131 2009/01/01 17:23:41 momjian Exp $
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.132 2009/01/02 20:42:00 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -411,11 +411,13 @@ postquel_start(execution_state *es, SQLFunctionCachePtr fcache)
if (IsA(es->stmt, PlannedStmt))
es->qd = CreateQueryDesc((PlannedStmt *) es->stmt,
fcache->src,
snapshot, InvalidSnapshot,
dest,
fcache->paramLI, false);
else
es->qd = CreateUtilityQueryDesc(es->stmt,
fcache->src,
snapshot,
dest,
fcache->paramLI);