Re: COPY and Volatile default expressions

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY and Volatile default expressions
Date: 2013-04-15 20:34:14
Message-ID: CA+U5nMLKhqOr8DXMp8QCOvHYEyEouuJQqEX-1z1cWX2Ym0FCmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15 April 2013 20:52, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Mon, Apr 15, 2013 at 11:49 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I claim this is a common class, since sequence next_val functions and
>>> uuid generators meet that criteria and most common forms of auditing
>>> trigger, as well as any other form of data-reformatting trigger.
>>
>> I don't believe that it's a good idea to consider nextval() to be
>> reorderable, so I'm not convinced by your argument here.
>
> Why not?
>
> I admit that I can't convince myself that it's safe. But I can't
> think of a concrete example where it breaks anything, either.

I'm not sure exactly if the corect label is "reorderable" or some
other word that describes this specific situation. "Parallel
independent" probably would work, since if we had a DML statement that
worked in 2 separate processes we'd probably want to know that the
rows in each could be divided up without changing the result.

It looks straightforward to put in a special case check for sequences,
which is the most important use case. Sequences are a recognised
database object, so such a special case could be justified... shame
about the other use cases though, e.g. UUIDs.

I guess we can generalise it when we have a better idea of whether
this does indeed make a useful generalisation.

--
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 Robert Haas 2013-04-15 20:35:02 Re: COPY and Volatile default expressions
Previous Message Tom Lane 2013-04-15 20:33:46 Re: Query not using index for user defined type