Re: Nested xacts: looking for testers and review

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Barry Lind <blind(at)xythos(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nested xacts: looking for testers and review
Date: 2004-06-10 20:05:13
Message-ID: 20040610200513.GA4744@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 10, 2004 at 03:39:14PM -0400, Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > We are considering allowing COMMIT IGNORE ABORT for scripts that want to
> > do a subtransaction, but don't care if it fails, and because it is a
> > script, they can't test the return value to send ROLLBACK:
>
> 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.

The problem with END is how about executing it inside a PL/pgSQL
function. Can we distinguish it from plpgsql's END?

Also, COMMITing an aborted main transaction is the same as ENDing it;
and in fact, it's the same as ROLLBACK. Why is it more confusing for a
subtransaction to behave the same?

I agree that the grammar I proposed is wrong. I guess I can ask for two
words and then strcmp() them to "ignore errors"?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"La naturaleza, tan frágil, tan expuesta a la muerte... y tan viva"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Manfred Koizar 2004-06-10 20:08:22 More vacuum.c refactoring
Previous Message Tom Lane 2004-06-10 19:39:14 Re: Nested xacts: looking for testers and review