begin man page on BSDOS

Man page or keyword search:  
man Server   6284 pages
apropos Keyword Search (all sections)
Output format
BSDOS logo
[printable version]

BEGIN()				 SQL Commands			       BEGIN()

NAME
       BEGIN - Begins a transaction in chained mode

SYNOPSIS
       BEGIN [ WORK | TRANSACTION ]

   INPUTS
       WORK

       TRANSACTION
	      Optional keywords. They have no effect.

   OUTPUTS
       BEGIN  This signifies that a new transaction has been started.

       NOTICE: BEGIN: already a transaction in progress
	      This  indicates that a transaction was already in progress.  The
	      current transaction is not affected.

DESCRIPTION
       By default, Postgres executes  transactions  in	unchained  mode	 (also
       known  as  ``autocommit''  in other database systems).  In other words,
       each user statement is executed in its own transaction and a commit  is
       implicitly performed at the end of the statement (if execution was suc‐
       cessful, otherwise a rollback is done).	BEGIN initiates a user	trans‐
       action  in  chained mode, i.e., all user statements after BEGIN command
       will be executed in a single transaction until an explicit COMMIT [com‐
       mit(l)],	 ROLLBACK  [rollback(l)],  or  execution  abort. Statements in
       chained mode are executed much faster, 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.

       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 just after BEGIN if you  need  more	 rigorous  transaction
       isolation.   In SERIALIZABLE mode queries will see only changes commit‐
       ted 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 (atomic, consistent, isolatable, and durable) prop‐
       erty.

   NOTES
       Refer to LOCK [lock(l)] for further information	about  locking	tables
       inside a transaction.

       Use  COMMIT [commit(l)] or ROLLBACK [rollback(l)] to terminate a trans‐
       action.

USAGE
       To begin a user transaction:

       BEGIN WORK;

COMPATIBILITY
   SQL92
       BEGIN is a Postgres language extension.	There  is  no  explicit	 BEGIN
       command in SQL92; transaction initiation is always implicit and it ter‐
       minates either with a COMMIT or ROLLBACK statement.

	      Note: Many relational database systems offer an autocommit  fea‐
	      ture as a convenience.

       Incidentally,  the  BEGIN  keyword  is  used for a different purpose in
       embedded SQL. You are advised  to  be  careful  about  the  transaction
       semantics when porting database applications.

       SQL92  also  requires SERIALIZABLE to be the default transaction isola‐
       tion level.

SQL - Language Statements	 29 March 2001			       BEGIN()
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server BSDOS

List of man pages available for BSDOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net