Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-22 Thread Hans Schou
2017-12-21 21:50 GMT+01:00 Rakesh Kumar : > whenever SQLERROR EXIT ROLLBACK > Thanks. You are absolutely right. After starting with: WHENEVER SQLERROR EXIT ROLLBACK the process getting the deadlock will exit to command prompt (with %ERRORLEVEL% = 0). So what actually found out was that Oracle

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Rakesh Kumar
> The tool Im using is "sqlplus". By default you are always in a transaction > and > auto-commit only occur on exit.  Its been a while since I worked with oracle. I remember I use to add the following two lines at the top: SET AUTOCOMMIT OFF whenever SQLERROR EXIT ROLLBACK IIRC, adding the abo

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Hans Schou
2017-12-21 12:41 GMT+01:00 Rakesh Kumar : > Could it be that the tool you are using in Oracle is doing commit while > exiting out due to Deadlock, because there is no explicit rollback. > The tool Im using is "sqlplus". By default you are always in a transaction and auto-commit only occur on exit

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Hans Schou
2017-12-21 17:46 GMT+01:00 Jeremy Finzel : > It's hard to follow how the 2 videos relate, because you don't run the > same SQL both places. You first update where i = 2 in Postgres and i = 1 > in Oracle. > Well OK. I made a new one for PostgreSQL: https://youtu.be/En8EFv90yCc Now with same backg

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Jeremy Finzel
It's hard to follow how the 2 videos relate, because you don't run the same SQL both places. You first update where i = 2 in Postgres and i = 1 in Oracle. On Thu, Dec 21, 2017 at 4:37 AM, Hans Schou wrote: > Hi > > FYI - if it has any interest > > During my preparation for describing what happe

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Rakesh Kumar
Could it be that the tool you are using in Oracle is doing commit while exiting out due to Deadlock, because there is no explicit rollback.

Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Hans Schou
Hi FYI - if it has any interest During my preparation for describing what happens when two processes update the same row in a table, I came across that PostgreSQL is doing right and Oracle is doing it wrong. The situation is a process which get a deadlock, but because it is a script, it sends a