Include a pointer to the query's source text in QueryDesc structs. This is
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/copy.c | modified | +3 −2 |
| src/backend/commands/explain.c | modified | +6 −5 |
| src/backend/commands/prepare.c | modified | +10 −3 |
| src/backend/executor/functions.c | modified | +3 −1 |
| src/backend/executor/spi.c | modified | +2 −1 |
| src/backend/tcop/pquery.c | modified | +12 −2 |
| src/include/commands/explain.h | modified | +5 −3 |
| src/include/executor/execdesc.h | modified | +4 −1 |