diff --git a/doc/src/sgml/ref/begin.sgml b/doc/src/sgml/ref/begin.sgml index c23bbfb4e7..c1b3ef9306 100644 --- a/doc/src/sgml/ref/begin.sgml +++ b/doc/src/sgml/ref/begin.sgml @@ -49,6 +49,16 @@ BEGIN [ WORK | TRANSACTION ] [ transaction_mode + Pseudo sub-transactions are created using . + These are of particular use for client software to use when executing + user-supplied SQL statements and want to provide try/catch behavior + where failures are ignored. The server cannot be configured to do this + automatically: all (sub-)transaction blocks either commit or rollback in their + entirety. A commit issued while the transaction has an active failure + is automatically converted into a . + + + Statements are executed more quickly in a transaction block, because transaction start/commit requires significant CPU and disk activity. Execution of multiple statements inside a transaction is diff --git a/doc/src/sgml/ref/commit.sgml b/doc/src/sgml/ref/commit.sgml index b2e8d5d180..8bb368b771 100644 --- a/doc/src/sgml/ref/commit.sgml +++ b/doc/src/sgml/ref/commit.sgml @@ -29,9 +29,11 @@ COMMIT [ WORK | TRANSACTION ] Description - COMMIT commits the current transaction. All + COMMIT ends the current transaction. All changes made by the transaction become visible to others - and are guaranteed to be durable if a crash occurs. + and are guaranteed to be durable if a crash occurs. However, + if the transaction has failed a + will be processed instead. diff --git a/doc/src/sgml/ref/savepoint.sgml b/doc/src/sgml/ref/savepoint.sgml index 87243b1d20..66cee63966 100644 --- a/doc/src/sgml/ref/savepoint.sgml +++ b/doc/src/sgml/ref/savepoint.sgml @@ -41,7 +41,8 @@ SAVEPOINT savepoint_name A savepoint is a special mark inside a transaction that allows all commands that are executed after it was established to be rolled back, restoring - the transaction state to what it was at the time of the savepoint. + the transaction state to what it was at the time of the savepoint. It can be + thought of as a kind of a pseudo sub-transaction. @@ -74,6 +75,11 @@ SAVEPOINT savepoint_name Savepoints can only be established when inside a transaction block. There can be multiple savepoints defined within a transaction. + + + psql makes use of savepoints to implment its + ON_ERROR_ROLLBACK behavior. +