From: | "Riccardo G(dot) Facchini" <abief_ag_-postgresql(at)yahoo(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Cc: | Theodore Petrosky <tedpet5(at)yahoo(dot)com>, Andrei Bintintan <klodoma(at)ar-sd(dot)net>, Michael Fuhr <mike(at)fuhr(dot)org>, sad <sad(at)bankir(dot)ru> |
Subject: | Re: A transaction in transaction? Possible? |
Date: | 2004-11-10 08:45:19 |
Message-ID: | 20041110084519.10681.qmail@web13902.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Sorry, but I understand that your example is not really about nested
transactions, but about sequential transactions.
so, the primary question remains:
how to commit/rollback them ?
--- Michael Fuhr <__> wrote:
> On Wed, Nov 10, 2004 at 09:23:02AM +0300, sad wrote:
> > On Tuesday 09 November 2004 18:24, Theodore Petrosky wrote:
> > > I thought nested transactions are available in the new
> > > release (8) coming up.
> >
> > how to commit/rollback them ?
>
> CREATE TABLE person (id SERIAL PRIMARY KEY, name TEXT NOT NULL);
>
> BEGIN;
> INSERT INTO person (name) VALUES ('Tom');
> SAVEPOINT foo;
> INSERT INTO person (name) VALUES ('Dick');
> ROLLBACK TO foo;
> INSERT INTO person (name) VALUES ('Harry');
> COMMIT;
>
> SELECT * FROM person;
> id | name
> ----+-------
> 1 | Tom
> 3 | Harry
> (2 rows)
>
> --
> Michael Fuhr
> http://www.fuhr.org/~mfuhr/
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
From | Date | Subject | |
---|---|---|---|
Next Message | Sam Mason | 2004-11-10 09:18:21 | Re: Comparing two (largish) tables on different servers |
Previous Message | Contact AR-SD.NET | 2004-11-10 07:04:00 | Re: [SQL] upper/lower for german characters |