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

From Heikki Linnakangas
Subject Re: Access to dynamic SQL in PL/pgSQL
Date
Msg-id 4B598E59.7040909@enterprisedb.com
Whole thread Raw
In response to Access to dynamic SQL in PL/pgSQL  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Access to dynamic SQL in PL/pgSQL  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
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?

--  Heikki Linnakangas EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Streaming Replication on win32
Next
From: Simon Riggs
Date:
Subject: Re: Access to dynamic SQL in PL/pgSQL