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 1k5yvr-0000tM-KH for pgsql-general@arkaria.postgresql.org; Wed, 12 Aug 2020 22:09:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k5yvp-0002iv-EG for pgsql-general@arkaria.postgresql.org; Wed, 12 Aug 2020 22:09:13 +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 1k5yvp-0002io-6i for pgsql-general@lists.postgresql.org; Wed, 12 Aug 2020 22:09:13 +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 1k5yvi-0007Kn-DU for pgsql-general@postgresql.org; Wed, 12 Aug 2020 22:09:11 +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 07CM92UY323346; Wed, 12 Aug 2020 18:09:03 -0400 From: Tom Lane To: PegoraroF10 cc: pgsql-general@postgresql.org Subject: Re: Server goes to Recovery Mode when run a SQL In-reply-to: <1597265258319-0.post@n3.nabble.com> References: <1549209182255-0.post@n3.nabble.com> <37bc715f-12e2-84ac-6492-88d7b6306777@aklaver.com> <1549211574297-0.post@n3.nabble.com> <20190204010709.GC1881@paquier.xyz> <1597265258319-0.post@n3.nabble.com> Comments: In-reply-to PegoraroF10 message dated "Wed, 12 Aug 2020 13:47:38 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <323344.1597270142.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 12 Aug 2020 18:09:02 -0400 Message-ID: <323345.1597270142@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PegoraroF10 writes: > Hi Michael, so sorry for the delay. I did never had that problem again, = so > tougth it was solved, but seems not. We have two different SQL which pus= hs > server to recovery mode. This SQL is the hardest one, because you=C2=B4l= l have to > wait some time to get the error. Just runs this SQL, opens your HTOP and > wait, you=C2=B4ll see your memory growing and growing until ... = Are you sure this query ever terminates? It looks to me like it just keeps producing tuples indefinitely until you kill it or something runs out of memory. If the response to "out of memory" is a server crash rather than something nicer, you probably need to corral your OOM killer. See https://www.postgresql.org/docs/current/kernel-resources.html#LINUX-MEMORY= -OVERCOMMIT regards, tom lane