BUG #2258: debug_print_plan doesn't work for cursors - Mailing list pgsql-bugs

From James Gray
Subject BUG #2258: debug_print_plan doesn't work for cursors
Date
Msg-id 20060213175218.247CDF0B05@svr2.postgresql.org
Whole thread Raw
List pgsql-bugs
The following bug has been logged online:

Bug reference:      2258
Logged by:          James Gray
Email address:      jim.gray@bull.com
PostgreSQL version: 8.1.2
Operating system:   Linux/Windows
Description:        debug_print_plan doesn't work for cursors
Details:

Feature request: Allow debug_print_plan to produce log output for DECLARE
CURSOR statements (or on the first FETCH). The TODO FAQ does not list this
feature, nor does the mail archives discuss it. Looking at the Postgres
source for pg_plan_query() shows that DECLARE CURSOR is considered a utility
command, and currently does not produce log output for debug_print_plan.
However, EXPLAIN does allow a DECLARE CURSOR statement using a further
statement type check. We have a large customer/application with performance
problems related to a few of a large number of embedded cursors, and this
feature would help isolate the problem more rapidly. The cursors are all of
the type for which SPI_IS_CURSOR_PLAN would return TRUE.  We could do a
Postgres source change ourselves, but we are not sure that it is as simple
as adding: if (Debug_print_plan) elog_node_display(DEBUG1, "plan", plan,
debug_pretty_print)  after the call to planner() in the routine
PerformCursorOpen().

pgsql-bugs by date:

Previous
From: "maoke"
Date:
Subject: BUG #2256: install problem
Next
From: Tom Lane
Date:
Subject: Re: BUG #2246: Bad malloc interactions: ecpg, openssl