write_table now uses a savepoint