Hello dear people,

We all know PostgreSQL inability to handle exceptions. Inside a transaction, any
error will make it fall in *ABORT STATE*, and any further action not being
ROLLBACK, ABORT or COMMIT, will ask for a ROLLBACK, ABORT or COMMIT statement. I
want to know what exact code is executed inside PostgreSQL, when a ROLLBACK
statement is issued. Knowing that, I will modify backend/tcop/postgres.c, to do
the necesary calls to ROLLBACK, inmediately after AbortCurrentTransaction().
This will make PostgreSQL behave at least just like IBM's DB2, which rolls back
automatically after an error.

Regards,
Haroldo.


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

Fri, 28 Jul 2000 10:48:41 -0300
hstenger@adinet.com.uy
Automatically ROLLBACK after fall in *ABORT STATE*
hstenger@adinet.com.uy wrote:
> We all know PostgreSQL inability to handle exceptions. Inside a transaction, any
> error will make it fall in *ABORT STATE*, and any further action not being
> ROLLBACK, ABORT or COMMIT, will ask for a ROLLBACK, ABORT or COMMIT statement. I
> want to know what exact code is executed inside PostgreSQL, when a ROLLBACK
> statement is issued. Knowing that, I will modify backend/tcop/postgres.c, to do
> the necesary calls to ROLLBACK, inmediately after AbortCurrentTransaction().
> This will make PostgreSQL behave at least just like IBM's DB2, which rolls back
> automatically after an error.

I'm new to gdb.

I compiled PostgreSQL --enable-debug, and installed it.
Logged in as postgres superuser.
Ran postmaster -i as foreground.
Opened a second shell.
Opened ddd-gdb debugger.
Opened postmaster binary with symbols.
Opened a third shell.
Run psql template1. This makes the postmaster fork.
>From the gdb, attach to the forked postmaster, the one attending the psql
connection, and start it.

Now I run commands from psql, and expect the debugger to follow the backend
resolution of my queries. But nothing moves.

I want to see what happens in the backend when I enter ROLLBACK in psql.

Please, help me.

Regards,
Haroldo.

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

Fri, 28 Jul 2000 17:14:49 -0300
hstenger@adinet.com.uy
Re: Automatically ROLLBACK after fall in *ABORT STATE*