diff options
author | Tom Lane | 2007-04-16 01:14:58 +0000 |
---|---|---|
committer | Tom Lane | 2007-04-16 01:14:58 +0000 |
commit | a98f9038e12842e78dd66173827abbd762f85ba3 (patch) | |
tree | b36d3a832a5aa3bb35ca05ba69d00c50fb969db7 /src/backend/commands/explain.c | |
parent | 02a0f389c09d167ac522689acf3b6f0d178ba446 (diff) |
Expose more cursor-related functionality in SPI: specifically, allow
access to the planner's cursor-related planning options, and provide new
FETCH/MOVE routines that allow access to the full power of those commands.
Small refactoring of planner(), pg_plan_query(), and pg_plan_queries()
APIs to make it convenient to pass the planning options down from SPI.
This is the core-code portion of Pavel Stehule's patch for scrollable
cursor support in plpgsql; I'll review and apply the plpgsql changes
separately.
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r-- | src/backend/commands/explain.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 29be816576..6981da0eea 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -42,7 +42,7 @@ typedef struct ExplainState List *rtable; /* range table */ } ExplainState; -static void ExplainOneQuery(Query *query, bool isCursor, int cursorOptions, +static void ExplainOneQuery(Query *query, int cursorOptions, ExplainStmt *stmt, const char *queryString, ParamListInfo params, TupOutputState *tstate); static double elapsed_time(instr_time *starttime); @@ -102,7 +102,7 @@ ExplainQuery(ExplainStmt *stmt, const char *queryString, /* Explain every plan */ foreach(l, rewritten) { - ExplainOneQuery((Query *) lfirst(l), false, 0, + ExplainOneQuery((Query *) lfirst(l), 0, stmt, queryString, params, tstate); /* put a blank line between plans */ if (lnext(l) != NULL) @@ -134,7 +134,7 @@ ExplainResultDesc(ExplainStmt *stmt) * print out the execution plan for one Query */ static void -ExplainOneQuery(Query *query, bool isCursor, int cursorOptions, +ExplainOneQuery(Query *query, int cursorOptions, ExplainStmt *stmt, const char *queryString, ParamListInfo params, TupOutputState *tstate) { @@ -150,7 +150,7 @@ ExplainOneQuery(Query *query, bool isCursor, int cursorOptions, } /* plan the query */ - plan = planner(query, isCursor, cursorOptions, params); + plan = planner(query, cursorOptions, params); /* * Update snapshot command ID to ensure this query sees results of any @@ -229,7 +229,7 @@ ExplainOneUtility(Node *utilityStmt, ExplainStmt *stmt, /* do not actually execute the underlying query! */ memcpy(&newstmt, stmt, sizeof(ExplainStmt)); newstmt.analyze = false; - ExplainOneQuery(query, true, dcstmt->options, &newstmt, + ExplainOneQuery(query, dcstmt->options, &newstmt, queryString, params, tstate); } else if (IsA(utilityStmt, ExecuteStmt)) |