pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: vvinnikov@list.ru
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17765: SELECT CAST(true AS BIGINT);
Date: Tue, 31 Jan 2023 10:00:25 -0500
Message-ID: <1076777.1675177225@sss.pgh.pa.us> (raw)
In-Reply-To: <17765-3090f5817e7832f5@postgresql.org>
References: <17765-3090f5817e7832f5@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> 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





view thread (3+ messages)

Message-ID: <1076777.1675177225@sss.pgh.pa.us>
Permalink:  ../1076777.1675177225@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1076777.1675177225@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, vvinnikov@list.ru, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17765: SELECT CAST(true AS BIGINT);
  In-Reply-To: <1076777.1675177225@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox