Re: Nested xacts: looking for testers and review

Lists: pgsql-hackers
From: "Bort, Paul" <pbort(at)tmwsystems(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nested xacts: looking for testers and review
Date: 2004-06-10 20:10:42
Message-ID: 735D404BD9E7EB44B9CDFC27FC88809B01C4DA66@mail2.tmwsystems.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wisely wrote:
> While we clearly want this functionality, I tend to agree with Barry
> that COMMIT IGNORE ABORT (and the other variants that have
> been floated)
> is a horrid, confusing name for it. I would suggest using
> END with some
> modifier, instead. Perhaps
>
> END [ WORK | TRANSACTION ] [ IGNORE ERRORS ]
>
> END doesn't so directly imply that you are trying to commit a failed
> transaction.
>

Would it make more sense to specify at the time the optional subtransaction
is committed that it is not critical to the completion of the outer
transaction?

BEGIN;
BEGIN;
DROP TABLE foo;
COMMIT NON_CRITICAL;
CREATE TABLE foo (i int);
COMMIT;

I don't 'get' the nested transaction code, so I don't know how horrible this
would be to write. It just seemed more useful, because you could specify
which sub-transactions are show stoppers, and which ones aren't.

Or if I'm completely off base, please forgive my intrusion.

Paul


From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nested xacts: looking for testers and review
Date: 2004-06-11 04:18:51
Message-ID: 87isdyu3pw.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Bort, Paul" <pbort(at)tmwsystems(dot)com> writes:

> Would it make more sense to specify at the time the optional subtransaction
> is committed that it is not critical to the completion of the outer
> transaction?
>
> BEGIN;
> BEGIN;
> DROP TABLE foo;
> COMMIT NON_CRITICAL;
> CREATE TABLE foo (i int);
> COMMIT;

I assumed that was what was being proposed. It doesn't make sense to have a
single flag on the entire outer transaction since there could have been
multiple inner transactions, not all of which are unimportant.

Hm, perhaps a parallel to "CREATE OR REPLACE" would be "COMMIT OR ROLLBACK".
I'm not sure if I'm serious about that or joking though.

--
greg