Re: Access to dynamic SQL in PL/pgSQL - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Access to dynamic SQL in PL/pgSQL
Date
Msg-id 1264161241.4043.14467.camel@ebony
Whole thread Raw
In response to Re: Access to dynamic SQL in PL/pgSQL  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Fri, 2010-01-22 at 13:39 +0200, Heikki Linnakangas wrote:
> Simon Riggs wrote:
> > It's not currently possible to access the SQL used in a dynamic PL/pgSQL
> > statement using a PL/pgSQL plugin.
> > 
> > In src/pl/plpgsql/src/pl_exec.c's exec_stmt() we call each dynamic
> > statement type, evaluate the SQL and free memory again before the plugin
> > gains control again.
> > 
> > It seems simple to attach querystr to PLpgSQL_execstate and free it
> > after the plugin has seen it. The difference in lifetime of the memory
> > allocation is very small.
> 
> Is this for pl/debugger? How would you use the query string there?

Yes, PL/debugger would have access to the text of the dynamic SQL
string.

-- Simon Riggs           www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Access to dynamic SQL in PL/pgSQL
Next
From: Pavel Stehule
Date:
Subject: Re: quoting psql varible as identifier