Re: Auto-explain patch - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Auto-explain patch
Date
Msg-id 1215602576.4051.1030.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: Auto-explain patch  (Dean Rasheed <dean_rasheed@hotmail.com>)
Responses Re: Auto-explain patch  (Dean Rasheed <dean_rasheed@hotmail.com>)
List pgsql-hackers
On Wed, 2008-07-09 at 09:11 +0000, Dean Rasheed wrote:
> Simon, I like your proposal, and I think I can see how to code it
> fairly easily.
> 
> There is one thing that it doesn't allow, however, which the debug_xxx
> parameters do, and that is for a non-superuser to trace SQL used in
> functions, from an interactive client session. For me, this is quite a
> big thing, because I find it most convienient to turn these parameters
> on while writing and tweaking stored procedures, and have the output
> go straight to my psql window, without having to connect as a superuser
> and trawl through log files.

Understood.

> So I suggest grouping these parameters in their own category
> (eg. "sql_trace") and then having additional parameters to control
> where the output would go. So the sql_trace parameters would be:
> 
> * sql_trace_min_planner_duration
> * sql_trace_min_executor_duration
> * sql_trace_explain_plan
> 
> and they would work exactly as you describe, except they would be
> settable by normal users. 

This is already possible, if your crafty.

> Then the destination(s) for the statement
> and EXPLAIN logging would be controlled by:
> 
> * client_sql_trace = on | off - settable by a normal user to allow a
> client session to see the sql_trace output. If this parameter is on,
> the sql_trace will be logged as NOTICE output.

Just set client_min_messages = 'LOG';

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



pgsql-hackers by date:

Previous
From: "Marko Kreen"
Date:
Subject: review: table function support
Next
From: "Marko Kreen"
Date:
Subject: Re: Auto-explain patch