X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 384305E484E for ; Mon, 6 Sep 2004 11:51:42 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 58649-09 for ; Mon, 6 Sep 2004 10:51:40 +0000 (GMT) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 400ED5E487C for ; Mon, 6 Sep 2004 11:51:36 +0100 (BST) Received: (qmail 23552 invoked by uid 65534); 6 Sep 2004 10:51:41 -0000 Received: from office01.emerion.com (EHLO zaphod) (83.64.50.26) by mail.gmx.net (mp019) with SMTP; 06 Sep 2004 12:51:41 +0200 X-Authenticated: #1946847 Message-ID: <00be01c493ff$82814530$ad01a8c0@zaphod> From: "Michael Paesold" To: "Tsirkin Evgeny" Cc: References: <008601c493e5$e0965940$0b00a8c0@forge> <00c701c493eb$def5b9e0$0b00a8c0@forge> <009501c493f6$52932770$ad01a8c0@zaphod> <00a701c493fd$dd44d060$ad01a8c0@zaphod> Subject: Re: duplicates Date: Mon, 6 Sep 2004 12:51:45 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/50 X-Sequence-Number: 14753 I wrote: > BEGIN; > SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; > > DELETE FROM schedule WHERE studentid = ... ; > INSERT INTO schedule (studentid, ...) VALUES (... ); > INSERT INTO schedule (studentid, ...) VALUES (... ); > > COMMIT; > > If you do it like in the above sql code, there is still a problem. The > serializable checking here only works, if DELETE FROM schedule... really > finds at least one row. If it does not, it will not recognize the > serialization problem. So it's still possible that your programm creates > duplicates. > > I have tested this here. I don't really know if this is just the case with > PostgreSQL serializable transactions (MVCC limitation) or a general problem. There is a detailed description about this problem in Section 12.2.2.1. of the PostgreSQL 8 docs here: http://developer.postgresql.org/docs/postgres/transaction-iso.html (Serializable Isolation versus True Serializability) Best Regards, Michael Paesold