Re: Is there a way to view a rewritten query?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jonathan Knopp <pgsql(at)delegated(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is there a way to view a rewritten query?
Date: 2004-12-03 16:42:44
Message-ID: 22245.1102092164@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jonathan Knopp <pgsql(at)delegated(dot)net> writes:
> I'm trying to set up some complex rules and having a hard time figuring
> out why they won't work. Being able to see the query after all the rules
> have been applied would be a huge help, but I can't seem to find a way
> to do this. log_statement only shows the original. debug_print_rewritten
> works, but displays it in such a way as to be virtually unusable.

Sorry, but that's all there is. The rewriter isn't a source-to-source
transformation.

(If you feel like hacking, it might be interesting to try applying
the ruleutils.c functions to the rewritten querytree, but I'm quite
unsure how readable the result will be.)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-12-03 17:21:00 Re: Indexes?
Previous Message Leonardo Mateo 2004-12-03 16:30:44 Older Windows versions