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 C172CD1B4ED for ; Fri, 7 Nov 2003 22:17:35 +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 07621-08 for ; Fri, 7 Nov 2003 18:17:06 -0400 (AST) Received: from smtp1.netcologne.de (smtp1.netcologne.de [194.8.194.112]) by svr1.postgresql.org (Postfix) with ESMTP id B5249D1B53F for ; Fri, 7 Nov 2003 18:17:03 -0400 (AST) Received: from jakobs.com (dial-194-8-209-117.netcologne.de [194.8.209.117]) by smtp1.netcologne.de (Postfix) with ESMTP id 55CBC3CA93 for ; Fri, 7 Nov 2003 23:16:59 +0100 (MET) Date: Fri, 7 Nov 2003 23:17:51 +0100 (CET) From: holger@jakobs.com Subject: transaction processing after error in statement To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Message-Id: <20031107221659.55CBC3CA93@smtp1.netcologne.de> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/67 X-Sequence-Number: 15882 Dear PostgreSQL Gurus, I have been using PostgreSQL for quite a while and always relied on its handling of transaction and concurrency. But recently I discovered a behaviour that deviates quite a lot from how I understand transactions and how things are handled by other databases: HP Allbase, Oracle 8 and .mdb-files (Access). Here's the description: Whenever an error occurs within the transaction, PostgreSQL puts the whole transaction in an *ABORT* state, so that there is no difference at all between COMMITing or ROLLBACKing it. Even commands successfully carried out before the error ocurred are rolled back, even if I COMMIT the transaction, where no error message whatsoever is shown. Example: begin; insert into table1 values (1, 'hello'); --> success! select no from table1; ERROR: Attribute 'no' not found commit; --> success! Why should the insert statement fail, just because there was a typo in the following select statement? I was already carried out successfully, albeit only visible to the current transaction. I found this behaviour to be the same across all 7.x versions of PostgreSQL. Unfortunately, I haven't been able to find an explanation why PostgreSQL behaves like this and why all other RDBMS I tried behave differently. In this case the others make more sense to me. Additionally, I have discovered that phantom reads occur in PostgreSQL even if isolation mode serializable is used. Also not so nice! Sincerely, Holger -- Holger Jakobs * D-51469 Bergisch Gladbach Telefon +49-2202-59991 * Mobilfon +49-177-792-2466