Re: Strange result using transactions - Mailing list pgsql-general

From Tom Lane
Subject Re: Strange result using transactions
Date
Msg-id 10978.1174966185@sss.pgh.pa.us
Whole thread Raw
In response to Strange result using transactions  ("Matthijs Melissen" <melissen@phil.uu.nl>)
Responses Re: Strange result using transactions  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
List pgsql-general
"Matthijs Melissen" <melissen@phil.uu.nl> writes:
> I am executing the following queries (id has a unique key):
> 1) begin;
> 1) delete from forum where id = 20;
> 1) insert into forum (id, name) values (20, 'test');
> 2) delete from forum where id = 20;
> 1) commit;

> The problem is that process 2 gets the message 'DELETE 0'. I would expect
> him to get the message 'DELETE 1'.

Why do you find that strange?  Process 1 hasn't committed its insert yet.

            regards, tom lane

pgsql-general by date:

Previous
From: "Stuart Cooper"
Date:
Subject: Re: Strange result using transactions
Next
From: Tom Lane
Date:
Subject: Re: Every user has own database - how?