Re: EXPLAIN, utility statement parameters, and recent plpgsql changes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: EXPLAIN, utility statement parameters, and recent plpgsql changes
Дата
Msg-id 27812.1263497961@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: EXPLAIN, utility statement parameters, and recent plpgsql changes  (Dimitri Fontaine <dfontaine@hi-media.com>)
Ответы Re: EXPLAIN, utility statement parameters, and recent plpgsql changes
Список pgsql-hackers
Dimitri Fontaine <dfontaine@hi-media.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> This works well enough for regular DML statements, but it falls down for
>> EXPLAIN which is a utility statement, because *parse analysis of utility
>> statements doesn't do anything*.  EXPLAIN actually does the parse
>> analysis of its contained statement at the beginning of execution.
>> And that is too late, in the scenario Pavel exhibited.  Why is it too
>> late?  Because SPI_cursor_open_internal() intentionally "freezes" the
>> ParamListInfo struct after doing initial parsing: what it copies into
>> the cursor portal is just a static list of data values without the
>> parser hooks (see copyParamList).

> Would it make any sense for this function to get to call the hook in the
> case a utility statement is being processed?

Well, the point of the hook is to change the results of parse
transformation, so just calling it doesn't do much --- you have to apply
the whole parse analysis process, *and keep the resulting tree*.
        regards, tom lane


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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Streaming replication, retrying from archive
Следующее
От: Tom Lane
Дата:
Сообщение: Re: EXPLAIN, utility statement parameters, and recent plpgsql changes