Re: MERGE Specification

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: MERGE Specification
Дата
Msg-id 1209115849.4228.54.camel@ebony.site
обсуждение исходный текст
Ответ на Re: MERGE Specification  (Simon Riggs <simon@2ndquadrant.com>)
Список pgsql-hackers
On Thu, 2008-04-24 at 20:28 +0100, Simon Riggs wrote:

> With MERGE, we would need to do it like this:
> 
> 1. If there are any WHEN NOT MATCHED clauses that trigger INSERTs, then
> attempt to apply them first, no matter what order they were in with
> respect to the WHEN MATCHED clauses. Start loop at step (3) every time.
> If there aren't any, start loop straight at step (5). Note that we would
> need to check to see that INSERTs had not been removed by Rules.

This would only be needed when there is at least one unique index.

MERGE will work, whether or not a unique index exists. If there is no
unique index then MERGE will silently ignore duplicate rows produced by
concurrent INSERTs, though that is no different from what can occur now.

No special action will be required to handle DELETEs, since attempting
to delete a row twice doesn't produce an error.

--  Simon Riggs 2ndQuadrant  http://www.2ndQuadrant.com



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

Предыдущее
От: Petr Jelinek
Дата:
Сообщение: Re: MERGE Specification
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: MERGE Specification