Re: best way to determine start of new statement within

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: best way to determine start of new statement within
Дата
Msg-id 3F214D42.1040702@joeconway.com
обсуждение исходный текст
Ответ на Re: best way to determine start of new statement within a function?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: best way to determine start of new statement within
Список pgsql-hackers
Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>>Specifically I'd like to reset a variable within my PL/R interpreter 
>>each time a new SQL statement begins.
> 
> Define "new SQL statement".  In particular, what of a PL function
> executing multiple SQL statements inside an outer SQL statement that
> invoked the function?  Unless you've got a clear idea of the semantics
> you want, it's not going to be very profitable to discuss
> implementations ...
> 

Well, I guess in a situation like this:
a)  SELECT * FROM myfunc1()...
where myfunc1() executes via spi
b)      SELECT * FROM myfunc2()...

I'd be interested in being able to detect when outer statement (a) 
starts, as well as the fact that it is at nesting level 0. And similarly 
it would be nice to be able to detect when statement (b) starts along 
with the fact that it is at nesting level 1. But for the moment, I'd be 
happy with just the former.

Joe



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: flex 2.5.31
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: libpq_r