From 1ac838edba409abe87649c6820a9ee492cb1a1c5 Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Mon, 14 Jun 1999 07:37:05 +0000 Subject: Minor updates for release. Split reference pages for CREATE TABLE AS and SELECT INTO to allow psgml (the emacs parser) to handle parsing. --- doc/src/sgml/ref/begin.sgml | 245 ++++++++++++++++++++++++-------------------- 1 file changed, 133 insertions(+), 112 deletions(-) (limited to 'doc/src/sgml/ref/begin.sgml') diff --git a/doc/src/sgml/ref/begin.sgml b/doc/src/sgml/ref/begin.sgml index 62e5b88d0a..495f292695 100644 --- a/doc/src/sgml/ref/begin.sgml +++ b/doc/src/sgml/ref/begin.sgml @@ -1,180 +1,201 @@ - - - - BEGIN WORK - - SQL - Language Statements - - - - BEGIN WORK - - + + + + BEGIN + + SQL - Language Statements + + + + BEGIN + + Begins a transaction in chained mode - + - - - 1998-09-08 - - + + + 1999-06-11 + + BEGIN [ WORK | TRANSACTION ] - + - - - 1998-09-08 - - + <refsect2 id="R2-SQL-BEGINWORK-1"> + <refsect2info> + <date>1999-06-11</date> + </refsect2info> + <title> Inputs - - + + None - + - - - 1998-09-08 - - + <refsect2 id="R2-SQL-BEGINWORK-2"> + <refsect2info> + <date>1999-06-11</date> + </refsect2info> + <title> Outputs - - + - - - - BEGIN - - - - This signifies that a new transaction has been started. - - - - - - NOTICE: BeginTransactionBlock and not in default state - - - + + + + + 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. The current transaction is not affected. - + - - + + - - - 1998-09-08 - - + <refsect1 id="R1-SQL-BEGINWORK-1"> + <refsect1info> + <date>1999-06-11</date> + </refsect1info> + <title> Description - + + By default, Postgres executes transactions - in unchained mode (also known as autocommit feature in other DBMSes). + in unchained mode + (also known as autocommit in other database + systems). In other words, each user statement is executed in its own transaction - and commit is implicit (if execution was successfull). + and a commit is implicitly performed at the end of the statement + (if execution was successful, otherwise a rollback is done). BEGIN initiates a user transaction in chained mode, i.e. all user statements after BEGIN command will - be executed in single transaction untill explicit COMMIT, ROLLBACK + be executed in a single transaction until an explicit COMMIT, ROLLBACK or execution abort. Statements in chained mode are executed much faster, - because of transaction start/commit requires significant CPU and disk - activity. This mode is also required for consistency when changing - one of related tables. + because transaction start/commit requires significant CPU and disk + activity. Execution of multiple statements inside a transaction + is also required for consistency when changing several + related tables. + - Default transaction isolation level in Postgres - is READ COMMITTED one, when queries inside transaction see only changes + The default transaction isolation level in + Postgres + is READ COMMITTED, where queries inside the transaction see only changes committed before query execution. So, you have to use SET TRANSACTION ISOLATION LEVEL SERIALIZABLE - command just after BEGIN if you need in better transaction isolation. - In SERIALIZABLE mode queries will see only changes committed before entire - transaction began (actually, before execution of first DML statement - in serializable transaction). + just after BEGIN if you need more rigorous transaction isolation. + In SERIALIZABLE mode queries will see only changes committed before + the entire + transaction began (actually, before execution of the first DML statement + in a serializable transaction). + If the transaction is committed, Postgres will ensure either that all updates are done or else that none of - them are done. Transactions have the standard ACID + them are done. Transactions have the standard ACID (atomic, consistent, isolatable, and durable) property. - - - 1998-09-08 - - + <refsect2 id="R2-SQL-BEGINWORK-3"> + <refsect2info> + <date>1999-06-11</date> + </refsect2info> + <title> Notes - - + + The keyword TRANSACTION is just a cosmetic alternative to WORK. Neither keyword need be specified. - + - + Refer to the LOCK statement for further information about locking tables inside a transaction. - + - - Use COMMIT or ROLLBACK + + Use + or + to terminate a transaction. - - + + - - - + + <refsect1 id="R1-SQL-BEGINWORK-2"> + <title> Usage - - To begin a user transaction: + - + + To begin a user transaction: + + BEGIN WORK; - + - + - - + <refsect1 id="R1-SQL-BEGINWORK-3"> + <title> Compatibility - - + + BEGIN is a Postgres language extension. - - - 1998-09-08 - - + <refsect2 id="R2-SQL-BEGINWORK-4"> + <refsect2info> + <date>1999-06-11</date> + </refsect2info> + <title> SQL92 - - + + There is no explicit BEGIN WORK command in SQL92; transaction initiation is always implicit and it terminates either with a COMMIT or with a ROLLBACK statement. - - - SQL92 also requires SERIALIZABLE to be default + + + + Many relational database systems offer an autocommit feature as a + convenience. + + + + + + SQL92 also requires SERIALIZABLE to be the default transaction isolation level. - + - +