Skip site navigation (1)
Skip section navigation (2)
## Re: [COMMITTERS] pgsql: Add notion of a "transform function" that can simplify function

### In response to

### pgsql-hackers by date

### pgsql-committers by date

I wrote: > However, see my response to Robert: why are we passing the original node > to the transform function at all? It would be more useful and easier to > work with to pass the function's fully-processed argument list, I believe. After a bit of looking around, I realize that the current implementation of transform functions is flat-out wrong, because whenever a transform actually fires, it proceeds to throw away all the work that eval_const_expressions has done on the input, and instead return some lightly-modified version of the original node tree. Thus for example in the regression database: regression=# create function foo(x float8, y int) returns numeric as regression-# 'select ($1 + $2)::numeric' language sql; CREATE FUNCTION regression=# select "numeric"(foo(y := 1, x := f1), -1) from float8_tbl; ERROR: unrecognized node type: 310 since the adjustment of foo's named arguments is thrown away. So this patch is going to need some work. I continue to not see any particular reason why the transform function should need the original node tree. I think what it *should* be getting is the OID of the function (currently, it's impossible for one transform to serve more than one function, which seems like it might be useful); the input collation (currently, transforms are basically unusable for any collation-sensitive function), and the pre-simplified argument list. regards, tom lane

- Re: [COMMITTERS] pgsql: Add notion of a "transform function" that can simplify function at 2012-03-23 15:36:49 from Tom Lane

Next: From:Greg StarkDate:2012-03-23 16:29:28Subject: Re: query cachePrevious: From: Dimitri FontaineDate: 2012-03-23 16:12:22Subject: Re: Finer Extension dependencies

Next: From:Tom LaneDate:2012-03-23 16:52:31Subject: Re: [COMMITTERS] pgsql: Add notion of a "transform function" that can simplify functionPrevious: From: Noah MischDate: 2012-03-23 16:09:56Subject: Re: [COMMITTERS] pgsql: Add notion of a "transform function" thatcan simplify function