Re: Feature suggestion: ON CONFLICT DO NOTHING RETURNING which returns existing row data
От
Tom Dunstan
Тема
Re: Feature suggestion: ON CONFLICT DO NOTHING RETURNING which returns existing row data
Дата
Msg-id
25247983-2BB2-4B2F-86E7-C9F313278F81@tomd.cc
Ответ на
Re: Feature suggestion: ON CONFLICT DO NOTHING RETURNING
which returns existing row data (Pantelis Theodosiou)
Список
Дерево обсуждения
Feature suggestion: ON CONFLICT DO NOTHING RETURNING which returns existing row data Tom Dunstan <pgsql@tomd.cc>
Re: Feature suggestion: ON CONFLICT DO NOTHING RETURNING
which returns existing row data Pantelis Theodosiou <ypercube@gmail.com>
Re: Feature suggestion: ON CONFLICT DO NOTHING RETURNING which returns existing row data Tom Dunstan <pgsql@tomd.cc>
> On 5 Oct 2016, at 8:11 PM, Pantelis Theodosiou 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 up t1’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 feature suggestion / request was that we wouldn’t have to do that subsequent lookup at all, as pg would just give it back to 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 that we COPY data in to - thus it can’t be rewritten as a rule or a multi-row insert like that. Thanks Tom
В списке pgsql-hackers по дате отправления
От: Masahiko Sawada
Дата: