Re: COPY and Volatile default expressions - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: COPY and Volatile default expressions
Date
Msg-id CA+U5nMK9FTVt3KEau7YOyOEfaENhzWV+M2XDnf=atSoqBzbzUw@mail.gmail.com
Whole thread Raw
In response to Re: COPY and Volatile default expressions  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
On 15 April 2013 16:41, Heikki Linnakangas <hlinnakangas@vmware.com> wrote:

>> What I'd like to do is to invent a new form of labelling that allows
>> us to understand that COPY can still be optimised.
>
> It would be even nicer to detect at runtime, when a default expression or
> before trigger tries to access the same table. When that happens, we could
> immediately flush all the tuples buffered that far to disk, so that they are
> visible to the expression, and then proceed with it.

Maybe, but do we really want an extra test every time we access a
table? And if we did that, how would we pass control back to the COPY
command to allow it flush the buffer before continuing with the
function?

How would we cope with times when a subtle problem makes a function
unusable, even though it passes automatic detection?

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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: COPY and Volatile default expressions
Next
From: Tom Lane
Date:
Subject: Re: COPY and Volatile default expressions