Re: [PATCH] Add transforms feature - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: [PATCH] Add transforms feature
Date
Msg-id 52A87481.1030409@2ndQuadrant.com
Whole thread Raw
In response to Re: [PATCH] Add transforms feature  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [PATCH] Add transforms feature
List pgsql-hackers
On 12/11/2013 01:40 PM, Robert Haas wrote:
> On Tue, Dec 10, 2013 at 10:35 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
>> On Fri, 2013-12-06 at 11:28 +0100, Dimitri Fontaine wrote:
>>>> Here is an idea.  Add a GUC that basically says something like
>>>> use_transforms = on|off.  You can then attach that to individual
>>>> functions, which is the right granularity, because only the function
>>>> knows whether its code expects transforms or not.  But you can use
>>> the
>>>> full power of GUC to configure it any way you want.
>> Here is an updated patch that implements this, makes some of the
>> documentation improvements that you suggested, and rebases everything.
> I'm still kinda unimpressed by this.  Behavior-changing GUC, uggh.
>
It should work ok if we could somehow check that the GUC is set
on the function and fall back to session GUC in case it is not.

Not sure if this is possible though.

The need from this arises from calling other functions from a new func.
At the moment if there is a new function defined as

CREATE FUNCTION f_uses_xforms() AS $$ ... $$ SET use_transforms=on;

calls a legacy function which will break if transforms are used then the
_old_ function declaration needs to be modified to add (use_transforms=off)

It is much easier than debugging/rewriting the function, but this is
something I'd like us to be able to avoid.

PS. maybe we could resurrect the  WITH (attribute, ...) available in
CREATE FUNCTION syntax for passing function-specific flags ?


Cheers

-- 
Hannu Krosing
PostgreSQL Consultant
Performance, Scalability and High Availability
2ndQuadrant Nordic OÜ




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: -d option for pg_isready is broken
Next
From: Robert Haas
Date:
Subject: Re: Question about sorting internals