12345678910111213141516171819202122232425 |
- An **insert-only** transaction only contains [`INSERT`] statements that insert
- into the **same** table.
- On a successful [`COMMIT`], all statements from the transaction are committed at
- the same timestamp.
- ```mzsql
- BEGIN;
- INSERT INTO orders VALUES (11,current_timestamp,'brownie',10);
- -- Subsequent INSERTs must write to sales_items table only
- -- Otherwise, the COMMIT will error and roll back the transaction.
- INSERT INTO orders VALUES (11,current_timestamp,'chocolate cake',1);
- INSERT INTO orders VALUES (11,current_timestamp,'chocolate chip cookie',20);
- COMMIT;
- ```
- If, within the transaction, a statement inserts into a table different from that
- of the first statement, on [`COMMIT`], the transaction encounters an **internal
- ERROR** and rolls back:
- ```none
- ERROR: internal error, wrong set of locks acquired
- ```
|