pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Goti <aryan.goti@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: How to find the final transformed query in postgresql
Date: Mon, 18 Apr 2022 10:13:03 -0400
Message-ID: <2268716.1650291183@sss.pgh.pa.us> (raw)
In-Reply-To: <CAOzfMuqvzJxty9CXyvkkkc4N6Z6Y+iSyuV59XFYe+vJjdsRnTQ@mail.gmail.com>
References: <CAOzfMuqvzJxty9CXyvkkkc4N6Z6Y+iSyuV59XFYe+vJjdsRnTQ@mail.gmail.com>

Goti <aryan.goti@gmail.com> writes:
>  I would like to know if postgres performs any transformations when it does
> the parsing?

This might be helpful reading:

https://www.postgresql.org/docs/current/overview.html

> If yes, is there a way we can get the final transformed query?

See debug_print_parse and friends [1].  Depending on what you mean by
"final transformed query", you might instead want debug_print_rewritten,
or maybe you want the plan, in which case EXPLAIN is a much friendlier
way to look at it than debug_print_plan.

			regards, tom lane

[1] https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT





view thread (3+ messages)  latest in thread

Message-ID: <2268716.1650291183@sss.pgh.pa.us>
Permalink:  ../2268716.1650291183@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2268716.1650291183@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, aryan.goti@gmail.com
  Subject: Re: How to find the final transformed query in postgresql
  In-Reply-To: <2268716.1650291183@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox