Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 6C5209552D6 for ; Tue, 28 Feb 2012 17:38:47 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S2Ukt-0006ZL-KT for pgsql-bugs@postgresql.org; Tue, 28 Feb 2012 21:38:46 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q1SLcTeH023520; Tue, 28 Feb 2012 16:38:30 -0500 (EST) To: rlowe@pablowe.net cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6497: Error sent to client, but data written anyway In-reply-to: References: Comments: In-reply-to rlowe@pablowe.net message dated "Tue, 28 Feb 2012 16:23:58 +0000" Date: Tue, 28 Feb 2012 16:38:29 -0500 Message-ID: <23519.1330465109@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/202 X-Sequence-Number: 32545 rlowe@pablowe.net writes: > There is an edge case where Postgres will return an error to the client, but > commit the operation anyway, thus breaking the contract with the client: > postgres=# begin; insert into s.t (c) values (1); > affected)> > postgres=# commit; > > > The data is now on both the master and slave, but the application > believes that the transaction was rolled back. A well-behaved > application will dutifully retry the transaction because it *should* > have rolled back. However, the data is there so we'll have had the > transaction execute *twice*. Huh? If the backend dumped core before you sent it the commit, the data will certainly not be committed. It might be physically present on disk, but it won't be considered valid. regards, tom lane