Re: newbie : START TRANSACTION - Mailing list pgsql-admin

From Scott Marlowe
Subject Re: newbie : START TRANSACTION
Date
Msg-id 1108481356.11967.166.camel@state.g2switchworks.com
Whole thread Raw
In response to newbie : START TRANSACTION  (Zouari Fourat <fourat@gmail.com>)
List pgsql-admin
On Tue, 2005-02-15 at 09:14, Zouari Fourat wrote:
> Hello
> am new to transactional sql (just moved from mysql) and would like to
> use transactions and i want to ask about it here, when am in a
> transaction block can i execute other queries on the server (that
> table exactly) or shoudl i commit the transaction to free the table ?

Firstly, read through this section of the manual:

http://www.postgresql.org/docs/8.0/static/mvcc.html

Secondly, postresql is designed around transactions, and generally you
don't have to worry about accidentally doing too much in one or anything
like that.  This is especially true of DML (Data manipulation language)
queries.

However, transactions and DDL (data definition language) are a slightly
different story.  While everything except create / drop database is
transactable, DDL statements tend to take out locks that do lock out
other users while running, and therefore should be run as a batch then
committed or not quickly, generally speaking.

Basically, as long as you're updating your data, you don't have to worry
too much about what's been locked, except for some visibility issues
(you might need select or update for some of those problems, as well as
serializable mode).  When you're alter table structure and such, then it
can become an issue to other usres.

pgsql-admin by date:

Previous
From: Zouari Fourat
Date:
Subject: newbie : START TRANSACTION
Next
From: Dick Davies
Date:
Subject: empty a database