Neil Conway writes:
> nconway=# select 1::bit;
> bit
> -
> 0
> (1 row)
Oops. I've always thought that casting between int and bit should be
disallowed, but apparently it keeps sneaking back in.
> nconway=# select X'4'::bit varying;
> varbit
>
> 0100
> (1 row)
> -- why is that 4
Is the following behavior intentional? If so, what's the reasoning
behind it?
nconway=# select 1::bit;
bit
-
0
(1 row)
nconway=# select '1'::bit;
bit
-
1
(1 row)
nconway=# select X'1'::bit;
bit
-
0
(1 row)
nconway=# select 1::bit varying;
ERROR: cannot cast type integer to bi