Re: COPY and Volatile default expressions

Поиск
Список
Период
Сортировка
От Kohei KaiGai
Тема Re: COPY and Volatile default expressions
Дата
Msg-id CADyhKSWXCJnWBfOYjjj2X3uowUmo63nUHrsWYbh+7VH9ycnyaQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: COPY and Volatile default expressions  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: COPY and Volatile default expressions  (Simon Riggs <simon@2ndQuadrant.com>)
Список 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 по дате отправления:

Предыдущее
От: Rushabh Lathia
Дата:
Сообщение: Re: proposal 9.4 plpgsql: allows access to call stack from GET DIAGNOSTICS statement
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: [Review] Re: minor patch submission: CREATE CAST ... AS EXPLICIT