Re: Deparsing rewritten query

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Gilles Darold <gilles(at)darold(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Deparsing rewritten query
Date: 2022-02-02 18:49:41
Message-ID: CAFj8pRDXeBBtdAt=tKhbptCmpmokQj+sG2Enod8rg0Gt3eDdbw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

st 2. 2. 2022 v 15:18 odesílatel Julien Rouhaud <rjuju123(at)gmail(dot)com> napsal:

> Hi,
>
> On Tue, Feb 01, 2022 at 08:35:00PM +0100, Pavel Stehule wrote:
> >
> > I tested your patch, and it looks so it is working without any problem.
> All
> > tests passed.
> >
> > There is just one question. If printalias = true will be active for all
> > cases or just with some flag?
>
> Sorry, as I just replied to Bharath I sent the wrong patch. The new patch
> has
> the same modification with printalias = true though, so I can still answer
> that
> question. The change is active for all cases, however it's a no-op for any
> in-core case, as a query sent by a client should be valid, and thus should
> have
> an alias attached to all subqueries. It's only different if you call
> get_query_def() on the result of pg_analyze_and_rewrite(), since this code
> doesn't add the subquery aliases as those aren't needed for the execution
> part.
>

ok.

I checked this trivial patch, and I don't see any problem. Again I run
check-world with success. The documentation for this feature is not
necessary. But I am not sure about regress tests. Without any other code,
enfosing printalias will be invisible. What do you think about the
transformation of your extension to a new module in src/test/modules? Maybe
it can be used for other checks in future.

Regards

Pavel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-02-02 18:50:17 Re: Server-side base backup: why superuser, not pg_write_server_files?
Previous Message Tom Lane 2022-02-02 18:46:39 Re: Server-side base backup: why superuser, not pg_write_server_files?