Re: Racing DEADLOCK on PostgreSQL 9.3

2018-04-26 Thread Vladimir Svedov
try "Сombination of blocked and blocking activity" from https://wiki.postgresql.org/wiki/Lock_Monitoring - it should show you the originator. pg_stat_activity.waiting only show affected On 25 April 2018 at 19:56, Jerry Sievers wrote: > Nick Dro writes: > > > Hi, > > I have a stock table. > > >

Re: Racing DEADLOCK on PostgreSQL 9.3

2018-04-25 Thread Jerry Sievers
Nick Dro writes: > Hi, > I have a stock table. > > One of the users in the system ran this query: update stock set > quantity=quantity-5 where stockid=100 (from his client application). > On the same time I ran from pg-admin this query: > > do $$ > begin > alter table stock disable trigger

Re: Racing DEADLOCK on PostgreSQL 9.3

2018-04-24 Thread Heikki Linnakangas
On 25/04/18 09:21, Nick Dro wrote: Hi, I have a stock table. One of the users in the system ran this query:  update stock set quantity=quantity-5 where stockid=100  (from his client application). On the same time I ran from pg-admin this query: do $$ begin alter table stock disable trigger stoc

Racing DEADLOCK on PostgreSQL 9.3

2018-04-24 Thread Nick Dro
Hi, I have a stock table.   One of the users in the system ran this query:  update stock set quantity=quantity-5 where stockid=100  (from his client application). On the same time I ran from pg-admin this query:   do $$beginalter table stock disable trigger stock_aftertrigger;update stock set stock