postgreSQL.connection.rollback

Syntax

postgreSQL.connection.rollback (connectionRef)

Params

connectionRef is a reference to a connection as returned by postgreSQL.connection.open or postgreSQL.connection.grab.

Action

Roll back all changes that are part of the current transaction and begin a new transaction.

Returns

True.

Examples

postgreSQL.connection.rollback (connectionRef)

« true

Notes

By default, all database queries run inside a transaction. Call this verb to abort the current transaction and have all un-committed changes rolled back.

The PostgreSQL extension keeps track internally of when you committed or rolled back transactions, so that it will only send the respective commands to the database server when neccessary. For this feature to work correctly, you should refrain from running BEGIN, COMMIT, END, or ABORT commands directly through the query interface and instead only call this verb and the associated postgreSQL.connection.commit verb to manage transactions.

If the connection has been switched to auto-commit mode, this verb has no effect and you can safely run BEGIN, COMMIT, or ABORT commands directly through the query interface.

See Also

postgreSQL.connection.commit

postgreSQL.connection.setAutoCommit