Re: COPY and Volatile default expressions

From: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
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-24 09:21:22
Message-ID: CADyhKSWXCJnWBfOYjjj2X3uowUmo63nUHrsWYbh+7VH9ycnyaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)2ndquadrant(dot)com>:
> On 16 April 2013 13:57, Heikki Linnakangas <hlinnakangas(at)vmware(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2013-06-24 09:44:21 Re: [Review] Re: minor patch submission: CREATE CAST ... AS EXPLICIT
Previous Message Rushabh Lathia 2013-06-24 09:15:30 Re: proposal 9.4 plpgsql: allows access to call stack from GET DIAGNOSTICS statement