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 1fO16m-0002lv-US for pgsql-general@arkaria.postgresql.org; Wed, 30 May 2018 13:25: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 1fO16i-0001Wy-P9 for pgsql-general@arkaria.postgresql.org; Wed, 30 May 2018 13:25:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fO16i-0001Wp-Dx for pgsql-general@lists.postgresql.org; Wed, 30 May 2018 13:25:40 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fO16b-0004Xm-3o for pgsql-general@lists.postgresql.org; Wed, 30 May 2018 13:25:39 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 676F821D76; Wed, 30 May 2018 09:25:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 30 May 2018 09:25:31 -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=AgHql/bH7u560c0KnRZdbFy1YlHlA vreOhCtiHL9M+Y=; b=Lv8pWkMaaMuWpVIgA+DufUARn7eeGIZvWr25NCBa9g9zr JeJDsxnBBvDf4EK3D3H8Ic599GjXQCz2HEEWiq+VhJPRIxgX8dk8OCWzmBVeGAf4 AUeISxu9Pjhn+r5dqazBNAMr88MRcfq3ber6uNM157sns7zI6f8fL+h5X57hNODv Xho2BAYziW7Mes6sPupQIYi3xobAM2ffkJldDOOpL5KyKWKZyzwymUchCthmOB4R p/x1X8LxIfBJmkdS+mNSaQpkazNknbuFnKgs1FxRaZXMriG2ACbKccVi+Kcubrpi xbg/dErqUiE/yHeMmtNMho3FtTeAWGDaKDlyWoDaQ== 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=fm2; bh=AgHql/ bH7u560c0KnRZdbFy1YlHlAvreOhCtiHL9M+Y=; b=fhoSbM+4NL2i1Bn+1E5f8z JZnAfIMeWSg4RGfTdSsfSiBACZh8LemfJYcEjwMzchn5q5QaWz6d+gYINDgF8PPt JMPN3jrxGRa1xkD07YOQVQ2UmBb5bjltExFM+6Sh8kiNBmiZpmqeGa8o4BgjNkAT sGax5Vb779ADmPgBwB11sUinIGhk4VL60eV2b8iWfbSuFiKptOGuu64afYxJKML9 oBmzIZBvX5+vafRAiFRf5mwdwHSeKC66chO7FH3cc+aYUFLlAXdeWmGWiuLeLyLl 2eOT5/t0puaI2YmARaQD7mzUDLlVH2V2/znT6YzOdo6j2428gOwuudtVbDgT4J6Q == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.159.209]) by mail.messagingengine.com (Postfix) with ESMTPA id CE2B910278; Wed, 30 May 2018 09:25:30 -0400 (EDT) Subject: Re: Query running for 12 hours To: =?UTF-8?Q?Yavuz_Selim_Serto=c4=9flu?= , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: <56911e4e-d8a7-1770-7f6b-cd2104979693@aklaver.com> Date: Wed, 30 May 2018 06:25:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 05/30/2018 04:37 AM, Yavuz Selim Sertoğlu wrote: > Hi everybody, > * > * > *Today I saw that two queries have been running for more then 12 > hours(They are the same query actually).* > > /mydb=# select * from pg_stat_activity where state='active' and > state_change < now()-'12 hours'::interval;/ > > > *I've explained this query(I used $1 as now())* What is the value of $1 in the queries? > *PostgreSQL version is 9.5.3 on CentOS 7.2.1511* > > /[root@myserver]# cat /etc/redhat-release/ > CentOS Linux release 7.2.1511 (Core) > > /mydb=# select version();/ >                                                  version > --------------------------------------------------------------------------------------------------------- >  PostgreSQL 9.5.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 > 20150623 (Red Hat 4.8.5-4), 64-bit > (1 row) > > I could not figure out what the problem is. > I would be happy if someone could help me to solve this situation. > > > -- > > Saygılarımla > -- Adrian Klaver adrian.klaver@aklaver.com