Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iooE1-0003tT-0i for pgsql-admin@arkaria.postgresql.org; Tue, 07 Jan 2020 12:44:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iooDz-0003I6-Md for pgsql-admin@arkaria.postgresql.org; Tue, 07 Jan 2020 12:44:43 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iooDz-0003Hz-DG for pgsql-admin@lists.postgresql.org; Tue, 07 Jan 2020 12:44:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iooDt-0001Vs-1t for pgsql-admin@lists.postgresql.org; Tue, 07 Jan 2020 12:44:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 007CiYSt004966; Tue, 7 Jan 2020 07:44:34 -0500 From: Tom Lane To: Laurenz Albe cc: Shrikant Bhende , pgsql-admin@lists.postgresql.org Subject: Re: Alter command getting stuck on a table In-reply-to: <70527e5e5ca140cd0950c1e8c63e19221a207ddc.camel@cybertec.at> References: <70527e5e5ca140cd0950c1e8c63e19221a207ddc.camel@cybertec.at> Comments: In-reply-to Laurenz Albe message dated "Tue, 07 Jan 2020 10:57:41 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4964.1578401074.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 07 Jan 2020 07:44:34 -0500 Message-ID: <4965.1578401074@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Laurenz Albe writes: > On Tue, 2020-01-07 at 14:58 +0530, Shrikant Bhende wrote: >> I am trying to add a column to a table but it's not working, I have als= o tried >> reindex and drop on the same table but those commands are also getting = stuck. > There is a concurrent session which has an open transaction which > holds some lock on the table in question. Yes, that looks like the cause. The pg_locks view could help you find the culprit session. regards, tom lane