Skip to content

Commit e2f9205

Browse files
robertmhaasCommitfest Bot
authored andcommitted
Add extension_state member to PlannedStmt.
Extensions can stash data computed at plan time into this list using planner_shutdown_hook (or perhaps other mechanisms) and then access it from any code that has access to the PlannedStmt (such as explain hooks), allowing for extensible debugging and instrumentation of plans.
1 parent 97ed255 commit e2f9205

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/include/nodes/plannodes.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ typedef struct PlannedStmt
149149
/* non-null if this is utility stmt */
150150
Node *utilityStmt;
151151

152+
/*
153+
* DefElem objects added by extensions, e.g. using planner_shutdown_hook
154+
*
155+
* Set each DefElem's defname to the name of the plugin or extension, and
156+
* the argument to a tree of nodes that all have copy and read/write
157+
* support.
158+
*/
159+
List *extension_state;
160+
152161
/* statement location in source string (copied from Query) */
153162
/* start location, or -1 if unknown */
154163
ParseLoc stmt_location;

0 commit comments

Comments
 (0)