diff --git a/lib/datalib.php b/lib/datalib.php index e623176696a..f9f533e41c4 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -86,6 +86,20 @@ function begin_sql() { } return true; } +/** +* on DBs that support it, commit the transaction +*/ +function rollback_sql() { +/// Completely general function - it just runs some SQL and reports success. + + global $CFG; + if ($CFG->dbtype === 'postgres7') { + return execute_sql('ROLLBACK', false); + } + return true; +} + + /** * returns db specific uppercase function