Extension to rewrite queries before execution

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Extension to rewrite queries before execution
Дата
Msg-id CAMkU=1zhqfwU5cxvWeqX5DM67+u64z2_mwNETEBMarDn7ZrWGA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Extension to rewrite queries before execution  (Melvin Davidson <melvin6925@gmail.com>)
Re: Extension to rewrite queries before execution  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: Extension to rewrite queries before execution  (Guillaume Lelarge <guillaume@lelarge.info>)
Re: Extension to rewrite queries before execution  (Tatsuo Ishii <ishii@postgresql.org>)
Re: Extension to rewrite queries before execution  (Andy Colson <andy@squeakycode.net>)
Re: Extension to rewrite queries before execution  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Список pgsql-general
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.

Thanks,

Jeff

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

Предыдущее
От: Melvin Davidson
Дата:
Сообщение: Re: I am unable to install PostgreSql
Следующее
От: twoflower
Дата:
Сообщение: Re: SELECT blocks UPDATE