Re: Deparsing rewritten query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Deparsing rewritten query
Дата
Msg-id 3176554.1624804492@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Deparsing rewritten query  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: Deparsing rewritten query  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-hackers
Julien Rouhaud <rjuju123@gmail.com> writes:
> As an alternative, maybe we could expose a simple SRF that would take care of
> rewriting the query and deparsing the resulting query tree(s)?

I'm not really excited by this, as it seems like it's exposing internal
decisions we could change someday; to wit, first that there is any such
thing as a separate rewriting pass, and second that its output is
interpretable as pure SQL.  (TBH, I'm not 100% sure that the second
assumption is true even today, although I know there are ancient comments
that claim that.)  It's not very hard to imagine someday moving view
expansion into the planner on efficiency grounds, leaving the rewriter
handling only the rare uses of INSERT/UPDATE/DELETE rules.

If there's functions in ruleutils.c that we'd need to make public to
let somebody write a debugging extension that does this kind of thing,
I'd be happier with that approach than with creating a core-server SQL
function for it.  There might be more than one use-case for the
exposed bits.

            regards, tom lane



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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: Deparsing rewritten query
Следующее
От: Andrew Dunstan
Дата:
Сообщение: code fork June 28th