X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B38DA8B9FAE for ; Tue, 15 Feb 2005 15:29:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 65390-02 for ; Tue, 15 Feb 2005 15:29:19 +0000 (GMT) Received: from koolancexeon.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by svr1.postgresql.org (Postfix) with ESMTP id 80B958B9EF9 for ; Tue, 15 Feb 2005 15:29:16 +0000 (GMT) Received: mail.g2switchworks.com 10.10.1.8 from 10.10.1.37 10.10.1.37 via HTTP with MS-WebStorage 6.5.6944 Received: from state.g2switchworks.com by mail.g2switchworks.com; 15 Feb 2005 09:29:16 -0600 Subject: Re: newbie : START TRANSACTION From: Scott Marlowe To: Zouari Fourat Cc: pgsql-admin@postgresql.org In-Reply-To: <621eda8a05021507144bc2302d@mail.gmail.com> References: <621eda8a05021507144bc2302d@mail.gmail.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1108481356.11967.166.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 15 Feb 2005 09:29:16 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/121 X-Sequence-Number: 16289 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.