Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9DFAA1337B47 for ; Thu, 30 Sep 2010 14:12:04 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 21379-08 for ; Thu, 30 Sep 2010 17:11:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id 1E5DE1337B4E for ; Thu, 30 Sep 2010 14:11:56 -0300 (ADT) Received: from [192.168.2.167] (ALille-153-1-31-37.w83-198.abo.wanadoo.fr [83.198.78.37]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id C87F23B8F5; Thu, 30 Sep 2010 19:11:55 +0200 (CEST) Message-ID: <4CA4C4DB.50609@lelarge.info> Date: Thu, 30 Sep 2010 19:11:55 +0200 From: Guillaume Lelarge User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); fr; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Terry Schmitt CC: pgsql-admin@postgresql.org Subject: Re: pg_dumpall blocking other sessions References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201009/196 X-Sequence-Number: 35740 Le 30/09/2010 17:50, Terry Schmitt a écrit : > [...] > I had a situation where a session was getting blocked while per > performing a pg_dumpall. > > I could see the pg_dumpall session executing a COPY command on a table > in one schema. > Another user session was attempting to truncate a different table in a > different schema, but in the same database. This session was being > blocked by the pg_dumpall session. > > I intend to test this further, but my understanding was that pg_dump > was a non-blocking operation. I'm still on the learning curve with > Postgres 8.4 (actually EnterpriseDB Advanced Server), so maybe I just > need more detail on how pg_dumpall works. > Is the truncate perhaps the problem, but other dml is allowed? > There's a light lock held on every objects so that pg_dump/pg_dumpall can save every object existing at the time it was fired. This light lock doesn't allow one to drop or truncate a table because these operations require exclusive access to the table (which they can't have since pg_dump/pg_dumpall have a light lock on it). But you can still insert, update, delete (even all) lines in every table. -- Guillaume http://www.postgresql.fr http://dalibo.com