X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 938DAD1B525 for ; Mon, 10 Nov 2003 18:57:31 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 60894-05 for ; Mon, 10 Nov 2003 14:57:01 -0400 (AST) Received: from mail.hive.nj2.inquent.com (mc.carriermail.com [205.178.180.9]) by svr1.postgresql.org (Postfix) with SMTP id 290BBD1B523 for ; Mon, 10 Nov 2003 14:56:44 -0400 (AST) Received: (qmail 5791 invoked from network); 10 Nov 2003 18:56:28 -0000 Received: from unknown (HELO ?10.0.2.5?) (216.208.117.7) by 205.178.180.9 with SMTP; 10 Nov 2003 18:56:28 -0000 Subject: Re: transaction processing after error in statement From: Rod Taylor To: Holger Jakobs Cc: sszabo@megazone.bigpanda.com, pgsql-sql@postgresql.org In-Reply-To: <200311101237.hAACbuJ12784@bg.bib.de> References: <200311101237.hAACbuJ12784@bg.bib.de> Content-Type: text/plain Message-Id: <1068490585.25089.7.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Mon, 10 Nov 2003 13:56:29 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/95 X-Sequence-Number: 15910 > be recovered either. When committing a transaction the effects of all > operations that did not fail will be made permanent. This is how > transaction processing is described in the literature. I would be interested in reading that (URLs please) as I didn't see anything in the spec that was interesting on this topic. 4.8.5 from Framework (part 01) An SQL-transaction (transaction) is a sequence of executions of SQL-statements that is atomic with respect to recovery. That is to say: either the execution result is completely successful, or it has no effect on any SQL-schemas or SQL-data. The "execution result is completely successful" could certainly be used to back up PostgreSQLs choice to force a rollback. However, it doesn't differentiate between execution of what the user requested, and execution of recovery procedures on the successful user elements. Irregardless, I wish a commit on a failed transaction would throw an error -- END is good enough for Rollback or Commit. For PostgreSQL to implement this we need Savepoints or nested transactions internally since in many cases data is physically written in order to perform things like Foreign Key constraint checks.