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 1hP89w-0000D3-S3 for pgsql-general@arkaria.postgresql.org; Fri, 10 May 2019 16:14:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hP89v-0002Ng-GV for pgsql-general@arkaria.postgresql.org; Fri, 10 May 2019 16:14:07 +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 1hP89v-0002NV-6p; Fri, 10 May 2019 16:14:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hP89s-0005V9-NA; Fri, 10 May 2019 16:14:06 +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 x4AGDw1R028336; Fri, 10 May 2019 12:13:58 -0400 From: Tom Lane To: neeraj kumar cc: Jeremy Schneider , pgsql-admin@postgresql.org, pgsql-general@postgresql.org Subject: Re: Query on pg_stat_activity table got stuck In-reply-to: References: <15877.1557178386@sss.pgh.pa.us> <21502.1557339176@sss.pgh.pa.us> <29660.1557352732@sss.pgh.pa.us> <30687.1557432052@sss.pgh.pa.us> <32704.1557458701@sss.pgh.pa.us> <2586.1557462558@sss.pgh.pa.us> Comments: In-reply-to neeraj kumar message dated "Fri, 10 May 2019 08:40:44 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28334.1557504838.1@sss.pgh.pa.us> Date: Fri, 10 May 2019 12:13:58 -0400 Message-ID: <28335.1557504838@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk neeraj kumar writes: > Also curious why query on pg_stat_activity is considering terminated > process ? The short answer to that is that this bug leaves shared memory in a corrupt state. It's not really useful to worry about whether readers should react differently to that --- you could spend endless amounts of time hypothesizing different kinds of corruption and endless amounts of code/cycles trying to work around it. But the right answer is to fix it on the writing side. regards, tom lane