Re: ON ERROR triggers

From: Holger Krug <hkrug(at)rationalizer(dot)com>
To: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ON ERROR triggers
Date: 2002-01-07 07:48:51
Message-ID: 20020107084851.B1148@dev12.rationalizer.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 04, 2002 at 11:48:26AM -0800, Mikheev, Vadim wrote:
> > 2) Allow a transaction to be marked for rollback, in which case
> > it proceeds but rolls back at commit time. It is not possible
>
> Sorry, can you explain one more time what's the point to continue
> make changes in transaction which will be rolled back?

I think, I can.

The point is to collect comprehensive error reports, mainly about
failed modifications of complex structured data which is
created/modified concurrently by several workers in an optimistic
locking fashion. Because the data is so complex it won't help anybody
if you print out a message as "index xy violated by tuple ab". Hence I
want to collect all the errors to give the application/the user the
possibility to make an overall assessment about what has to be done to
avoid the error.

This is also the reason, why I will insert a DUPKEY into an index
after having marked the transaction for rollback (see my answer to
Jan's mail). I deem this will give more informative error reports. I
simply execute all, what the user wants to be done, and inform the
user about all the errors occurring, not only the first one.

Imagine CVS would inform you only about 1 conflict each time you asks to
be informed about potential conflicts. Wouldn't it be annoying ? For
sure, it would. Now think about databases.

> How about savepoints?

This would be my question to you: How about savepoints ?
Do they help to achieve what I want to achieve ?

--
Holger Krug
hkrug(at)rationalizer(dot)com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Holger Krug 2002-01-07 07:59:16 Why MemoryContextSwitch in ExecRelCheck ?
Previous Message Holger Krug 2002-01-07 07:31:58 Re: ON ERROR triggers