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 18AE93B5943 for ; Fri, 17 Dec 2004 22:08:02 +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 85560-06 for ; Fri, 17 Dec 2004 22:07:56 +0000 (GMT) Received: from coruscant.plukwa.net (coruscant.plukwa.net [195.28.178.197]) by svr1.postgresql.org (Postfix) with ESMTP id 4D2343CC1ED for ; Fri, 17 Dec 2004 22:07:54 +0000 (GMT) Received: from arturp by coruscant.plukwa.net with local (Exim 4.43) id 1CfQGE-00006Y-Ei for pgsql-admin@postgresql.org; Fri, 17 Dec 2004 23:07:42 +0100 Date: Fri, 17 Dec 2004 23:07:42 +0100 From: Artur Pietruk To: pgsql-admin@postgresql.org Subject: PostgreSQL internals and implementation of transactions Message-ID: <20041217220742.GI2149@plukwa.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/198 X-Sequence-Number: 15784 Hi, I'm happy user of PostgreSQL for some years. I'm intrested to confirm how exactly transaction engine is implemented in current PostgreSQL version. I made my own findnings, based on my personal experiences through years of using PGSQL, and by reading some pgsql docs and presentations made by developers that I've found on web (going back as far as to some old writings about postgres on Berkeley Uniwersity). Here is how I understand it works in general (please note that english is not my native language, and in some cases I might not know correct english terms to use): - Transaction isolation is done in smart way via some kind of "scratch"/"temporary" buffers, here implemented as tuples with versioning - where the valid tuple is the last commited, or last written under the current transaction - Transaction multiprocessing flow consistency is implemented via two phased locking, with locks for read and write, where multiple reads of tuple by different transactions are allowed as long as no single transaction has written; and if different transaction try to combine read/write and write on the same tuple, then the one who tries to acquire lock later, is waiting until lock is released. And my question is: are the above assumptions on inner workings valid for current PGSQL version? Is there anything important about state of things, that I'm missing? Are there any good pointers to docs where I could read about pgsql internals in regards to transactioning? Thanks in advance for answer! PS. And as a long time pgsql user, I need to say big thanks for develpers and supporters of postgres! I like and admire the PostgreSQL's way of doing things in a clean "the right" way, according to standards, keeping in mind future expand of PGSQL features and so on. Best regards, -- --- Artur Pietruk, arturp@plukwa.net