Re: [GENERAL] Strange result using transactions

2007-03-27 Thread Pavan Deolasee
On 3/27/07, Tom Lane [EMAIL PROTECTED] wrote: Matthijs Melissen [EMAIL PROTECTED] 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)

Re: [GENERAL] Strange result using transactions

2007-03-27 Thread Alban Hertroys
Pavan Deolasee wrote: On 3/27/07, Tom Lane [EMAIL PROTECTED] wrote: Matthijs Melissen [EMAIL PROTECTED] 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

Re: [GENERAL] Strange result using transactions

2007-03-27 Thread Matthijs Melissen
Alban Hertroys wrote: Pavan Deolasee wrote: On 3/27/07, Tom Lane [EMAIL PROTECTED] wrote: Matthijs Melissen [EMAIL PROTECTED] 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');

Re: [GENERAL] Strange result using transactions

2007-03-27 Thread Michael Fuhr
On Tue, Mar 27, 2007 at 12:41:53PM +0200, Matthijs Melissen wrote: I get DELETE 0 even if a record with id=20 already exists before both transactions. Transaction 2 (T2) is deleting the version of the row with id = 20 that was visible to T2 when it executed its DELETE. Since T1 deleted that

[GENERAL] Strange result using transactions

2007-03-26 Thread Matthijs Melissen
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; Queries marked with 1) are executed by process 1 and queries marked with 2) are executed

Re: [GENERAL] Strange result using transactions

2007-03-26 Thread Stuart Cooper
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; If you do these side by side in interactive psql sessions, you'll see that the process

Re: [GENERAL] Strange result using transactions

2007-03-26 Thread Tom Lane
Matthijs Melissen [EMAIL PROTECTED] 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