Re: Making joins involving ctid work for the benefit of UPSERT

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Making joins involving ctid work for the benefit of UPSERT
Дата
Msg-id 20140730211755.GA12435@momjian.us
обсуждение исходный текст
Ответ на Re: Making joins involving ctid work for the benefit of UPSERT  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Mon, Jul 28, 2014 at 11:37:07AM -0400, Robert Haas wrote:
> > Yes, but what if you don't see a conflict because it isn't visible to
> > your snapshot, and then you insert, and only then (step 5), presumably
> > with a dirty snapshot, you find a conflict? How does the loop
> > terminate if that brings you back to step 1 with the same MVCC
> > snapshot feeding the update?
> 
> Good point.  Maybe the syntax should be something like:
> 
> UPSERT table (keycol [, keycol] ...) { VALUES (val [, val] ...) [,
> ...] | select_query }

One idea would be to allow UPSERT with constants (single row), and use
CTEs with a SELECT or INSERT/RETURNING for multi-row upserts.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Making joins involving ctid work for the benefit of UPSERT
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Allow GRANT TRIGGER privilege to DROP TRIGGER (Re: Bug ##7716)