Re: Extension to rewrite queries before execution

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Extension to rewrite queries before execution
Дата
Msg-id CAECtzeWmgUUKGAg6jp52fcy-s7TL8O4+fKP_v0+z2j_iqMTasw@mail.gmail.com
обсуждение исходный текст
Ответ на Extension to rewrite queries before execution  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-general

Hi,

Le 13 août 2015 9:51 PM, "Jeff Janes" <jeff.janes@gmail.com> a écrit :
>
> I am looking for an extension or a technique that will allow me to intercept a query by the exact query text, and replace that query with a different one.
>
> The context is running a third-party app which issues queries I have no control over.  I'd like to intercept a specific query (which has no bind parameters) and either replace the query text with a different text which, for example, swaps out an "in list" clause to instead be an "exists (subquery)". 
>
> Or just wrap the query in a "set enable_* =off;" or "set work_mem=*;" before and a reset of it after.
>
> Is there anything out there like this?  This would be for 9.4.
>
> I'm willing to put the query text, and its replacement, directly into the extension source code and compile it, but of course something more flexible would be ideal.
>

I know of no extension that does this, even if the idea is rather interesting. I don't remember if there is any hook that would allow such a thing. But that is definitely interesting.

--
Guillaume.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Foreign Keys as first class citizens at design time?
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: Extension to rewrite queries before execution