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 1iou9k-0000e9-Kc for pgsql-admin@arkaria.postgresql.org; Tue, 07 Jan 2020 19:04:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iou9j-0004XA-3i for pgsql-admin@arkaria.postgresql.org; Tue, 07 Jan 2020 19:04: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 1iou9i-0004X3-B4 for pgsql-admin@lists.postgresql.org; Tue, 07 Jan 2020 19:04:42 +0000 Received: from resqmta-ch2-03v.sys.comcast.net ([2001:558:fe21:29:69:252:207:35]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iou9e-00054D-8e for pgsql-admin@lists.postgresql.org; Tue, 07 Jan 2020 19:04:41 +0000 Received: from resomta-ch2-02v.sys.comcast.net ([69.252.207.98]) by resqmta-ch2-03v.sys.comcast.net with ESMTP id ou9YiZ0HRjvfeou9YiK1nM; Tue, 07 Jan 2020 19:04:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1578423872; bh=P8StbLkXNVYvvS5PbExvSvAWsUdnKC0Wr1Aap8OwXms=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=pOo8UZ7fMv+Wy2IorExgOh0rXAu2vZpid7doefugHEm5arqI4LcM2EsJvF/b/XXGJ On7jgdVeccM2uK41uVq1JBZsK/0gp6lFEG7kMy5QoarI0++4OjhaDfjh6u5Sg1vG8Q uS+nQuNpUmCK88zXFQTu8MTzf5V2J8P9DG+pfiURqfviI9OEBQR429Nnn37cckzwbU /szGp4fsQ9wimC+B8kIPTx8kHOR/2QQodaztO2ZGH1CY4tigExby+wDFIp8I4fqSZe sEWkQGA83zgnCfL3hL2f4ia3kzkg2xNv9h+EK6YJmbuRCTu7AH2Ga/N8lNhxTNyvDq S1MujbhbghMDQ== Received: from jsievers.comcast.net ([12.30.159.20]) by resomta-ch2-02v.sys.comcast.net with ESMTPA id ou9Lie8eUgGLCou9Li84WK; Tue, 07 Jan 2020 19:04:30 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedufedrvdehiedgtdefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuvehomhgtrghsthdqtfgvshhipdfqfgfvpdfpqffurfetoffkrfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpeflvghrrhihucfuihgvvhgvrhhsuceoghhsihgvvhgvrhhsudelsegtohhmtggrshhtrdhnvghtqeenucfkphepuddvrdeftddrudehledrvddtnecurfgrrhgrmhephhgvlhhopehjshhivghvvghrshdrtghomhgtrghsthdrnhgvthdpihhnvghtpeduvddrfedtrdduheelrddvtddpmhgrihhlfhhrohhmpehgshhivghvvghrshduleestghomhgtrghsthdrnhgvthdprhgtphhtthhopehlrghurhgvnhiirdgrlhgsvgestgihsggvrhhtvggtrdgrthdprhgtphhtthhopehshhhrihhkrghnthhpohhsthhgrhgvshhqlhesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdgrughmihhnsehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrdhprgdruhhsnecuvehluhhsthgvrhfuihiivgeptd X-Xfinity-VMeta: sc=-100.00;st=legit Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id 1BF2C26005A; Tue, 7 Jan 2020 13:04:19 -0600 (CST) From: Jerry Sievers To: Tom Lane Cc: Laurenz Albe , Shrikant Bhende , pgsql-admin@lists.postgresql.org Subject: Re: Alter command getting stuck on a table References: <70527e5e5ca140cd0950c1e8c63e19221a207ddc.camel@cybertec.at> <4965.1578401074@sss.pgh.pa.us> Date: Tue, 07 Jan 2020 13:04:19 -0600 In-Reply-To: <4965.1578401074@sss.pgh.pa.us> (Tom Lane's message of "Tue, 07 Jan 2020 07:44:34 -0500") Message-ID: <877e23m6ks.fsf@jsievers.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane writes: > 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 also 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. Yeah, and IMO the pg_blocking_pids($blocked-guys-pid) function is pretty snazzy too :-) > regards, tom lane > > > -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net