Re: COPY and Volatile default expressions

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: COPY and Volatile default expressions
Дата
Msg-id CA+U5nMKSiiB2NS_PZUKbRSGQdr5f251tGTFUrt0=W-PNmXN2KQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: COPY and Volatile default expressions  (Kohei KaiGai <kaigai@kaigai.gr.jp>)
Список pgsql-hackers
On 24 June 2013 10:21, Kohei KaiGai <kaigai@kaigai.gr.jp> wrote:
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?

That approach is more flexible than the one in the patch, I agree.

Ultimately, I see this as a choice between a special purpose piece of code (as originally supplied) and a much more generic facility for labelling functions as to whether they contain SQL or not, per the SQL standard as Jaime suggests. There's not much mileage in something in between.

So I'm mid way through updating the patch to implement the generic facility.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

В списке pgsql-hackers по дате отправления:

Предыдущее
От: 'Bruce Momjian'
Дата:
Сообщение: Re: Minor inheritance/check bug: Inconsistent behavior
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [GENERAL] pg_upgrade -u