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 D464D3A3E4B for ; Wed, 10 Nov 2004 10:37:59 +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 93615-01 for ; Wed, 10 Nov 2004 10:37:52 +0000 (GMT) Received: from ar-sd.net (unknown [82.77.155.72]) by svr1.postgresql.org (Postfix) with ESMTP id 256DE3A3D45 for ; Wed, 10 Nov 2004 10:37:54 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by ar-sd.net (Postfix) with ESMTP id 2774AE82E; Wed, 10 Nov 2004 12:39:53 +0200 (EET) Received: from ar-sd.net ([127.0.0.1]) by localhost (linz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31568-04; Wed, 10 Nov 2004 12:39:51 +0200 (EET) Received: from forge (unknown [192.168.0.11]) by ar-sd.net (Postfix) with SMTP id 5FCB3E825; Wed, 10 Nov 2004 12:39:51 +0200 (EET) Message-ID: <019801c4c711$57185380$0b00a8c0@forge> From: "Andrei Bintintan" To: "Achilleus Mantzios" , "Michael Fuhr" Cc: "Riccardo G. Facchini" , , "Theodore Petrosky" , "sad" References: Subject: Re: A transaction in transaction? Possible? Date: Wed, 10 Nov 2004 12:37:54 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-7" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300 X-Virus-Scanned: by amavisd-new at ar-sd.net X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/103 X-Sequence-Number: 19422 Okay, I see you're speaking about pgsql 8.0 What about 7.4? Andy. ----- Original Message ----- From: "Achilleus Mantzios" To: "Michael Fuhr" Cc: "Riccardo G. Facchini" ; ; "Theodore Petrosky" ; "Andrei Bintintan" ; "sad" Sent: Wednesday, November 10, 2004 12:58 PM Subject: Re: [SQL] A transaction in transaction? Possible? > 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? > > > > > SELECT * FROM person; > > id | name > > ----+-------- > > 1 | Alice > > 2 | Bob > > 6 | Frank > > 7 | George > > > > If you change "ROLLBACK TO s2" to "RELEASE s2" then you get this: > > > > id | name > > ----+--------- > > 1 | Alice > > 2 | Bob > > 3 | Charles > > 5 | Edward > > 6 | Frank > > 7 | George > > > > If you change "RELEASE s1" to "ROLLBACK TO s1" then you get this: > > > > id | name > > ----+-------- > > 1 | Alice > > 7 | George > > > > > > -- > -Achilleus > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings >