Re: Access to dynamic SQL in PL/pgSQL

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Access to dynamic SQL in PL/pgSQL
Date: 2010-01-22 10:41:54
Message-ID: 162867791001220241l6e85de5eh658724f8e70dbbd0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/1/22 Simon Riggs <simon(at)2ndquadrant(dot)com>:
>
> 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.

can you show some example, please?

Pavel

>
> 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.
>
> Would a patch to make this simple change be acceptable? It would need to
> be backpatched to 8.1 also?
>
> --
>  Simon Riggs           www.2ndQuadrant.com
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2010-01-22 11:00:35 Re: Access to dynamic SQL in PL/pgSQL
Previous Message Simon Riggs 2010-01-22 10:32:45 Access to dynamic SQL in PL/pgSQL