Re: BUG #17765: SELECT CAST(true AS BIGINT);

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: vvinnikov(at)list(dot)ru
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17765: SELECT CAST(true AS BIGINT);
Date: 2023-01-31 15:00:25
Message-ID: 1076777.1675177225@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Scott Mead 2023-01-31 15:35:54 Re: [BUG] Autovacuum not dynamically decreasing cost_limit and cost_delay
Previous Message David G. Johnston 2023-01-31 14:48:53 Re: BUG #17765: SELECT CAST(true AS BIGINT);