Re: deadlock between "WITH agg_tmp AS ({sel_stmt}), upd AS ({upd_stmt}) {ins_stmt}" and pure UPDATE statements

Поиск
Список
Период
Сортировка
От trafdev
Тема Re: deadlock between "WITH agg_tmp AS ({sel_stmt}), upd AS ({upd_stmt}) {ins_stmt}" and pure UPDATE statements
Дата
Msg-id cf602523-20d9-0efd-4ca3-947e8b15c212@mail.ru
обсуждение исходный текст
Ответ на Re: deadlock between "WITH agg_tmp AS ({sel_stmt}), upd AS ({upd_stmt}) {ins_stmt}" and pure UPDATE statements  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
I've already switched to 'UPSERT', it didn't resolved deadlock issue by
itself... Added LOCK TABLE ... IN EXCLUSIVE MODE; to one session, hope
it will help.

> You did not mention what version of Postgres you are using, if it is
> 9.5+ you have the 'UPSERT' option available instead of using the WITH
> construct:
>
>
> https://www.postgresql.org/docs/9.5/static/sql-insert.html
>
> ON CONFLICT Clause
>
> https://www.depesz.com/2015/05/10/waiting-for-9-5-add-support-for-insert-on-conflict-do-nothingupdate/
>
>
> If not you might to take a look at:
>
> http://stackoverflow.com/questions/17267417/how-to-upsert-merge-insert-on-duplicate-update-in-postgres
>
>
> Bulk upsert with lock
>
>


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

Предыдущее
От: Patrick B
Дата:
Сообщение: Re: Unable to recovery due missing wal_file
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Unable to recovery due missing wal_file