BEGIN WORK
SQL - Language Statements
BEGIN WORK
Begins a transaction
1998-04-15
BEGIN { WORK | TRANSACTION }
1998-04-15
Inputs
None
1998-04-15
Outputs
status
BEGIN
This signifies that a new transaction has been started.
NOTICE: BeginTransactionBlock and not in default state
This indicates that a transaction was already in progress.
What happens to command queries already run
in the transaction? Does this have no effect, or does
it restart the transaction?
1998-04-15
Description
BEGIN begins a user transaction which PostgreSQL will
guarantee is serialisable with respect to all concurrently
executing transactions. PostgreSQL uses two-phase locking
to perform this task. If the transaction is committed,
PostgreSQL will ensure either that all updates are done orelse
that none of
them are done. Transactions have the standard ACID
(atomic, consistent, isolatable, and durable) property.
1998-04-15
Notes
The keyword TRANSACTION is just a cosmetic alternative to WORK.
Neither keyword need be specified.
BEGIN statement is a PostgreSQL language extension.
Refer to the LOCK statement for further information about locking
tables inside a transaction.
Use COMMIT or ROLLBACK to terminate a transaction.
Usage
To begin a user transaction:
BEGIN WORK;
Compatibility
1998-04-15
SQL92
There is no explicit "BEGIN WORK" in SQL92; transaction initiation
is always implicit and it terminates either with a COMMIT or with
a ROLLBACK statement.