Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGh4O-0005bD-7d for pgsql-bugs@arkaria.postgresql.org; Fri, 21 Feb 2014 03:46:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WGh4N-0003tf-Fw for pgsql-bugs@arkaria.postgresql.org; Fri, 21 Feb 2014 03:46:35 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGh4M-0003tY-EC for pgsql-bugs@postgresql.org; Fri, 21 Feb 2014 03:46:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGh4J-0001te-IT for pgsql-bugs@postgresql.org; Fri, 21 Feb 2014 03:46:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s1L3kTR2014880; Thu, 20 Feb 2014 22:46:29 -0500 From: Tom Lane To: mscott@apple.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #9301: INSERT WHERE NOT EXISTS on table with UNIQUE constraint in concurrent SERIALIZABLE transactions In-reply-to: <20140221002001.29130.27157@wrigleys.postgresql.org> References: <20140221002001.29130.27157@wrigleys.postgresql.org> Comments: In-reply-to mscott@apple.com message dated "Fri, 21 Feb 2014 00:20:01 +0000" Date: Thu, 20 Feb 2014 22:46:29 -0500 Message-ID: <14879.1392954389@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org mscott@apple.com writes: > -- The following seems to violate the fundamental guarantee of ISOLATION > LEVEL SERIALIZABLE in that the two > -- transactions below do not behave the same as if they were run serially. I must be missing something ... what about the duplicate-key error is not what you would expect if the two transactions had been run serially? BTW, the fundamental guarantee is not what you said above. It is that you will *either* get the same results as if the transactions had been run in some unspecified serial order, *or* you will get a serialization error. There is certainly no guarantee about which of these cases ensues. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs