Re: New Feature Request

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Bert Scalzo <bertscalzo2(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: New Feature Request
Date: 2020-05-26 01:47:58
Message-ID: 20200526014758.dyezjhp5cqbpfq3c@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 25, 2020 at 09:21:26PM -0400, Bruce Momjian wrote:
>On Mon, May 25, 2020 at 07:53:40PM -0500, Bert Scalzo wrote:
>> I am reposting this from a few months back (see below). I am not trying to be a
>> pest, just very motivated. I really think this feature has merit, and if not
>> generally worthwhile, I'd be willing to pay someone to code it for me as I
>> don't have strong enough C skills to modify the PostgreSQL code myself. So
>> anyone who might have such skills that would be interested, please contact me:
>> bertscalzo2(at)gmail(dot)com(dot)
>
>I think your best bet is to try getting someone to write a hook
>that will do the replacement so that you don't need to modify too much
>of the Postgres core code. You will need to have the hook updated for
>new versions of Postgres, which adds to the complexity.
>

I don't think we have a hook to tweak the incoming SQL, though. We only
have post_parse_analyze_hook, i.e. post-parse, at which point we can't
just rewrite the SQL directly. So I guess we'd need new hook.

I do however wonder if an earlier hook is a good idea at all - matching
the SQL directly seems like a rather naive approach that'll break easily
due to formatting, upper/lower-case, subqueries, and many other things.
From this standpoint it seems actually better to inspect and tweak the
parse-analyze result. Not sure how to define the rules easily, though.

As for the complexity, I think hooks are fairly low-maintenance in
practice, we tend not to modify them very often, and when we do it's
usually just adding an argument etc.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-05-26 01:51:59 Re: Default gucs for EXPLAIN
Previous Message Michael Paquier 2020-05-26 01:37:33 Re: New Feature Request