Re: COPY and Volatile default expressions - Mailing list pgsql-hackers

From Kohei KaiGai
Subject Re: COPY and Volatile default expressions
Date
Msg-id CADyhKSWXCJnWBfOYjjj2X3uowUmo63nUHrsWYbh+7VH9ycnyaQ@mail.gmail.com
Whole thread Raw
In response to Re: COPY and Volatile default expressions  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: COPY and Volatile default expressions
List pgsql-hackers
Hi Simon,

I checked this patch. One thing I could comment on is, do you think it is a good
idea to have oid of exception function list on
contain_volatile_functions_walker()?

The walker function is static thus here is no impact for other caller, and its
"context" argument is unused.
My proposition is to enhance 2nd argument of contain_volatile_functions_walker()
to deliver list of exceptional functions, then
contain_volatile_functions_not_nextval()
calls contain_volatile_functions_walker() with list_make1_oid(F_NEXTVAL_OID) to
handle nextval() as exception.
Otherwise, all we need to do is put NIL as 2nd argument.

It kills code duplication and reduces future maintenance burden.
How about your opinion?

Thanks,

2013/4/16 Simon Riggs <simon@2ndquadrant.com>:
> On 16 April 2013 13:57, Heikki Linnakangas <hlinnakangas@vmware.com> wrote:
>
>> You still need to check the args, if the function is nextval, otherwise you
>> incorrectly perform the optimization for something like
>> "nextval(myvolatilefunc())".
>
> Guess so. At least its an easy change.
>
> Thanks for checking.
>
> --
>  Simon Riggs                   http://www.2ndQuadrant.com/
>  PostgreSQL Development, 24x7 Support, Training & Services
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>



-- 
KaiGai Kohei <kaigai@kaigai.gr.jp>



pgsql-hackers by date:

Previous
From: Rushabh Lathia
Date:
Subject: Re: proposal 9.4 plpgsql: allows access to call stack from GET DIAGNOSTICS statement
Next
From: Fabien COELHO
Date:
Subject: Re: [Review] Re: minor patch submission: CREATE CAST ... AS EXPLICIT