X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C5D783A4759 for ; Thu, 11 Nov 2004 17:06:54 +0000 (GMT) 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 36698-09 for ; Thu, 11 Nov 2004 17:06:51 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 3A9033A4A48 for ; Thu, 11 Nov 2004 15:24:06 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id iABFO4g9001466 for ; Thu, 11 Nov 2004 15:24:05 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id iAB8B6d4092334 for pgsql-sql@postgresql.org; Thu, 11 Nov 2004 08:11:06 GMT From: Gaetano Mendola X-Newsgroups: comp.databases.postgresql.sql Subject: Re: A transaction in transaction? Possible? Date: Thu, 11 Nov 2004 09:10:56 +0100 Organization: PYRENET Midi-pyrenees Provider Lines: 52 Message-ID: <41931E90.2050108@bigfoot.com> References: <20041110095352.GA55504@winnie.fuhr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@pyrenet.fr To: Achilleus Mantzios User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en In-Reply-To: X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200411/119 X-Sequence-Number: 19438 Achilleus Mantzios wrote: > O Michael Fuhr έγραψε στις Nov 10, 2004 : > > >>On Wed, Nov 10, 2004 at 12:45:19AM -0800, Riccardo G. Facchini wrote: >> >> >>>Sorry, but I understand that your example is not really about nested >>>transactions, but about sequential transactions. >> >>Here's a more elaborate example. If this doesn't demonstrate the >>capability you're looking for, then please provide an example of >>what you'd like to do and describe the desired behavior. >> >>CREATE TABLE person (id SERIAL PRIMARY KEY, name TEXT NOT NULL); >> >>BEGIN; >> INSERT INTO person (name) VALUES ('Alice'); >> >> SAVEPOINT s1; >> INSERT INTO person (name) VALUES ('Bob'); >> >> SAVEPOINT s2; >> INSERT INTO person (name) VALUES ('Charles'); >> >> SAVEPOINT s3; >> INSERT INTO person (name) VALUES ('David'); >> ROLLBACK TO s3; >> >> INSERT INTO person (name) VALUES ('Edward'); >> ROLLBACK TO s2; >> >> INSERT INTO person (name) VALUES ('Frank'); >> RELEASE s1; >> >> INSERT INTO person (name) VALUES ('George'); >>COMMIT; > > > Just a very naive thought.... > Wouldn't make more sense to allow nested begin/commit/rollback blocks? Is not naive because in this way you can do what you could do with nested begin/commit/rollback blocks, in this way you can do more. Think for example in the example above to convert the "ROLLBACK TO s3" in a "ROLLBACK TO s1", that is impossible to do with begin/commit/rollback blocks. Regards Gaetano Mendola