Re: [GENERAL] Extension to rewrite queries before execution

2015-08-16 Thread Kyotaro HORIGUCHI
Hi, although I don't see what exactly you want to do, > 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 > cont

Re: [GENERAL] Extension to rewrite queries before execution

2015-08-14 Thread Andy Colson
On 8/13/2015 2:49 PM, Jeff Janes wrote: 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 in

Re: [GENERAL] Extension to rewrite queries before execution

2015-08-14 Thread Melvin Davidson
Jeff, although it would be tedious, you could write a trigger of the form BEFORE INSERT ON yatta_yatta EXECUTE PROCEDURE check_rewrite; Then in check_rewrite, you could examine the contents of pg_stat_activity.query column for the current process and act accordingly. I acknowledge that it will im

Re: [GENERAL] Extension to rewrite queries before execution

2015-08-14 Thread Adrian Klaver
On 08/14/2015 08:56 AM, Jeff Janes wrote: On Thu, Aug 13, 2015 at 2:02 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 08/13/2015 12:49 PM, Jeff Janes wrote: I am looking for an extension or a technique that will allow me to intercept a query by the exact quer

Re: [GENERAL] Extension to rewrite queries before execution

2015-08-14 Thread Jeff Janes
On Thu, Aug 13, 2015 at 2:02 PM, Adrian Klaver wrote: > On 08/13/2015 12:49 PM, Jeff Janes wrote: > >> 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. >> > > What is sending the query?

Re: [GENERAL] Extension to rewrite queries before execution

2015-08-14 Thread Jeff Janes
> On Thu, Aug 13, 2015 at 1:37 PM, Melvin Davidson wrote: > On Thu, Aug 13, 2015 at 3:49 PM, Jeff Janes wrote: > >> 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

Re: [GENERAL] Extension to rewrite queries before execution

2015-08-13 Thread Tatsuo Ishii
> 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 (whic

Re: [GENERAL] Extension to rewrite queries before execution

2015-08-13 Thread Guillaume Lelarge
Hi, Le 13 août 2015 9:51 PM, "Jeff Janes" 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 ov

Re: [GENERAL] Extension to rewrite queries before execution

2015-08-13 Thread Martín Marqués
El 13/08/15 a las 17:37, Melvin Davidson escribió: > You have not stated which Version or PostgreSQL, He said it was for 9.4. >> Is there anything out there like this? This would be for 9.4. -- Martín Marquéshttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Tr

Re: [GENERAL] Extension to rewrite queries before execution

2015-08-13 Thread Adrian Klaver
On 08/13/2015 12:49 PM, Jeff Janes wrote: 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. What is sending the query? In other words what library is the app using to communicate with the

Re: [GENERAL] Extension to rewrite queries before execution

2015-08-13 Thread Melvin Davidson
You have not stated which Version or PostgreSQL, nor the O/S involved. That being said, depending on what the specific query is, you might consider using a Rule or Trigger to handle it. If you use a Trigger ( which is the preferred method) you can also embed "set" commands the associated function.

[GENERAL] Extension to rewrite queries before execution

2015-08-13 Thread Jeff Janes
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 bin