From: Scott Marlowe <smarlowe@g2switchworks.com>
To: Zouari Fourat <fourat@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: newbie : START TRANSACTION
Date: Tue, 15 Feb 2005 09:29:16 -0600
Message-ID: <1108481356.11967.166.camel@state.g2switchworks.com> (raw)
In-Reply-To: <621eda8a05021507144bc2302d@mail.gmail.com>
References: <621eda8a05021507144bc2302d@mail.gmail.com>
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: smarlowe@g2switchworks.com, fourat@gmail.com
Subject: Re: newbie : START TRANSACTION
In-Reply-To: <1108481356.11967.166.camel@state.g2switchworks.com>
References: <621eda8a05021507144bc2302d@mail.gmail.com> <1108481356.11967.166.camel@state.g2switchworks.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox