Skip site navigation (1) Skip section navigation (2)

Now PostgreSQL recovers from errors within trns

From: hstenger(at)adinet(dot)com(dot)uy
To: pgsql-hackers(at)postgresql(dot)org
Subject: Now PostgreSQL recovers from errors within trns
Date: 2000-07-31 14:11:53
Message-ID: 39858929.59012BAC@adinet.com.uy (view raw or flat)
Thread:
Lists: pgsql-hackers
Hello nice people,

Slowly & happily I'm becoming a PostgreSQL hacker ;-) What a pleasure. Last
days, I learned to use the debugger, to follow code, & understood some of
PostgreSQL internals. In spanish we say someone is a 'cabeza dura' when tries
hard to do something against the odds, & so am I. My goal is to make the backend
accept erroneous commands, not falling in *ABORT STATE*, but rolling back
automatically, & continue accepting commands. So I found that there is a
function StartTransactionCommand(), which does things before executing commands,
depending on transaction state. And it did nothing explicitely when
TBLOCK_ABORT. So I added three lines, which pretend to set the backend in a safe
state, and I think I did it. What do you think about this? In my early tests, it
works. It complains saying something about the transaction state, but works
anyway. I think that by polishing it, the complain can be eliminated.



                case TBLOCK_ABORT:
+                        s->blockState = TBLOCK_INPROGRESS;
+                        AbortTransaction();
+                        StartTransaction();
                        break;


So now I can give back to PostgreSQL a 0.1% of what it gave to me. Thanks.

Cheers,
Haroldo.

P.S. Now I'll have to learn java, to make the JDBC give errors analogous to
Informix, so that my CASE tool thinks it talks to Informix. Someone posted
something about more analyzable error messages by PostgreSQL, maybe we can chat
about it.

-- 
----------------------+------------------------
 Haroldo Stenger      | hstenger(at)ieee(dot)org
 Montevideo, Uruguay. | hstenger(at)adinet(dot)com(dot)uy
----------------------+------------------------
 Visit UYLUG Web Site: http://www.linux.org.uy
-----------------------------------------------

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-07-31 14:34:42
Subject: Re: quiet? Re: The query cache - first snapshot (long)
Previous:From: Alfred PerlsteinDate: 2000-07-31 10:06:49
Subject: Re: quiet? Re: The query cache - first snapshot (long)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group