| От | Anssi Kääriäinen |
|---|---|
| Тема | Re: INSERT ... ON CONFLICT {UPDATE | IGNORE} |
| Дата | |
| Msg-id | 1418035434.22478.119.camel@TTY32 обсуждение исходный текст |
| Ответ на | Re: INSERT ... ON CONFLICT {UPDATE | IGNORE} (Josh Berkus <josh@agliodbs.com>) |
| Список | pgsql-hackers |
On Fri, 2014-12-05 at 10:00 -0800, Josh Berkus wrote: > I thought the point of INSERT ... ON CONFLICT update was so that you > didn't have to care if it was a new row or not? > > If you do care, it seems like it makes more sense to do your own INSERTs > and UPDATEs, as Django currently does. Django tries to update the object if it already exists in the database. If it doesn't, then Django does an insert. This is suboptimal from concurrency standpoint, and does two round trips to the database instead of just one. For Django, both insert and update are OK when saving an object to the database, but Django needs to know which one was done. I too agree that this doesn't need to be handled in the first version of the patch. - Anssi
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера