X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 8B0CA9DCB66 for ; Thu, 22 Dec 2005 19:21:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76111-02 for ; Thu, 22 Dec 2005 19:21:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 6D9749DC88B for ; Thu, 22 Dec 2005 19:21:36 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jBMNLcRR001572; Thu, 22 Dec 2005 18:21:38 -0500 (EST) To: Mike C cc: pgsql-admin@postgresql.org Subject: Re: Create Index Locking Question In-reply-to: References: Comments: In-reply-to Mike C message dated "Fri, 23 Dec 2005 09:58:20 +1300" Date: Thu, 22 Dec 2005 18:21:38 -0500 Message-ID: <1571.1135293698@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.035 required=5 tests=[AWL=0.035] X-Spam-Score: 0.035 X-Spam-Level: X-Archive-Number: 200512/281 X-Sequence-Number: 20001 Mike C writes: > I need to create a new index on an existing table. The table is constantly > inserted into every second. Does CREATE INDEX require an exclusive write > lock on the table? If it does have a write lock what happens to the insert > statements at the time, are they simply played later or do they fail? The inserting transactions are blocked until the CREATE INDEX is done. regards, tom lane