Re: MERGE vs REPLACE

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas DCP SD
Тема Re: MERGE vs REPLACE
Дата
Msg-id E1539E0ED7043848906A8FF995BDA5799A53C4@m0143.s-mxs.net
обсуждение исходный текст
Ответ на MERGE vs REPLACE  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
> Unless you have a table lock, INSERT has to be before UPDATE, think
UPDATE, UPDATE (both fail), INSERT, INSERT.

> > update
> > if no rows updated
> >   insert
> >   if duplicate key
> >     update
> >     if no rows updated goto insert

That is why you have the loop. This is not a problem with above code,
because only one insert succeeds
while the others then do the update.

Andreas


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

Предыдущее
От: Tino Wildenhain
Дата:
Сообщение: Re: Improving count(*)
Следующее
От: "Zeugswetter Andreas DCP SD"
Дата:
Сообщение: Re: Improving count(*)