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 1oDr5O-00037A-Dv for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 17:32:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDr5N-0002ex-91 for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 17:32:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDr5M-0002cb-V5 for pgsql-general@lists.postgresql.org; Tue, 19 Jul 2022 17:32:40 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDr5J-00030G-Bs for pgsql-general@lists.postgresql.org; Tue, 19 Jul 2022 17:32:40 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 858693200312; Tue, 19 Jul 2022 13:32:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 19 Jul 2022 13:32:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1658251954; x= 1658338354; bh=7gYjuf8k5Vo1lw+qjusJAqKKCnMxmLnBIqEPUsYqOZE=; b=N GTQ22L/Cj1MgWYdfP3j1O64tzFIIWYPmIhmGglKKzwOY0dUNGSGTA6iDP0M2Mjn1 h029QxucV5oRBWaQzqazNsOfhcuQVi83U9vYU0GnghipP2f6RwNx/eYv7wXofSEr GvPYyx7PhoWTHBzoLj35YI6MYtGsBGhA9eJD8iTBx2f8V27YSzXYAWloC/CsG4nL 1ZS746aQFFgNMkVgD4OETDgkBQwuxOPSdzvzQ4nKLo/mV0iFB80vny5ModBirFBQ oFKOxTBOZQoC77k5OfLtRJGmXMsN2UPaG4IAI/cdp0Dv35gof8s8lQHhZmbJDJuX dvY5tuj4r3/MGYW9ohApA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1658251954; x=1658338354; bh=7 gYjuf8k5Vo1lw+qjusJAqKKCnMxmLnBIqEPUsYqOZE=; b=Wqny3KtWGUuAFzQuk NETvhd0y90DzVe3SjbbY+fekbVpMp6WvZu0vjRkWRcfZVQcw4VKeE8s16TlPQnLF Eo0CXRuqme0QE+9Ok7IHr4hbcvXnF2Fm+CkIj4hqN4f0AWY2f3Fd/X3Rx9BloeVg MVbvgcQu8PPn2DlD0L/bC6eIKeDjG/ewGvONLtVyZ9iyWzwGVFniMYejnZ1M/CRM azT9nJaSKqpxGRCrACf0FmMBPO/vW0IX7PpoY3KndPBj2/t/leAPKkRLPr7t7QBr Xbu11TAo0AFZ5oMx0pn8ZfUG9m+sU3zjiRHO0dxVbmafA1y7XtyS1jlMWiqj0Ns0 k4pDw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeltddguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepteelheffjeeiudehtefggeeiieeijeffheduvdeu udekgedvtdduteeviefftdefnecuffhomhgrihhnpegurghrohhlugdrnhgvthenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Jul 2022 13:32:33 -0400 (EDT) Subject: Re: pgsql 10.19 : "ERROR: cannot convert infinity to numeric" except there is no infinity To: Achilleas Mantzios , pgsql-general@lists.postgresql.org References: <1c9f27e7-459e-2e05-7129-e9e14ca503b7@matrix.gatewaynet.com> <35ecc7d6-14a6-7898-db04-236504946589@aklaver.com> From: Adrian Klaver Message-ID: <0d1a9696-db2d-ace7-5879-16fed625386a@aklaver.com> Date: Tue, 19 Jul 2022 10:32:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.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: Archived-At: Precedence: bulk On 7/19/22 10:26 AM, Achilleas Mantzios wrote: > Thank you Adrian! Actually thank: https://sqlformat.darold.net/ > > Στις 19/7/22 18:36, ο/η Adrian Klaver έγραψε: >> On 7/19/22 03:38, Achilleas Mantzios wrote: >> >> I reformatted queries to see thing better. >> >>> >> AND numrange(ceptl.min_alarm::numeric, ceptl.max_alarm::numeric, '()') >> @> cept.value::numeric >> ORDER BY >>     1; >> >> So the above fails. In your title when you say there is no infinity >> that means the cept.value, ceptl.min_alarm or ceptl.max_alarm  fields >> do not have any '-infinity' or 'infinity' values, correct? > There is infinity in cept.value , just not in this result set. > I got confused and wrongly assumed that since the result set (without > the filter in the WHERE clause including cept.value::numeric) did not > contain any infinity it should also work with the filter in the WHERE > clause. Apparently a subplan executes this conversion in the WHERE > before the other filters. I did not do any analyze to prove this. >> Have you tried: NULLIF(cept.value, 'inf')::numeric >>> -- >>> Achilleas Mantzios >>> DBA, Analyst, IT Lead >>> IT DEPT >>> Dynacom Tankers Mgmt >>> >> >> > > -- Adrian Klaver adrian.klaver@aklaver.com