Re: [COMMITTERS] pgsql: Add notion of a "transform function" that can simplify function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Add notion of a "transform function" that can simplify function
Date: 2012-03-23 15:31:54
Message-ID: 13566.1332516714@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Fri, Mar 23, 2012 at 10:55 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Why exactly was this thought to be a good idea:
>>
>>> * A NULL original expression disables use of transform functions while
>>> * retaining all other behaviors.

> I assumed that we were merely trying to avoid forcing the caller to
> provide the expression tree if they didn't have it handy, and that the
> comment was merely making allowance for the fact that someone might
> want to do such a thing.

How would they not have the original expression tree handy?

But now that I'm looking at this ... the API specification for transform
functions seems rather thoroughly broken anyway. Why are we passing the
original expression and nothing else? This would appear to require the
transform function to repeat all the input-normalization and
simplification work done up to this point. It would seem to me to be
more useful to pass the fully-processed argument list. I've not looked
yet at the existing transform functions, but why would they want to know
about the original node at all?

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-03-23 15:36:49 Re: [COMMITTERS] pgsql: Add notion of a "transform function" that can simplify function
Previous Message Noah Misch 2012-03-23 15:31:47 Re: [COMMITTERS] pgsql: Add notion of a "transform function" that can simplify function

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2012-03-23 15:32:02 Re: Command Triggers patch v18
Previous Message Noah Misch 2012-03-23 15:31:47 Re: [COMMITTERS] pgsql: Add notion of a "transform function" that can simplify function