Re: BUG #17765: SELECT CAST(true AS BIGINT); - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17765: SELECT CAST(true AS BIGINT);
Date
Msg-id 1076777.1675177225@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17765: SELECT CAST(true AS BIGINT);  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #17765: SELECT CAST(true AS BIGINT);
Next
From: Bowen Shi
Date:
Subject: Re: BUG #17744: Fail Assert while recoverying from pg_basebackup