| От | Peter Geoghegan |
|---|---|
| Тема | Re: [GENERAL] upsert and update filtering |
| Дата | |
| Msg-id | 20170731213130.GA25306@marmot обсуждение исходный текст |
| Ответ на | [GENERAL] upsert and update filtering (armand pirvu <armand.pirvu@gmail.com>) |
| Ответы |
Re: [GENERAL] upsert and update filtering
|
| Список | pgsql-general |
armand pirvu <armand.pirvu@gmail.com> wrote: >But what if in the conflict situation I want to performa the update ONLY if the record is different. The update seems tohappen no matter what >In other words is there anyway I can filter the update to happen (based on the sample date) only for 112 since col2 is different? That's quite possible. An ON CONFLICT's UPDATE accepts a WHERE clause, which can reference both existing and excluded tuples. That WHERE clause can back out of the UPDATE based on whatever criteria you like. -- Peter Geoghegan
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера