Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lREcx-0005nv-Vf for pgsql-admin@arkaria.postgresql.org; Tue, 30 Mar 2021 13:41:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lREcu-0001uS-UY for pgsql-admin@arkaria.postgresql.org; Tue, 30 Mar 2021 13:41:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lREcu-0001uK-Is for pgsql-admin@lists.postgresql.org; Tue, 30 Mar 2021 13:41:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lREcr-0004S5-Vb for pgsql-admin@lists.postgresql.org; Tue, 30 Mar 2021 13:41:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 12UDfhI22800079; Tue, 30 Mar 2021 09:41:43 -0400 From: Tom Lane To: Devendra Yadav cc: pgsql-admin@lists.postgresql.org Subject: Re: In-reply-to: References: Comments: In-reply-to Devendra Yadav message dated "Tue, 30 Mar 2021 12:36:15 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2800077.1617111703.1@sss.pgh.pa.us> Date: Tue, 30 Mar 2021 09:41:43 -0400 Message-ID: <2800078.1617111703@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Devendra Yadav writes: > We are running on PostgreSQL v 12.1 , Redhat 7.8. > We are running a query - ALTER TABLE mytable ADD COLUMN deposited DOUBLE > PRECISION; > This query is blocked by pid 0. It's not a postgres PID and won't allow to > terminate from postgres. It would be better if you showed the evidence that makes you think this, as it's fairly likely that the true problem is somewhere else than you think. At a guess, however, a pg_locks display that suggests a lock is held by "pid 0" might be trying to represent a lock held by a prepared-but- uncommitted transaction. Try looking into the pg_prepared_xacts view. regards, tom lane