src/pl/tcl/pltcl.c
static int
pltcl_rollback(ClientData cdata, Tcl_Interp *interp,
			   int objc, Tcl_Obj *const objv[])
{
	MemoryContext oldcontext = CurrentMemoryContext;

	PG_TRY();
	{
		SPI_rollback();
		SPI_start_transaction();
	}
	PG_CATCH();
	{
		ErrorData  *edata;

		/* Save error info */
		MemoryContextSwitchTo(oldcontext);
		edata = CopyErrorData();
		FlushErrorState();

		/* Pass the error data to Tcl */
		pltcl_construct_errorCode(interp, edata);
		UTF_BEGIN;
		Tcl_SetObjResult(interp, Tcl_NewStringObj(UTF_E2U(edata->message), -1));
		UTF_END;
		FreeErrorData(edata);

		return TCL_ERROR;
	}
	PG_END_TRY();

	return TCL_OK;
}
/**********************************************************************
 * pltcl_rollback()
 *
 * Abort the transaction and start a new one.
 **********************************************************************/
pltcl_rollback()
Abort the transaction and start a new one.
pltcl_rollback () Abort the transaction and start a new one .
static int
pltcl_rollback(ClientData cdata, Tcl_Interp *interp,
			   int objc, Tcl_Obj *const objv[])
{
	MemoryContext oldcontext = CurrentMemoryContext;
	PG_TRY();
	{
		SPI_rollback();
		SPI_start_transaction();
	}
	PG_CATCH();
	{
		ErrorData  *edata;
		MemoryContextSwitchTo(oldcontext);
		edata = CopyErrorData();
		FlushErrorState();
		pltcl_construct_errorCode(interp, edata);
		UTF_BEGIN;
		Tcl_SetObjResult(interp, Tcl_NewStringObj(UTF_E2U(edata->message), -1));
		UTF_END;
		FreeErrorData(edata);
		return TCL_ERROR;
	}
	PG_END_TRY();
	return TCL_OK;
}
static int pltcl_rollback ( ClientData cdata , Tcl_Interp * interp , int objc , Tcl_Obj * const objv [ ] ) { MemoryContext oldcontext = CurrentMemoryContext ; PG_TRY ( ) ; { SPI_rollback ( ) ; SPI_start_transaction ( ) ; } PG_CATCH ( ) ; { ErrorData * edata ; MemoryContextSwitchTo ( oldcontext ) ; edata = CopyErrorData ( ) ; FlushErrorState ( ) ; pltcl_construct_errorCode ( interp , edata ) ; UTF_BEGIN ; Tcl_SetObjResult ( interp , Tcl_NewStringObj ( UTF_E2U ( edata -> message ) , -1 ) ) ; UTF_END ; FreeErrorData ( edata ) ; return TCL_ERROR ; } PG_END_TRY ( ) ; return TCL_OK ; }
pltcl_rollback()
 Abort the transaction and start a new one.
pltcl_rollback () Abort the transaction and start a new one .
/* Save error info */ /* Pass the error data to Tcl */