]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Pass cursorOptions to planner_setup_hook.
authorRobert Haas <rhaas@postgresql.org>
Tue, 10 Feb 2026 16:50:28 +0000 (11:50 -0500)
committerRobert Haas <rhaas@postgresql.org>
Tue, 10 Feb 2026 16:50:28 +0000 (11:50 -0500)
Commit 94f3ad3961a2cb32d30c79f01a70db4caff13318 failed to do this
because I couldn't think of a use for the information, but this has
proven to be short-sighted. Best to fix it before this code is
officially released.

Now, the only argument to standard_planenr that isn't passed to
planner_setup_hook is boundParams, but that is accessible via
glob->boundParams, and so doesn't need to be passed separately.

Discussion: https://www.postgresql.org/message-id/CA+TgmoYS4ZCVAF2jTce=bMP0Oq_db_srocR4cZyO0OBp9oUoGg@mail.gmail.com

src/backend/optimizer/plan/planner.c
src/include/optimizer/planner.h

index 757bdc7b1de4b94370eae499c7c036dd3b1fd3c3..0c93f41ffff67d9a598e552682db1f4fa90827bf 100644 (file)
@@ -511,7 +511,8 @@ standard_planner(Query *parse, const char *query_string, int cursorOptions,
 
        /* Allow plugins to take control after we've initialized "glob" */
        if (planner_setup_hook)
-               (*planner_setup_hook) (glob, parse, query_string, &tuple_fraction, es);
+               (*planner_setup_hook) (glob, parse, query_string, cursorOptions,
+                                                          &tuple_fraction, es);
 
        /* primary planning entry point (may recurse for subqueries) */
        root = subquery_planner(glob, parse, NULL, NULL, false, tuple_fraction,
index ae3f7f2edb61ef80b92f502b951f189aa52e33fd..80509773c01bd2a057a16143a234c7bde65b0766 100644 (file)
@@ -35,6 +35,7 @@ extern PGDLLIMPORT planner_hook_type planner_hook;
 /* Hook for plugins to get control after PlannerGlobal is initialized */
 typedef void (*planner_setup_hook_type) (PlannerGlobal *glob, Query *parse,
                                                                                 const char *query_string,
+                                                                                int cursorOptions,
                                                                                 double *tuple_fraction,
                                                                                 ExplainState *es);
 extern PGDLLIMPORT planner_setup_hook_type planner_setup_hook;