> On 5 Oct 2016, at 8:11 PM, Pantelis Theodosiou <ypercube@gmail.com> wrote:
>
> This can be solved by chaining modifying CTEs.
>
> Something like this (not tested) that can work with multiple rows inserted:
Thanks for the suggestion, but it was actually slower than our current implementation, I believe due to always looking
upt1’s id in that join rather than only doing it when we didn’t get an id back from the insert. My hope with this
featuresuggestion / request was that we wouldn’t have to do that subsequent lookup at all, as pg would just give it
backto us.
Maybe it would be a win if we were inserting multiple rows, but this code is actually in a trigger on a dummy table
thatwe COPY data in to - thus it can’t be rewritten as a rule or a multi-row insert like that.
Thanks
Tom