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 1pMs7e-0007Hl-Jj for pgsql-bugs@arkaria.postgresql.org; Tue, 31 Jan 2023 15:00:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pMs7d-0000LF-0g for pgsql-bugs@arkaria.postgresql.org; Tue, 31 Jan 2023 15:00:33 +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 1pMs7c-0000L4-Od for pgsql-bugs@lists.postgresql.org; Tue, 31 Jan 2023 15:00:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pMs7a-00083Q-Pa for pgsql-bugs@lists.postgresql.org; Tue, 31 Jan 2023 15:00:32 +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 30VF0PK11076778; Tue, 31 Jan 2023 10:00:25 -0500 From: Tom Lane To: vvinnikov@list.ru cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17765: SELECT CAST(true AS BIGINT); In-reply-to: <17765-3090f5817e7832f5@postgresql.org> References: <17765-3090f5817e7832f5@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 31 Jan 2023 13:39:58 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1076776.1675177225.1@sss.pgh.pa.us> Date: Tue, 31 Jan 2023 10:00:25 -0500 Message-ID: <1076777.1675177225@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > ERROR: cannot cast type boolean to bigint > That's inconsistent since casting boolean to int is OK (SELECT CAST(true AS > INT);) or double casting is OK (SELECT CAST(CAST(true AS INT) AS BIGINT);). We also don't offer direct casts from bool to smallint, numeric, float4, or float8. I'm disinclined to add any of those, although you certainly can make them locally if you need them. regards, tom lane