Re: COPY and Volatile default expressions

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Jaime Casanova <jaime(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY and Volatile default expressions
Date: 2013-06-29 00:14:37
Message-ID: CA+U5nMKSiiB2NS_PZUKbRSGQdr5f251tGTFUrt0=W-PNmXN2KQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 24 June 2013 10:21, Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2013-06-29 01:15:31 Re: [GENERAL] pg_upgrade -u
Previous Message 'Bruce Momjian' 2013-06-28 23:28:07 Re: Minor inheritance/check bug: Inconsistent behavior