Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fs7TG-0003mx-GR for pgsql-general@arkaria.postgresql.org; Tue, 21 Aug 2018 14:17:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fs7TE-0005px-OM for pgsql-general@arkaria.postgresql.org; Tue, 21 Aug 2018 14:17:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fs7TD-0005pq-M0 for pgsql-general@lists.postgresql.org; Tue, 21 Aug 2018 14:17:20 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fs7T6-0007g2-IC for pgsql-general@lists.postgresql.org; Tue, 21 Aug 2018 14:17:19 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2D3F52209E; Tue, 21 Aug 2018 10:17:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 21 Aug 2018 10:17:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=pDrZz2XH9HHVzu1cKfCVEuGPnSBF1 6RGpoIFSsEqtLA=; b=rhZo+/HlLzNFWnbeur8v1VaF1y1JRLzAJ/dICgq1C+0h/ OyB/uoK1rbruMXjCvGYqI9CQ6IBx4iAb7aT2aaImgfrTcFP8xy+mJj3PxxkXVk45 MPloUXY/o8KKlArvy+aw3txD1Aimqe6FLa8zrINMW0RQFq90BQA2smBap01QWEwy 4YL6bMHw+UuCUtiPtyqTs2f7ExK+C53k/ZFvMDcNkzqRGax6/UjmJfL3RQrt3q37 yRx30d/LoFF0S8RWbwGExymQrFkBAiJ3vo3IZa4klBOlzToyUTQL3t4JTHyPiOla stf78ux9aNHCEwrpTVcLxN+wHyXvhQKxvjGCRzpZg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=pDrZz2 XH9HHVzu1cKfCVEuGPnSBF16RGpoIFSsEqtLA=; b=kYmruYCKe4Tn3SCJrn2JbG YuehmemNUmEoShf6KB3qHCSMp4EXU0NIc+0WvwFOC6IMN4mkTzJYEEozcSJbETTb SLv5wU9uL/AQJ0+ivYqp6ffMOAbqs1BBhssAZHiSuOQLkzTjtPbUwI6B4NZFzDdt 9SIySMBj5RTOSynFCSLmXPr/hinwmKmf38UEgK8dremzMjF9g2XruWxwPviQAgmw c7I1BAn0RdVDVs40BeeqkfQyd36/gpZVSK4V5MIJZq9lCODlKn/b9RWEKUMHPKe0 xh4Cjbxk00Kjt2ENjayl8BksxWuzOZs+3wblfNrIlE2P1sFxs2qKa9U1MMB0uqgw == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 4756C1028F; Tue, 21 Aug 2018 10:17:09 -0400 (EDT) Subject: Re: How to check whether table is busy or free before running the ALTER or creating TRIGGER on that table To: Raghavendra Rao J S V , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Tue, 21 Aug 2018 07:17:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 08/21/2018 06:25 AM, Raghavendra Rao J S V wrote: > *Hi All,* > > We have thousands of tables. Out of these tables we have few tables. > Which are busy some times. If I execute any ALTER statement or creating > trigger on those tables I am unable to do it. How to check whether table > is busy or free before running the *ALTER/DDL *or creating *TRIGGER *on > that table in postgresql database. Take a look at: https://www.postgresql.org/docs/10/static/view-pg-locks.html > > -- > Regards, > Raghavendra Rao J S V > -- Adrian Klaver adrian.klaver@aklaver.com