From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> |
Cc: | Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: subtransactions -- storage manager |
Date: | 2004-04-27 03:54:19 |
Message-ID: | 200404270354.i3R3sJQ00535@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
Alvaro, is this ready to be applied?
---------------------------------------------------------------------------
Alvaro Herrera wrote:
> Hackers,
>
> This patch adds subtransaction support into the storage manager. Files
> created or dropped inside a subtransaction are correctly dealt with at
> subtransaction commit or abort.
>
> This works:
> create table foo (a int);
> create table foo2 (a int);
> begin;
> begin;
> create table bar (a int);
> select relfilenode, relname from pg_class where relname in ('foo', 'bar');
> drop table foo2;
> rollback;
> drop table foo;
> create table baz (a int);
> select relfilenode, relname from pg_class where relname='baz';
> commit;
>
> At this point, the files for "bar" and "foo" have disappeared, while
> "foo2" and "baz" remain. (Note however that the catalog entries are not
> correct -- this is because we don't have correctly recorded results in
> pg_clog.)
>
> While making this I realized I had made a mistake regarding portal
> memory, so I also correct it with this patch. As a side effect, the
> following works;
>
> begin;
> begin;
> declare foo cursor for select 1;
> commit;
> begin;
> declare bar cursor for select 1;
> rollback;
> fetch all from foo; -- returns 1 row
> fetch all from bar; -- no such cursor
> rollback;
>
> (This patch will only apply cleanly with the previous patch applied.)
>
>
>
> Still missing:
>
> - support for prepared statements, async notifies. Easy.
> - support for on commit actions. Not sure.
> - support for deferred triggers. Not so easy, maybe hard.
> - correct LWLock handling. Should be easy (release them all on abort)
> - correct regular lock handling. Not so easy.
> - pg_clog/pg_subtrans. Need a solution.
>
>
> PS: somehow I managed to get tired of the phrase "nested transactions"
> and I'm using the term "subtransactions" instead. In my head they are
> the same thing ...
>
> --
> Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
> Hi! I'm a .signature virus!
> cp me into your .signature file to help me spread!
[ Attachment, skipping... ]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Fabien COELHO | 2004-04-27 07:37:50 | Re: [BUGS] BUG #1134: ALTER USER ... RENAME breaks md5 |
Previous Message | Bruce Momjian | 2004-04-27 03:31:15 | Re: NEXT VALUE FOR... |