Access to dynamic SQL in PL/pgSQL

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Access to dynamic SQL in PL/pgSQL
Дата
Msg-id 1264156365.4043.14197.camel@ebony
обсуждение исходный текст
Ответы Re: Access to dynamic SQL in PL/pgSQL  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Access to dynamic SQL in PL/pgSQL  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: Access to dynamic SQL in PL/pgSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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.

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Marko Kreen
Дата:
Сообщение: Re: Streaming Replication on win32
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Access to dynamic SQL in PL/pgSQL